anishtain4 Posted June 6, 2012 Posted June 6, 2012 I have a variable say named pnt, but it can be either a 2d, 3d list or a visual lisp variant object, the question is how do you recognize this? and when you did how do you get distance of two point objects? I mean what is the (distance) function to use with (vlax-3d-point)? Quote
pBe Posted June 6, 2012 Posted June 6, 2012 (cond ((eq (type pnt) 'Variant)(princ "\nVariant:")) ((listp pnt)(princ "\nPoint List"))) its either you convert the vairant value to point list (vlax-safearray->list (variant-value pnt)) or convert the point list to variant (vlax-3d-point pnt) Quote
Tharwat Posted June 6, 2012 Posted June 6, 2012 I have a variable say named pnt, but it can be either a 2d, 3d list or a visual lisp variant object, the question is how do you recognize this? (setq p '(0. 0.)) (if (eq (type p) 'LIST) (princ (length p))) and when you did how do you get distance of two point objects? I mean what is the (distance) function to use with (vlax-3d-point)? (setq p1 (vlax-3d-point '(0. 0. 0.)) p2 (vlax-3d-point '(5. 0. 0.)) ) (setq dist (distance (vlax-safearray->list (vlax-variant-value p1)) (vlax-safearray->list (vlax-variant-value p2)) ) ) 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.