Message 1 of 1
Renaming Civil 3D Structures With AutoLisp. Risk?

Not applicable
09-14-2018
06:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have hundreds of Civil 3D structures that I would like to rename. By 'dumping' the AECC_STRUCTURE object I can see the 'DisplayName' property, which is read only, and the 'Name' property.
I have no issues writing to, and updating, the name property. Everything thing seems to work but I'm a bit paranoid that it was too easy and am concerned about dealing serious damage to our Pipe Networks.
Does anyone have insight into this process or a way to verify that I won't do any damage?
Here's the framework:
; Rename structures based on description (vl-load-com) (defun NDS_renameStrcs ( / ) (setq mlist (ssget "X" '((0 . "AECC_STRUCTURE")))) (setq i 0) (repeat (sslength mlist) (setq STRC (vlax-ename->vla-object (ssname mlist i))) (setq strIn (vlax-get-property STRC 'Name)) (if (= (vlax-get-property STRC 'Description) "[CODE]") ; Do Work (progn ;[CODE] ) ) (setq i (+ i 1)) ) (princ) )