Display both dimension name and value in sketch using API

Display both dimension name and value in sketch using API

Anonymous
Not applicable
1,554 Views
4 Replies
Message 1 of 5

Display both dimension name and value in sketch using API

Anonymous
Not applicable

Hi,

 

Using these code, I am able to display either dimension name or value in sketch:

 

TwoPointDistanceDimConstraint iDimension;

iDimesion.Parameter.Name;  // d5

iDimesion.Parameter.Value;  // 25.0mm

 

But How do I display both dimension name followed by dimension value (d5 = 25.0mm) in sketch using Inventor API?

 

Regards,

Prarthana

 

,キャプチャ.PNG

 

 

 

 

 

0 Likes
1,555 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Hello Everyone,

I solved it by myself 🙂
If anyone need it then there is the code:
Inventor.Parameters oParam = default(Inventor.Parameters);
oParam = oPartDoc.ComponentDefinition.Parameters;
oParam.DimensionDisplayType = DimensionDisplayTypeEnum.kDimensionDisplayAsExpression;

Thank you in advance.
Regards,
Prarthana
Message 3 of 5

Anonymous
Not applicable

Change How Dimensions Appear

 

  • In an active sketch, choose one of the dimension display icons in the status bar:
    • Value: Displays sketch dimensions as the calculated value.
    • Name: Displays sketch dimensions as the parameter name.
    • Expression: Displays sketch dimensions as the specified parametric expression.
    • Tolerance: Displays sketch dimensions with a specified tolerance.
    • Precise Value: Displays sketch dimensions as a value, ignoring any precision.
    Note: You can also change how sketch dimensions appear by using the Dimension Properties dialog box. Right-click a dimension in the graphics window and choose Dimension Properties. In the Dimension Properties dialog box, click the Document Settings tab and choose an option from the Modeling Dimension Display menu.

http://help.autodesk.com/view/INVNTOR/2016/ENU/?guid=GUID-026FE8D3-AFBB-4834-BC18-73D9CFF78185

 

0 Likes
Message 4 of 5

cencinaNB2ET
Advocate
Advocate

Hi,

How did you add dimensions with API on that line again?

 

I canst seem to find a way to add a point with dimensions accessing the  Inventor API

Not interested in the display but the adding method...

 

 

 

thanks

0 Likes
Message 5 of 5

Maxim-CADman77
Advisor
Advisor

"Expression" mode shows the real value only  for the simple cases.
I'd rather prefer the mode showing exactly what you initially asked for (i.e. both name and a real value) but i doubt there is such mode in Inventor.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes