Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Self-explanatory. How do I access this property and set it? I cannot seem to figure it out.
Solved! Go to Solution.
Self-explanatory. How do I access this property and set it? I cannot seem to figure it out.
Solved! Go to Solution.
You can find at DimensionStyle Object.
Hi @inulobo, I recommend bookmarking this page in the Inventor API documentation: Inventor API Reference Manual: Objects. After going to that page, you can hit Ctrl+F and search for any type of object.
In this case, searching for "DimensionStyle" takes you to the DimensionStyle object. Scrolling down to the bottom, you can see the "Accessed From" to see the various ways you can get to the DimensionStyle object. In this case there are several (usually there's only one or two).
Which one to use depends on what you're trying to do, which you weren't very specific on. However, assuming you want to change the style for all "normal" dimensions in your drawing, you would want to access whatever the default "LinearGeneralDimension" style is for your drawing. If that's the case, this is how I would read or change the "Spacing" value for your drawing:
' Get active Drawing. Dim drawDoc As DrawingDocument = ThisDoc.Document ' Get default DimensionStyle for general dimensions. Dim defaultDimStyle As DimensionStyle = drawDoc.StylesManager.ActiveStandardStyle.ActiveObjectDefaults.LinearDimensionStyle ' To read the current spacing: Dim currentSpacing As Double = defaultDimStyle.Spacing ' To change the spacing: defaultDimStyle.Spacing = 0.25 * 2.54 ' (Multiply by 2.54 because Inventor API works in centimeters)
However, if you have more than one Dimension Style that you use, you may want to change the Spacing value for those as well. But we would need more details about what you're wanting to do.