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: 

Inventor Node Label Updates

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
kakers
1171 Views, 3 Replies

Inventor Node Label Updates

Hello,

I am attempting to rename a browser node. Here is the code I'm using and I'm getting a "Property 'Label' is 'ReadOnly'" error. In the API I found a note about using SetLabel() but that seems to only have  ones for ClientMade browser nodes.

 

 oSubAssyNode.BrowserNodeDefinition.Label = "XXX"

 

Any thoughts?

Thanks

3 REPLIES 3
Message 2 of 4
nagwani
in reply to: kakers

Hi,

 

You cannot definitly change the fixed nodes like Origin, X,Y,Z plane and Axes, but you can change the names of features,work geometry and sketches which were created by you.

 

Below is sample code taken from help, the sample code iterates the browser node tree changes changes the Label of Extrusion and Sketch through the Name property of native object.

 

Hope this helps!

 

-Ishwar N

Private Sub QueryModelTree()
    Dim Doc As Document
    
    If (ThisApplication.Documents.Count <> 0) Then
        Set Doc = ThisApplication.ActiveDocument
    Else
        MsgBox "There are no open documents!"
        Exit Sub
    End If

    Dim oTopNode As BrowserNode
    Set oTopNode = Doc.BrowserPanes("Model").TopNode

 

    Call recurse(oTopNode)
End Sub
Sub recurse(node As BrowserNode)
    If (node.Visible = True) Then
        Debug.Print node.BrowserNodeDefinition.Label
        
        If node.BrowserNodeDefinition.Label = "Sketch1" Then
            node.NativeObject.Name = "MySketch"
        End If
        If node.BrowserNodeDefinition.Label = "Extrusion1" Then
            node.NativeObject.Name = "MyExtrusion"
        End If
        
        Dim bn As BrowserNode
        For Each bn In node.BrowserNodes
            Call recurse(bn)
        Next
        
    End If
End Sub

 

Message 3 of 4
kakers
in reply to: nagwani

Thanks so much. This worked perfectly.
Message 4 of 4
linjone09
in reply to: kakers

It cannot work in that situation.

Repair body's label.

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

Post to forums  

Autodesk Design & Make Report