How to get distance between 2 points as variants

devitg
Advisor

How to get distance between 2 points as variants

devitg
Advisor
Advisor

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

 

0 Likes
Reply
Accepted solutions (3)
382 Views
4 Replies
Replies (4)

paullimapa
Mentor
Mentor
Accepted solution
0 Likes

komondormrex
Advisor
Advisor
Accepted solution

hi,

get coordinates as lists

(IF (= 70-DXF-DATA 37) ;ang 3 pt
     (SETQ EXT-LIN1-PT (VLAX-GET DIM-OBJ 'EXTLINE1ENDPOINT)
           EXT-LIN2-PT (VLAX-GET DIM-OBJ 'EXTLINE2ENDPOINT)
           ANGLEVERTEX (VLA-GET-ANGLEVERTEX DIM-OBJ)
       	   distance ext_pt1_pt2 (distance EXT-LIN1-PT EXT-LIN1-PT)
     ) ;end SETQ
)

 

0 Likes

devitg
Advisor
Advisor

@komondormrex   @paullimapa .  so there is no  a Distance function to be used to variants.

I will try both samples you give me. 

Thanks

 

0 Likes

komondormrex
Advisor
Advisor
Accepted solution

so there is no  a Distance function to be used to variants.

as a variant  is a special data type that can contain any kind of data except fixed-length string data and user-defined types, there cannot be such function as distance for two variants, may they even be points.

0 Likes