Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Siemens PLM Community
- NX Customization and Programming
- NX Programming & Customization Forum
- Working with sketch coordinate system

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-24-2016 02:24 PM

Hello everyone!

Is it possible to programmatically create lines in sketch entering start and end points values relative to the internal sketch coordinate system? I tried to record a journal but it was of no use because points there are absolute. Can you please give an advice?

3 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-27-2016 03:04 AM

Then you can create a line with "workpart.CurveCollection.CreateLine(Point3d, Point3d)" and add it to the sketch with "sketch.AddGeometry(DisplayableObject)"

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-23-2017 11:01 PM

Is there any way possible to programatically distinguish and select the sketch from the part body?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-26-2017 09:19 AM

Mapping from the sketch coordinate system to the absolute coordinate system is pretty simple.

Suppose that

- the sketch origin is at the point sketchOrigin
- the x-axis of the sketch coordinate system is the vector sketchX
- the y-axis of the sketch coordinate system is the vector sketchY

Then, if you have a point with coordinates (h,k) in the sketch coordinate system, its absolute coordinates are

sketchOrigin + h*sketchX + k*sketchY

Here, the "*" denotes scalar-vector multiplication, and the "+" is vector addition.

There are functions in both SNAP and NX/Open to do this sort of mapping, too, but it's just as easy to do it from first prnciples.

yamada

Follow Siemens PLM Software

© 2019 Siemens Product Lifecycle Management Software Inc