Setting the active standard, ActiveStandarsStyle

Setting the active standard, ActiveStandarsStyle

Anonymous
Not applicable
878 Views
2 Replies
Message 1 of 3

Setting the active standard, ActiveStandarsStyle

Anonymous
Not applicable

Hi

 

I have been working on a method to set the active standard from VBA in Inventor 11, but with no luck.

From help the property ActiveStandarsStyle should be able to get and set the active standard style.

I have managed to get the standard style name by:

 

oStyleName = oIDWDoc.StylesManager.ActiveStandardStyle.Name

 

but can't figure out how to set it.

 

Any suggestions?

 

Regards Claus

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

YuhanZhang
Autodesk
Autodesk

See below sample code:

 

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

 

 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 3

Anonymous
Not applicable

So easy...! And it works.

Thanks a lot.

 

Ragards Claus

0 Likes