Code to create/change text on Active Standard change

Code to create/change text on Active Standard change

andrew_wilkinson
Contributor Contributor
462 Views
2 Replies
Message 1 of 3

Code to create/change text on Active Standard change

andrew_wilkinson
Contributor
Contributor

Hi,

 

My company often switch between Inch and Metric and I like to show on the drawing what the unit of measure is without adding a suffix to all the dimensions. 

 

Some simple code that will change a line of text (ALL DIMENSIONS IN MM and ALL DIMENSIONS IN INCHES) when the "active standard" is changed on the drawing from our standards "INCH ISO" to "METRIC ISO" 

 

Anyone got any ideas? 

 

Thanks

 

Andy

0 Likes
463 Views
2 Replies
Replies (2)
Message 2 of 3

Mike.Wohletz
Collaborator
Collaborator

If you have iLogic you can link your text to a custom property and ten manage the update with something like this:

 

If ThisDrawing.Document.StylesManager.ActiveStandardStyle.Name = "INCH ISO" Then
iProperties.Value("Custom", "ActiveStandardsNote") = "ALL DIMENSIONS IN INCHES"
Else If ThisDrawing.Document.StylesManager.ActiveStandardStyle.Name = "METRIC ISO" 
iProperties.Value("Custom", "ActiveStandardsNote") = "ALL DIMENSIONS IN MM"
Else
iProperties.Value("Custom", "ActiveStandardsNote") = ""
End If
iLogicVb.UpdateWhenDone = True

 

0 Likes
Message 3 of 3

andrew_wilkinson
Contributor
Contributor

Hi,

 

Thanks for the reply but unfortunately we do not use Ilogic in all our locations and it would be much easier if this was VBA.

 

Thanks

 

andy

0 Likes