Changing dimensional variables using iLogic

Changing dimensional variables using iLogic

Anonymous
Not applicable
457 Views
5 Replies
Message 1 of 6

Changing dimensional variables using iLogic

Anonymous
Not applicable

Within AutoCAD its possible to list the dimensional variables in a drawing and set them using AutoLisp or a script. How is the equivalent done within Inventor, using iLogic, rather than using the on screen Styles Editor, and what are the variable names of the dimension features.

0 Likes
458 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor
Could you please explain a bit more in detail of what you mean, so that I understand it better.
Maybe some screenshots!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

Arthur, Thank you for responding.

 

Ilogic can be used for the modification of dimensional variables in parametric models (.ipt files).  My question though relates to the Inventor drawing files (.idw files).  Drawings when created as new are based on templates.  Sometime there is a requirement to change a dimensional variable to make the drawing easier to read.  For example the line thickness of component parts may be increased so that the object is more clearly seen and stands out from the other drawing features.

 

In the above example, the linetype could be increased in width from say 0.01 cm to 0.05 cm by issuing the following statement:

 

ThisDrawing.Document.StylesManager.Layers("Visible (ISO)").LineWeight = 0.50

 

The question is, how can I change the variables of, for example, the sectional arrows or the size of arrow heads on dimensions?  All these features must have associated variables, perhaps also within styles, but how do I access them? Is there a published list of these variables for instance?

 

Below is an image of some typical dimension variables when accessed via the Styles Editor, its these variables I wish to access via iLogic.

 

Thank you.

 

neil_walker_0-1637406632601.png

 

0 Likes
Message 4 of 6

bradeneuropeArthur
Mentor
Mentor
Will have a look

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 6

bradeneuropeArthur
Mentor
Mentor

With this:

Dim a As Inventor.DrawingDocument = ThisDrawing.Document
Dim b As Inventor.Sheet = a.ActiveSheet
Dim c As Inventor.DimensionStyle = a.StylesManager.DimensionStyles.Item("Default - Method 2a (DIN)")
'MsgBox(c.Name)
Dim d As Double = 1
c.Gap=d

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 6

Anonymous
Not applicable

Hi,  I have now managed to find a few more dimension variables and have tested them using the simple iLogic code below.  If the value 1 is changed to 2, the changes can be seen, and the reverse, when changed from 2 to 1. The number 10.0 being to maintain the cm default units.

 

The lines of code below being purely to test the variable names.

 

The big question remains, how can I find out what the remainder of the dimension variable names are called?  I recall in AutoCAD being able to issue the command SETVAR and having the current drawing variables listed together with their value. Is there a developers guide available as per AutoLISP?

 

Thank you

 

ThisDrawing.Document.StylesManager.Layers("Visible (ISO)").LineWeight = 0.51 * 1 / 10.0
ThisDrawing.Document.StylesManager.DimensionStyles("Default (ISO)").Extension = 3.18 * 1 / 10.0
ThisDrawing.Document.StylesManager.DimensionStyles("Default (ISO)").OriginOffset = 3.18 * 1 / 10.0
ThisDrawing.Document.StylesManager.DimensionStyles("Default (ISO)").Gap = 0.76 * 1 / 10.0
ThisDrawing.Document.StylesManager.DimensionStyles("Default (ISO)").ArrowheadSize = 2.50 * 1 / 10.0
ThisDrawing.Document.StylesManager.DimensionStyles("Default (ISO)").ArrowheadHeight = 1.00 * 1 / 10.0

 

0 Likes