devitg Posted July 15, 2023 Posted July 15, 2023 Hi all. Given this points as variants (IF (= 70-DXF-DATA 37) ;ang 3 pt (PROGN (SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ)) (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ)) (SETQ ANGLEVERTEX (VLA-GET-ANGLEVERTEX DIM-OBJ)) ) ;end PROGN );end if Is there a similar vl function to get distances between each variant points pair, like the lisp function DISTANCE pt1 pt2 , given pt's as (setq pt1 (list x1 y1 z1)) ;and (setq pt2 (list x2 y2 z2)) (setq pt1-pt2-dist (distance pt1 pt2)) Quote
mhupp Posted July 15, 2023 Posted July 15, 2023 Maybe (setq dist (distance (vlax-3D-point pt1) (vlax-3D-point pt2)) Quote
devitg Posted July 15, 2023 Author Posted July 15, 2023 19 minutes ago, mhupp said: Maybe (setq dist (distance (vlax-3D-point pt1) (vlax-3D-point pt2)) @mhupp Point results from (PROGN (SETQ EXT-LIN1-PT (VLA-GET-EXTLINE1ENDPOINT DIM-OBJ)) (SETQ EXT-LIN2-PT (VLA-GET-EXTLINE2ENDPOINT DIM-OBJ)) (SETQ ANGLEVERTEX (VLA-GET-ANGLEVERTEX DIM-OBJ)) ) So it are variant's So I could get the x y z from (setq xyz-pt (VLAX-SAFEARRAY->LIST (VLAX-VARIANT-VALUE EXT-LIN1-PT))) Then use distance What I ask is to get the distance direct from the VARIANTS Quote
BIGAL Posted July 16, 2023 Posted July 16, 2023 Instead of VLA use Vlax maybe (SETQ EXT-LIN2-PT (VLAx-GET DIM-OBJ 'EXTLINE2ENDPOINT )) It may be my Bricscad I get a error usng above should it be (vlax-get dim-obj 'ExtLine1Point) (-15.1 -9.8 0.0) Then get distance between points. 2 Quote
Tharwat Posted July 16, 2023 Posted July 16, 2023 Already answered here : https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-distance-between-2-points-as-variants/m-p/12104642/highlight/true#M451595 Quote
devitg Posted July 16, 2023 Author Posted July 16, 2023 13 hours ago, BIGAL said: Instead of VLA use Vlax maybe (SETQ EXT-LIN2-PT (VLAx-GET DIM-OBJ 'EXTLINE2ENDPOINT )) It may be my Bricscad I get a error usng above should it be (vlax-get dim-obj 'ExtLine1Point) (-15.1 -9.8 0.0) Then get distance between points. @BIGAL I need learn to handle the VLAX obj property and VLAX obj methods Quote
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.