How do convert a component to its Part equivalent.
I want to get the "FullPath" of the component and the only way I know how to get that is by getting its Part.
Is there a better way of doing this without having to get the Part?
If all you want to do is get the full path to the component part, you can use:
Which is essentially the same as getting the part, but you can do it in one line of code and you don't need to maintain a separate variable referencing the part.
Is the component loaded? If not, you will get a null reference.
You can use the .AskComponentData function that will return the part name even if the component is not loaded.
Here's an incomplete code snippet showing its use:
Dim partName As String = "" Dim refsetName As String = "" Dim instanceName As String = "" Dim origin(2) As Double Dim csysMatrix(8) As Double Dim transform(3, 3) As Double Try If theComp.Prototype.OwningPart.IsFullyLoaded Then 'component is fully loaded Else 'component is partially loaded End If Catch ex As NullReferenceException 'component is not loaded theUfSession.Assem.AskComponentData(theComponent.Tag, partName, refsetName, instanceName, origin, csysMatrix, transform) Catch ex As NXException 'handle exception End Try