Unique, immutable entity identifier

Unique, immutable entity identifier

Jonathan_Bell82GXG
Enthusiast Enthusiast
1,161 Views
8 Replies
Message 1 of 9

Unique, immutable entity identifier

Jonathan_Bell82GXG
Enthusiast
Enthusiast

Is there some method of retrieving or attaching a unique identifier to an entity? The entity would need to maintain that identifier no matter what changes occur to it (layer changes, color changes, lengthening, etc) in a given drawing session. Ideally if the entity is a polyline, exploding it would attach that identifier to each of the resulting subentities (and there would be some way to track, based on this kind of identifier, which entities went into a joined/grouped entity). Any ideas? 

0 Likes
Accepted solutions (1)
1,162 Views
8 Replies
Replies (8)
Message 2 of 9

paullimapa
Mentor
Mentor

Handles are the only thing that comes close. But when say a Pline is exploded even the handle is gone and each individual line segment will be assigned their own handles


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 9

komondormrex
Mentor
Mentor

a string for instance attached as xdata to a pline will be inherited by all segments after pline is exploded. so attach unique string identifier as xdata to every pline you want to track.

0 Likes
Message 4 of 9

Jonathan_Bell82GXG
Enthusiast
Enthusiast

This gets me closer to what I want, but still not arbitrary enough to handle different cases. Basically what I'm trying to do is update a selection set with new entity data as the original entities change in any way. Extended data works well for some things (but not making entities into regions), but I've also noticed that entity names (might?) change in predictable ways. It seems like for a given entity any changes made to it preserve all entity name characters except the last 3. 

 

If I'm onto something, is there an existing reference for ways the entity name might change?

0 Likes
Message 5 of 9

komondormrex
Mentor
Mentor

well, that should be hexadecimal counter. the more entities in a database the more hex digits from the end in entity name identifier will change. it is not a good idea to count on that hex counter, imho.

0 Likes
Message 6 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@Jonathan_Bell82GXG wrote:

.... entity names (might?) change in predictable ways. ....


Entity names won't be a good basis for such a thing -- they change but not in predictable ways.  They will even be different for the same entity, without anything about it having been changed, the next time you open the drawing.  So if you're talking about something that will be retained when the drawing is closed, they cannot serve the purpose.  That's why Handles were suggested -- an object's Handle never changes, and remains with closing and re-opening the drawing.

 

Entity names have other complications [which are true of Handles, too].  For example, if you use PEDIT to Join something to an existing Polyline as initial selected object, the result has the same entity name as the original one.  But if you use JOIN to connect multiple things together, I have found that the result may or may not have the same entity name as one of the objects in the original selection.  If you Copy something from a drawing and Paste it into another, it will not have the same entity name in the other drawing as it had in the source.  If you Break a piece out of something, part of what remains keeps the original entity name, and the other part gets a new one.  Etc.

Kent Cooper, AIA
0 Likes
Message 7 of 9

john.kaulB9QW2
Advocate
Advocate

So, let me get this straight: you want an UID for a polyline but if it gets busted up into lines, you want each of those lines to have the same UNIQUE id number? ...UNIQUE?

another swamper
0 Likes
Message 8 of 9

komondormrex
Mentor
Mentor

Extended data works well for some things (but not making entities into regions),

why is that? extended data in your case will help you to collect entities to selection set or array or other set to make a region/s from it. fairly simple.

0 Likes
Message 9 of 9

Jonathan_Bell82GXG
Enthusiast
Enthusiast

I appreciate all the responses, I'm just exploring the options. For the purposes of updating selection sets as changes get made to the entities in the set, using a repeat loop and ssadd/ssdel/entlast with another selection set is probably best

0 Likes