JSYoung81 Posted August 8, 2014 Share Posted August 8, 2014 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! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 8, 2014 Share Posted August 8, 2014 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)) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 9, 2014 Share Posted August 9, 2014 My offer . (mapcar 'set '(x y z) (vlax-get item 'endpoint)) Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted August 9, 2014 Share Posted August 9, 2014 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 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 9, 2014 Share Posted August 9, 2014 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 . Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 9, 2014 Share Posted August 9, 2014 Watch the X Y Z Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted August 10, 2014 Share Posted August 10, 2014 Watch the X Y Z oops.. typo (list x y x) --> (list x y z) thank you BIGAL have a nice day^^ Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted August 11, 2014 Share Posted August 11, 2014 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 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 11, 2014 Share Posted August 11, 2014 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)) Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted August 11, 2014 Share Posted August 11, 2014 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 11, 2014 Share Posted August 11, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.