How to get edge name from selection

How to get edge name from selection

MTheDesigner
Advocate Advocate
1,045 Views
5 Replies
Message 1 of 6

How to get edge name from selection

MTheDesigner
Advocate
Advocate

Hi all, I am trying to find an edge name so that I can create multiple instances of the same object and use the same edge in each occurrence in a constraint. So far I can't find a way to access the names of the edges, I know they have names because if I make a constraint manually and use the capture current state tool it shows the names of the edges used to constrain.

 

Sometimes the constrains also reference a proxy edge, but I am unsure exactly what this is or why it is used. I have looked at the documentation and still don't understand when they should be used.

 

Any help is appreciated thanks.

 

 

0 Likes
1,046 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @MTheDesigner.  That little iLogic trick 'capture current state' will automatically assign a name to a Face or Edge or Vertex, if they have not already been assigned a name.  So, likely that edge did not have that name before you used that 'capture current state' tool.  Since about Inventor 2019.1 (I think), we have had a user interface tool available in the Part environment only, that allows us to select either a Face, Edge, or Vertex, and right-click, and choose 'Assign Name', to assign names to geometry.  Before that user interface tool became available, we could still do that, but not so easily (all had to be done using API code).  All geometry within Assemblies is considered 'proxy' geometry, because nothing real actually exists (created) directly within an assembly.  If you create a work feature (WorkPlane, WorkAxis, WorkPoint) in an assembly, then that will not be a proxy object though.  So, when you select a component's face within an assembly, that is a FaceProxy, not a regular Face.  If you select a component's Edge within an assembly, it is an EdgeProxy object, not a regular Edge.  Same with Vertex.  Get the picture?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

WCrihfield
Mentor
Mentor

Also, when using iLogic, you can access any existing 'named' geometry in a document (parts only right now), you can use the following tool to get started.  Once you have that NamedEntities interface object, you can use the properties and methods defined under it to assign names to stuff by code, retrieve existing named entities, or identify names of entities that may have been named.  Etc.

oNEs = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document)

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 6

MTheDesigner
Advocate
Advocate
Weirdly enough only one of the two edges that I am trying to work with calls itself a proxy.
Do you know of any ways that I can get reference to the same edge of an identical assembly placed by my code? It would be very troublesome to have to add named faces to a library of over 700 bolt assemblies.
0 Likes
Message 5 of 6

MTheDesigner
Advocate
Advocate
@WCrihfield Actually, how did constraints work before 2019 if edges didn't have identifiers? there has to be some way of identifying the edges, is there anything other than names that could be leveraged?
0 Likes
Message 6 of 6

WCrihfield
Mentor
Mentor

Hi @MTheDesigner.  The next best way to specifically identify one edge from all others would probably be to utilize the ReferenceKeyManager methods, and the Edge.GetReferenceKey methods.  I honestly have not used these tools that much myself yet, but the topic has been discussed in many other forum posts within this forum.

Here a are a few related links:

Define face 

Investor API: Tag/Mark sketch entities for later reference 

Having lots of trouble with ReferenceKeyManager and BindKeyToObject 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes