Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set user defined property on COGO point with AutoLisp

3 REPLIES 3
Reply
Message 1 of 4
smiths5JLA6
279 Views, 3 Replies

Set user defined property on COGO point with AutoLisp

I have a user defined property called "TREE SIZES" on my cogo points I am writing a script that will parse the description and fill this in. My only problem is that I can't figure out how to access and set this TREE SIZES property on my cogo point. Any help?

3 REPLIES 3
Message 2 of 4
Jeff_M
in reply to: smiths5JLA6

This short example utilizes my (get_aeccapp) lisp that I've posted many times. To set the UDP value to a cogopoint, it must belong to a pointgroup which has the UDPClassification assigned that the UDP's belong to.

(setq civdoc (vlax-get (getaeccapp "Land") 'activedocument))
(setq ptgroup (vlax-invoke (vlax-get civdoc 'pointgroups) 'item "Storm Manholes"))
(setq udpclass (vlax-invoke ptgroup 'getuserdefinedpropertyclassification'way))
(setq udps (vlax-get udpclass 'userdefinedproperties))
(setq staUDP (vlax-invoke udps 'item "Station")
      offUDP (vlax-invoke udps 'item "Offset")
      )
(setq pt (vlax-ename->vla-object (car (entsel "/nSelect point"))))
(vlax-invoke pt 'setuserdefinedpropertyvalue staUDP "2+50.23")
(vlax-invoke pt 'setuserdefinedpropertyvalue offUDP "15.23'")
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 4
smiths5JLA6
in reply to: smiths5JLA6

Thanks for the help Jeff.

I found your (get_aeccap) function, but when I get to the line: 

(setq udps (vlax-get udpclass 'userdefinedproperties))

I get and error saying:

 bad argument type: VLA-OBJECT nil

 

Thanks!

Message 4 of 4
Jeff_M
in reply to: smiths5JLA6

How is the UDPClassification assigned to the PointGroup? If it is None or All then you will run into this error.

Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report