biw01
Automotive
- Dec 31, 2011
- 152
Hello Everyone ,
Can someone suggest me a way to retrieve the edge vertex in terms of the associated component and not in terms of the part associated with it.
A sample of what i am able to do is mentioned below
This returns me the edge vertex in terms of the associated part and not the component.
Also i tried doing the following to retrieve the rotation matrix , origin of each component using the method
How can i use the above fetched data to compute edge vertex in terms of component coordinate system ?
Please help ?
Thanks,
Amitabh
Can someone suggest me a way to retrieve the edge vertex in terms of the associated component and not in terms of the part associated with it.
A sample of what i am able to do is mentioned below
Code:
For Each objComp As Component In FnGetAllComponentsInSession()
FnLoadPartFully(FnGetPartFromComponent(objComp))
For Each body As Body In FnGetPartFromComponent(objComp).Bodies()
For Each face As Face In body.GetFaces()
For Each objEdge As Edge In face.GetEdges()
Dim objPoint1 As Point3d
Dim objPoint2 As Point3d
objEdge.GetVertices(objPoint1, objPoint2)
next
next
next
next
Public Function FnGetPartFromComponent(ByRef instance As NXOpen.Assemblies.Component) As NXOpen.Part
Dim tag As NXOpen.Tag = -1
FnGetUFSession.Part.AskTagOfDispName(instance.DisplayName, tag)
Dim part As Part = FnGetNxSession().Parts.Work
For Each prt As NXOpen.Part In FnGetNxSession().Parts
If prt.Tag = tag Then
FnGetPartFromComponent = prt
Exit For
End If
Next
End Function
This returns me the edge vertex in terms of the associated part and not the component.
Also i tried doing the following to retrieve the rotation matrix , origin of each component using the method
Code:
For Each objComp As Component In FnGetAllComponentsInSession()
'Position of component
Dim dOrigin(2) As Double
'Coordinate System Matrix
Dim dCoOrdinateSysMat(8) As Double
'Transformation Matrix
Dim dTransformMatrix(3, 3) As Double
Dim sRefSetName As String
Dim sInstanceName As String
'Output the rotation matrix
ufs.Assem.AskComponentData(objComp.Tag, sCompName, sRefSetName, sInstanceName, dOrigin, dCoOrdinateSysMat, dTransformMatrix)
How can i use the above fetched data to compute edge vertex in terms of component coordinate system ?
Please help ?
Thanks,
Amitabh