×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Change Global Co-ordinates to Local Co-ordinates using NXOpen?

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

RE: Change Global Co-ordinates to Local Co-ordinates using NXOpen?

Here is a code snippet from GTAC that will convert global coordinates to local:

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 Function 

And 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 Function 

www.nxjournaling.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources