Change Global Co-ordinates to Local Co-ordinates using NXOpen?
Change Global Co-ordinates to Local Co-ordinates using NXOpen?
(OP)
Hi All,
I have a program which works on a part and retrieves its edge vertices, However the code retrieves the co-ordinate values in global co-ordinates rather than local co-ordinates.
For Each objEdge As Edge In CType(objFeat, Extrude).GetEdges()
Dim objPoint1 As Point3d
Dim objPoint2 As Point3d
objEdge.GetVertices(objPoint1, objPoint2)
next
How can i retrieve the values in Local Co-ordinates system?
Please Help !!!
Regards,
Amitabh
I have a program which works on a part and retrieves its edge vertices, However the code retrieves the co-ordinate values in global co-ordinates rather than local co-ordinates.
For Each objEdge As Edge In CType(objFeat, Extrude).GetEdges()
Dim objPoint1 As Point3d
Dim objPoint2 As Point3d
objEdge.GetVertices(objPoint1, objPoint2)
next
How can i retrieve the values in Local Co-ordinates system?
Please Help !!!
Regards,
Amitabh





RE: Change Global Co-ordinates to Local Co-ordinates using NXOpen?
CODE
'Date: 11/18/2010 'Subject: Sample NX Open .NET Visual Basic routine : map point from absolute to wcs ' 'Note: GTAC provides programming examples for illustration only, and 'assumes that you are familiar with the programming language being 'demonstrated and the tools used to create and debug procedures. GTAC 'support professionals can help explain the functionality of a particular 'procedure, but we will not modify these examples to provide added 'functionality or construct procedures to meet your specific needs. Function Abs2WCS(ByVal inPt As Point3d) As Point3d Dim pt1(2), pt2(2) As Double pt1(0) = inPt.X pt1(1) = inPt.Y pt1(2) = inPt.Z ufs.Csys.MapPoint(UFConstants.UF_CSYS_ROOT_COORDS, pt1, _ UFConstants.UF_CSYS_ROOT_WCS_COORDS, pt2) Abs2WCS.X = pt2(0) Abs2WCS.Y = pt2(1) Abs2WCS.Z = pt2(2) End FunctionAnd here is the related function that converts local to global:
CODE
'Date: 06/14/2011 'Subject: Sample NX Open .NET Visual Basic routine : map point from WCS to absolute ' 'Note: GTAC provides programming examples for illustration only, and 'assumes that you are familiar with the programming language being 'demonstrated and the tools used to create and debug procedures. GTAC 'support professionals can help explain the functionality of a particular 'procedure, but we will not modify these examples to provide added 'functionality or construct procedures to meet your specific needs. Function WCS2Abs(ByVal inPt As Point3d) As Point3d Dim pt1(2), pt2(2) As Double pt1(0) = inPt.X pt1(1) = inPt.Y pt1(2) = inPt.Z ufs.Csys.MapPoint(UFConstants.UF_CSYS_ROOT_WCS_COORDS, pt1, _ UFConstants.UF_CSYS_ROOT_COORDS, pt2) WCS2Abs.X = pt2(0) WCS2Abs.Y = pt2(1) WCS2Abs.Z = pt2(2) End Functionwww.nxjournaling.com