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

1 Like

Hi Dale, Again,

Did anyone figure out or make a sample script for auto dimensioning an object on a layout.

Ie add dimensions to top, front, side views of an isolated object on the layout.

Like moritzcramer’s query:
“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”

Hi @lukehickmandesign,

Actually, you want to transform, not project. Here is a sample that works somewhat like Rhino’s ChangeSpace command that should give you a hint how to transform points.

test_change_space.py (2.7 KB)

Here are a couple of dimensioning samples that might be helpful.

test_dimlinear.py (2.0 KB)

test_create_and_quote_bounding_box.py (1.2 KB)

– Dale

Thanks Dale, I will continue to beaver away.

Are there many people / teams who are fully automating documentation with auto dimensions and layouts that your know of? Or is this a minority?

Hi Dale,

Hopefully a simple question.

Do you make the dimensions first then change space, or make points then change space and dimensions those points?

cheers mate.(from australia)

Hi @lukehickmandesign,

If you want to make your dimensions in the model, then I’d do the latter.

– Dale