Author Topic: Point Name - delete?  (Read 3625 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Point Name - delete?
« on: April 24, 2009, 02:29:38 PM »
Is it possible to remove a point name once one is given? If I assign a point name to a given point and then go back to erase the name I recieve Error: string contents for attribute 'Name' contain invalid characters. I figure I can assign some placeholder but would rather have it blank if possible. Would hate to have to recreate the point(s) or some other AutoCAD work around.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Point Name - delete?
« Reply #1 on: April 24, 2009, 04:31:35 PM »
Hi Dan. Evidently they thought we'd never need to do that! Using the stock tools, it does not appear we can remove a name from a point. However, if you don't mind throwing a little bit of lisp at it, it can be done without deleting the point(s).
Code: [Select]
(defun c:jmm_resetpointnames (/ ss idx obj)
  (vl-load-com)
  (if (setq ss (ssget '((0 . "AECC_COGO_POINT"))))
    (progn
      (setq idx -1)
      (while (setq ent (ssname ss (setq idx (1+ idx))))
(setq obj (vlax-ename->vla-object ent))
(vlax-put-property obj 'name "")
)
      )
    )
  (princ)
  )

DanB

  • Bull Frog
  • Posts: 367
Re: Point Name - delete?
« Reply #2 on: April 29, 2009, 10:19:32 AM »
Thanks Jeff (Got side-tracked the other day and forgot to check back in here).