Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Access View Label Defaults via Inventor API

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
bretrick30
301 Views, 2 Replies

Access View Label Defaults via Inventor API

I am trying to access the View Label Defaults that are set in the Styles Manager using the API.  I have looked through the Programming help and I found the following method that I believe is what I am looking for.  The problem is, I dont understand how to use it.  It wants me to pass it arguments which would make sense if I was trying to set the Defaults, but I am just trying to get the default FormattedText of the Labels.

 

DrawingStandardStyle.GetViewLabelDefaults Method DrawingStandardStyle.GetViewLabelDefaults( ViewType As DrawingViewTypeEnum, Prefix As String, Visible As Boolean, FormattedText As String,ConstrainToBorder As Boolean, PlaceBelowView As Boolean )

 

Any help would be greatly appreciated.

 

Thanks,

2 REPLIES 2
Message 2 of 3
YuhanZhang
in reply to: bretrick30

Only the first argument is input argument which you need to specify which kind of drawing view to get its view label defaults, and the others are output arguments and you need to define proper variables to receive them and then you can query their values after calling this method. Below is VBA sample:

 

Sub GetViewLabelDefaultsSample()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oStylesManager As DrawingStylesManager
    Set oStylesManager = oDoc.StylesManager
    
    Dim oStandard As DrawingStandardStyle
    Set oStandard = oStylesManager.ActiveStandardStyle
    
    ' Get the view label defaults for draft view
    Dim sPrefix As String, bVisible As Boolean, sFormattedText As String, bConstrainToBorder As Boolean, bPlaceBelowView As Boolean
    Call oStandard.GetViewLabelDefaults(kDraftDrawingViewType, sPrefix, bVisible, sFormattedText, bConstrainToBorder, bPlaceBelowView)
    
    Debug.Print "The prefix is: " & sPrefix
    Debug.Print "The formatted text is: " & sFormattedText
End Sub

 

Hope this helps.



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
bretrick30
in reply to: YuhanZhang

Thank you very much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report