Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Ilogic drawing dimension object

Anonymous

Ilogic drawing dimension object

Anonymous
Not applicable

Hi, I am trying to get the ModelValue of a dimension on a drawing.

 

I can select the dimension and add some custom text to this. At the same time I would like to read the ModelValue and export this to a custom parameter.

 

Would anyone be able to help?

 

thanks,

 

Stuart

0 Likes
Reply
Accepted solutions (1)
673 Views
2 Replies
Replies (2)

RodrigoEiras
Advocate
Advocate
Accepted solution

 

Hi Stuart,

 

The syntax to do that is not complicated, and it is shown below. There are two tricky things to take into account:

 

1.- ModelValue is given in Inventor Database units, which are cm for distance, rad for angles, ..

 

Inventor internally always uses cm (centimeters) for length, radiansfor angle, kg (kilograms) for mass and seconds for time

 

2.- You may want to know what type of dimension you are dealing with to anticipate the units, so maybe you have to check the dimension type to see if it is linear, angular, ... That you can do through oDrawingDimension.Type 

 

I hope this helps!

 

 

SyntaxEditor Code Snippet

oDrawing = ThisDrawing
oSheet = ActiveSheet.Sheet



For Each oDrawingDimension In oSheet.DrawingDimensions

    Trace.writeline(oDrawingDimension.ModelValue)
    
    ParameterX = oDrawingDimension.ModelValue


Next

 

0 Likes

Anonymous
Not applicable

Hi Rodrigo,

 

Thats been a great help thanks!

 

It took a little bit of work to get it to write the selected dimension and convert to the correct unit, but it does just what i need now

It was the trace.writeline i was missing for the best part.

 

thanks again for your  help.

 

Stuart

0 Likes