Jump to content

How to get distance between 2 points as variants


devitg

Recommended Posts

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

 

Link to comment
Share on other sites

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 

 

 

 

 

Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

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  

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