Jump to content

Get some Civil3D pipe and structues info with lisp


Recommended Posts

Posted

Hello all,

 

I would like to get a summary of some info of Civil3D pipes and structures.

I made this very basic routine:

 

(defun c:foo ( / )
(setq sel (entsel))
(setq ent (car sel))
(setq obj (vlax-ename->vla-object ent))
(princ "\n")
(princ (setq startstructure (vlax-get obj 'StartStructure)))
(princ "\n")
(princ (setq endstructure (vlax-get obj 'EndStructure)))
(princ "\n")
(princ (setq description (vlax-get obj 'Description)))
(princ "\n")
(princ (setq startpoint (vlax-get obj 'StartPoint)))
(princ "\n")
(princ (setq endpoint (vlax-get obj 'EndPoint)))
(princ)
)

 

Wich returns me

#<VLA-OBJECT IAeccStructure 000001c1c7817880>
#<VLA-OBJECT IAeccStructure 000001c1c7814880>
300 mm Ongewapende Betonnen Buis
#<VLA-OBJECT 000001c1e4080e90>
#<VLA-OBJECT 000001c1e4080c80>

 

Why do i get the VLA-OBJECT info, and not the real content of the property.

I also tried the vla-get-property, but that returns the same value...

Posted

The startstructure variable is a VLA-OBJECT itself, so you have to get the properties of this object in order to use them.

Type (vlax-dump-object startstructure T) and study the output. The property you are looking for must be somewhere there.

Posted

Please bear in mind that when attempting to get the start and end points of a Civil 3D pipe you can NOT use (vlax-get-property obj 'StartPoint) or (vlax-get-property obj 'EndPoint).

 

These return point values of (0 0 0) and (0 0 1) respectively.

 

You will have to use (vlax-get-property obj 'PointAtParam 0) and (vlax-get-property obj 'PointAtParam 1) to obtain point values that actually mean something.

 

regards,

 

Hippe013

Posted

Thanks for the replies, i got it working. @Stefan, you where right, i was thinking completely wrong. :-)

@Hippe, thanks for the tip. Very usefull! :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...