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: 

LISP to extract cogo point description and elevation to fill out block attribute

1 REPLY 1
Reply
Message 1 of 2
phil_planright
578 Views, 1 Reply

LISP to extract cogo point description and elevation to fill out block attribute

Has anyone got a lisp that enables you to select cogo points and then based on their descriptions fill out attributes in a block.

ie.

cogo point 1 (description="aaa 123" elevation="100.25")

cogo point 2 (description="bbb 123" elevation="300.50")

 

I the need this to fill out a block where the attribute "aaa" is filled out as "100.25" and "bbb" is filled out as "300.50". I would also like if possible to extract the second part of the description ("123") to fill out another attribute in the block.

 

I have a lisp that can extract parts of the cogo point to text, but that is as far as i have gotten with it.

 

At the moment we are manually filling out the blocks, but this becomes quite tedious when there are up to 50+ blocks to fill out.

 

Hopefully someone can help. Thanks.

1 REPLY 1
Message 2 of 2
hippe013
in reply to: phil_planright

Are you just looking into setting the blocks attributes?

 

(defun testSetAtt (block aaaTagString aaaValue bbbTagString bbbValue)
  (setq atts (vlax-safearray->list (vlax-variant-value (vlax-invoke-method blk 'GetAttributes))))
  (foreach att atts
    (cond
      ((= (vlax-get-property att 'TagString) aaaTagString)(vlax-put-property att 'TextString (vl-princ-to-string aaaValue)))
      ((= (vlax-get-property att 'TagString) bbbTagString)(vlax-put-property att 'TextString (vl-princ-to-string bbbValue)))
      )
    )
  )

you  

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report