Setting the ActiveStandardStyle

Setting the ActiveStandardStyle

CadUser46
Collaborator Collaborator
767 Views
2 Replies
Message 1 of 3

Setting the ActiveStandardStyle

CadUser46
Collaborator
Collaborator

A bit of a strange one.  I have a userform for people to configure a new drawing.  One of the options they have is to select the Active Standard from a choice of the two company standards. 

 

The template drawing contains both of the standards as does the styles library but the company ISO standard is the default.  If the user selects the company ANSI standard the active standard appears correct in document settings but it produces dimensions like its still stuck on the ISO default as the template is saved.  Looking in the styles library i can see the standard says ANSI but the Available Styles and Object defaults read as if they are the ISO standard.

 

First question, am i setting the active standard correctly?

 

Dim odoc2 As Inventor.DrawingDocument
Set odoc2 = ThisApplication.ActiveDocument
    'Get reference to active standard object
Dim oActive As DrawingStandardStyle
Set oActive = odoc2.StylesManager.ActiveStandardStyle
    oActive.Name = ComboBox1.Value

 

Thanks


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Accepted solutions (1)
768 Views
2 Replies
Replies (2)
Message 2 of 3

CadUser46
Collaborator
Collaborator

Thinking about it using this method, am i just changing the name of the one that is already active ie changing then name of ISO to ANSI?


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 3 of 3

CadUser46
Collaborator
Collaborator
Accepted solution

OK, just found another thread where Rocky posted.  Looks like im doing it wrong.  Every days a school day.

 

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Setting-the-active-standard-ActiveStan...

 

Sub ChangeStandardStyle()
   
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
   
    oDoc.StylesManager.ActiveStandardStyle = oDoc.StylesManager.StandardStyles("Default Standard (ISO)")
    Debug.Print oDoc.StylesManager.ActiveStandardStyle.Name
End Sub


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes