- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Getting component from Browsernode
Hey
I have a method that finds the browsernode from the component by using NativeObject. What is the method of doing it the other way round? i.e. finding the object from the Browsernode? I am trying to turn off the components in the assembly but i only have the browser nodes in my method as i am looping them by folder.
The RepNode.NativeObject is the Browsernode and i need to check if its an assembly. If it is, i need to run all child components visiblity off
Dim RepNodes As BrowserNodesEnumerator = oFolder.BrowserNode.BrowserNodes
For Each RepNode As BrowserNode In RepNodes
If oFolder.Name = oViewRep.Name Then
RepNode.NativeObject.Visible = True
If oFolder.Name = "NOZZLE" Then
'LOOP THE TOP LEVEL COMPONENTS
'IF COMPONENT IS ASSEMBLY,
'LOOP CHILD COMPONENTS AND TURN OFF
End If
End If
Next
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
heck this:
Dim oPane As BrowserPane oPane = ThisDoc.Document.BrowserPanes.Item("Model") On Error Resume Next ' Get the last visible child node under the sub-assembly occurrence Dim oTargetNode As BrowserFolder Dim i As Long For i = oPane.TopNode.BrowserFolders.Count To 1 Step -1 oTargetNode = oPane.TopNode.BrowserFolders.Item(i) If oTargetNode.Name = "NOZZLE" Then Dim onode As BrowserNode For Each onode In oTargetNode.BrowserNode.BrowserNodes Dim occ As ComponentOccurrence = onode.NativeObject MessageBox.Show(occ.name, "Title") Next End If Next
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks for the reply
i figure it out last night, i needed to make an occurrence and assign the browsernode to it
If oFolder.Name = "NOZZLE" Then
Dim oComp As ComponentOccurrence = RepNode.NativeObject
If oComp.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
For Each SubComp As ComponentOccurrence In oComp.SubOccurrences
SubComp.Visible = False
Next
End If
End If
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.