Jump to content

Pipe Startpoint and Endpoint


JSYoung81

Recommended Posts

In need of some help. I am trying to get the start/end point of a pipe, I can get the vla-object info, what I cannot do, in pull out the NEZ from that.

 

(setq endpoint  (vlax-get-property item 'EndPoint))

 

Any and all help would be great!

Link to comment
Share on other sites

Convert vl pt to normal pt

 

(setq pointl (vlax-safearray->list (vlax-variant-value endpoint)) )
(setq x (car point1))
(setq y (cadr point1))
(setq z (caddr point1))

Link to comment
Share on other sites

My offer .

 

(mapcar 'set '(x y z) (vlax-get item 'endpoint))

interesting vlax-get , but why not in dev documentation 2007?

 

so, i tried recursive & it worked :)

(vlax-put item 'endpoint (list x y x))

It's simpler than (vla-put-endpoint item (vlax-3d-point (list x y x)))

 

thank you :)

Link to comment
Share on other sites

interesting vlax-get , but why not in dev documentation 2007?

 

It is not even in any of the latest versions though .

 

so, i tried recursive & it worked :)

(vlax-put item 'endpoint (list x y x))

It's simpler than (vla-put-endpoint item (vlax-3d-point (list x y x)))

 

thank you :)

 

You're welcome . :)

Link to comment
Share on other sites

I believe that the OP is trying to work with the AeccPipe object. The above methods work great with lines, arcs and the like. Though they unfortunately do not work on the AeccPipe object.

 

The line start and end point is # which works with vlax-get and vlax-put.

 

On the other hand the start and end points of an AeccPipe is #.

 

The only way that I have been able to retrieve the start and end points of the AeccPipe is with the following code:

 

(setq p0 (vlax-safearray->list (vlax-variant-value (vlax-get-property pipe 'PointAtParam 0)))) ;For the startpoint
(setq p1 (vlax-safearray->list (vlax-variant-value (vlax-get-property pipe 'PointAtParam 1)))) ;For the endpoint

 

To set the values of the start and end points use:

 

(vlax-invoke-method pipe 'SetStartAndEndPoints (vlax-3d-point p0)(vlax-3d-point p1))

 

(with the values of p0 and p1 being a list of XYZ of course.)

 

Note that the start and end points are the center of the pipe. To get to the invert elevation of the pipe you need to retrieve the InnerDiameterOrWidth property and do a little math.

 

regards,

 

hippe013

Link to comment
Share on other sites

The only way that I have been able to retrieve the start and end points of the AeccPipe is with the following code:

 

(setq p0 (vlax-safearray->list (vlax-variant-value (vlax-get-property pipe 'PointAtParam 0)))) ;For the startpoint
(setq p1 (vlax-safearray->list (vlax-variant-value (vlax-get-property pipe 'PointAtParam 1)))) ;For the endpoint

 

Hi ,

 

Won't this be used at all and simpler than that ?

 

(vlax-curve-getpointatparam pipe 0)
(vlax-curve-getpointatparam pipe 1)

 

Or with this as a list of start and end points .

 

(mapcar '(lambda (i) (vlax-curve-getpointatparam pipe i)) '(0 1))

Link to comment
Share on other sites

vlax-curve-getPointAtParam, when used on the AeccPipe object, returns the point (0 0 0) when zero is given as the argument and the point (0 0 1) when one is given as the argument.

Link to comment
Share on other sites

I have not used MEP cad or other cad versions than Architectural Autocad so I am just trying to give a simpler codes than the safearrays and variants' codes .

 

Thanks for the info Hippe

Link to comment
Share on other sites

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...