Correct Points for Dimension in Layout View

Hi there,

I am currently working on a script to automate layout generation, cause I have a lot files to process.
Now I am a bit stuck with the dimensions. I want to add them on the layout view, but I cannot figure out the correct Point Positions on the Layout page.
Is it somehow possible to convert WorldCoordinates to Layout? Because World to Screen/Client didnt work that way.
Am I missing something?

Hi @moritzcramer,

Have a look at the attached code and let me know if you have any questions.

test_dimlinear.py (2.0 KB)

– Dale

Hi @dale,

thanks for the fast reply.

I tried the script, and also rewrite it to my use case. But sadly it doesnt solve my issue.

I have a few Objects and I want to generate the layouts automatically. For this I use a bounding box e.g. to also calculate the perspective and so on.

So I have those Points of the BoundingBox which I want to use for the Dimension (no user input). So for this I would need to somehow Project those Points to the LayoutPage. Because I want to draw it on the LayoutPage and not in the “World”
When I use your Script (fitted to my demand) the value of the Dimension is completly right, but the Dimension floats somewhere outside the Layout.
Isnt there a simple way to remap the World Point to the DetailPosition?

Hi @moritzcramer,

In general, if you are in a detail view, then get the world-to-page transformation, using DetailViewObject.WorldToPageTransform. Then apply that transform to your points.

– Dale

Hi @dale,

thank you very much! Thats exactly what I wanted. I am a bit confused, cause its my first time using Python for Rhinoscript. Normaly I am using C# and still have to wrap my head around how this Python thing works :slight_smile:
But it seems that the Points in my case are more or less 0.2mm off in the Y direction?!

Hi @moritzcramer,

Without a code sample, I can’t really help.

But here is another sample that might help you.

test_change_space.py (2.7 KB)

– Dale