Renaming Civil 3D Structures With AutoLisp. Risk?

Renaming Civil 3D Structures With AutoLisp. Risk?

Anonymous
Not applicable
834 Views
0 Replies
Message 1 of 1

Renaming Civil 3D Structures With AutoLisp. Risk?

Anonymous
Not applicable

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)
)
0 Likes
835 Views
0 Replies
Replies (0)