Author Topic: Are entity names permanent ?  (Read 2084 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 495
Are entity names permanent ?
« on: April 09, 2014, 06:35:41 AM »
Are entity names given by (car (entsel)) or  (ssname ss (setq n (1- n))) permanent in a drawing ?

By permanent I mean that the entity names are same for a particular entity (line / polyline / circle / ellipse etc)  even if we open a drawing after few days in a different computer ?

If not, then what else is permanent for an entity ?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Are entity names permanent ?
« Reply #1 on: April 09, 2014, 06:40:23 AM »


RTFM
http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-9CB07C25-4439-445D-B1B3-92174C53C571
Quote
Entity names assigned to objects in a drawing are only in effect during the current editing session. The next time you open the drawing, AutoCAD assigns new entity names to the objects. You can use an object's handle to refer to it from one editing session to another.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Are entity names permanent ?
« Reply #2 on: April 09, 2014, 06:45:09 AM »
RTFM
:lmao: Damn! I was expecting a "standard" No! answer ... but this takes the cake!

Hint to the OP: Look for something regarding Handles.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: Are entity names permanent ?
« Reply #3 on: April 09, 2014, 07:04:02 AM »


RTFM
http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-9CB07C25-4439-445D-B1B3-92174C53C571
Quote
Entity names assigned to objects in a drawing are only in effect during the current editing session. The next time you open the drawing, AutoCAD assigns new entity names to the objects. You can use an object's handle to refer to it from one editing session to another.

RTFM = Read The F&^%#$% Memo ?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Are entity names permanent ?
« Reply #4 on: April 09, 2014, 07:05:51 AM »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Are entity names permanent ?
« Reply #5 on: April 09, 2014, 07:14:05 AM »
lol, kid gloves and sledge hammers, we haz variety folks
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

mailmaverick

  • Bull Frog
  • Posts: 495
Re: Are entity names permanent ?
« Reply #6 on: April 09, 2014, 08:26:13 AM »
So it means  (cdr (assoc 5 (entget ent)))) for every entity is permanent throughout the lifespan of the entity ?



Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Are entity names permanent ?
« Reply #7 on: April 09, 2014, 08:28:50 AM »
No. Read the Help quote I posted.

Yes, If the ent in manually selected in the session.
« Last Edit: April 09, 2014, 08:38:52 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

mailmaverick

  • Bull Frog
  • Posts: 495
Re: Are entity names permanent ?
« Reply #8 on: April 09, 2014, 08:38:43 AM »
Dear Kerry,

(cdr (assoc 5 (entget ent)))) returns the handle for the entity. See following link :-

http://www.autodesk.com/techpubs/autocad/acadr14/dxf/common_group_codes_for_graphical_objects_al_u05_c.htm

It is mentioned that Group Code 5 returns the entity handle.

As per the Help quote provided by you :-
Entity names assigned to objects in a drawing are only in effect during the current editing session. The next time you open the drawing, AutoCAD assigns new entity names to the objects. You can use an object's handle to refer to it from one editing session to another.


It means that handles are permanent. Then, why (cdr (assoc 5 (entget ent)))) will not be permanent ?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Are entity names permanent ?
« Reply #9 on: April 09, 2014, 08:58:03 AM »

If you want to convert a handle to entityName look at handent (AutoLISP)

http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-AF6DD533-1A24-4687-96EB-F03F26050C07

This is one way to obtain and re-use the data
Code - Auto/Visual Lisp: [Select]
  1.  
  2. (setq ent (car ( entsel)))                           ; <Entity name: 7ffffb05b60>
  3. (setq handleString (cdr (assoc 5 (entget ent))))     ; "3D6"
  4.  
  5.  
  6. ;; --> Save the handleString
  7.  
  8. ;; --> restore the handleString
  9.  
  10. (setq ent (handent handleString))                    ; <Entity name: 7ffffb05b60>
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

mailmaverick

  • Bull Frog
  • Posts: 495
Re: Are entity names permanent ?
« Reply #10 on: April 09, 2014, 09:05:15 AM »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Are entity names permanent ?
« Reply #11 on: April 09, 2014, 09:09:03 AM »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.