Get DerivedPart BrowserNode from PartFeature

Get DerivedPart BrowserNode from PartFeature

Maxim-CADman77
Advisor Advisor
259 Views
1 Reply
Message 1 of 2

Get DerivedPart BrowserNode from PartFeature

Maxim-CADman77
Advisor
Advisor

Nowadays I try to investigate relationships of PartFeatures and BrowserNodes using "Upper Printer Casing.ipt" (a component of "Inkjet Printer Prototype" 2019 sample available at Inventor Sample Files webpage) as a dataset.

 

From PartFeature I've got BrowserNode labeled "Solid3::Printer Casing.ipt":

 

I'd like to know how to get BrowserNode labeled "Printer Casing.ipt" (DerivedPartComponent) which seems a sort of parent (one of the two??) for the mentioned BrowserNode.

 

When I try to use Parent property I get "Solid1" label:

Printer-Casing-BrNode.png


When I read the count of AllReferencedNodes I get "1".

 

My iLogic-code is:

Option Explicit On

Sub Main

Dim oPartDoc As PartDocument = ThisDoc.Document

For Each oFtr As PartFeature In oPartDoc.ComponentDefinition.Features
	logger.info("Part-Feature-Name: " & oFtr.Name)

	If oFtr.Type = ObjectTypeEnum.kReferenceFeatureObject Then
		Dim oBrPn As BrowserPane = oPartDoc.BrowserPanes("PmDefault")
		oBrPn.Activate

		Dim oBrNd1 As BrowserNode = oBrPn.GetBrowserNodeFromObject(oFtr)
		logger.info("Feature-Browser-Node: " & oBrNd1.BrowserNodeDefinition.Label)

		Dim oBrNd2 As BrowserNode = oBrNd1.Parent
		logger.info("Parent-Browser-Node: " & oBrNd2.BrowserNodeDefinition.Label)

		logger.info("oBrNd1.AllReferencedNodes.Count = " & oBrNd1.AllReferencedNodes(oBrNd1.BrowserNodeDefinition).Count)
		EXIT SUB
	End If
Next

End Sub

 

What I'm missing?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
260 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Hi @Maxim-CADman77.  I think you would need to get the ReferenceFeature.ReferenceComponent to a ReferenceComponent Type variable, then use BrowserPane.GetBrowserNodeFromObject() on that variable to get the BrowserNode representing that feature's ReferenceComponent.  I think this is necessary because the current document's ComponentDefinition is going to be the 'parent' of the derived-in geometry.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes