turn on suggestions

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
- Referencing an edge on a body

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
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-15-2016 07:58 AM

Is there a way to get an edge from a body that we know exists, just by having the startPoint and endPoint? And not using the journal identifier. We don't want to have to search through all edges on the bodyand compare start and end points until we the one we are looking for. We would like to be able to get the edge O(1) run time. If you know what that means?

Also...

Edge edge1 = (Edge)extractFace1.FindObject("EDGE * 1 * 6 {(4.875,4.25,1.625)(4.875,0.8125,1.625)(4.875,-2.6

this is a copy of a journal identifier of the edge we are trying to reference. We understand the coordinates part.

What is the part "EDGE * 1 * 6" referencing?

1 REPLY

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

01-16-2016 02:22 AM - edited 01-16-2016 02:27 AM

If the only info you have is the end-point coordinates, then you'll need to do some geometric calculations to identify the edge. So, as you say, you can cycle through the edges of the body, looking for one that has the known end-points. Note that this won't always work -- the body might have several edges that have the same end-points.

You can do it a bit more efficiently using SNAP functions. A SNAP body has a property that gives you all its vertices, and you can cycle through these, instead of cycling through edges, which would probably be a bit faster. Then, once you've got the vertex, you can ask for all the edges that meet at this vertex.

Unless the body has millions of edges, cycling through them (or cycling through the vertices) will be very fast, even though it's an O(n) operation. I'd suggest you code this first, and see if it's fast enough. If it's not, then you could implement some sort of hashing or spatial indexing scheme.

yamada

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc