Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Extraxt values X Y Z from vlax-3D-point

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
984 Views, 4 Replies

Extraxt values X Y Z from vlax-3D-point

I am beginner , how to extract value X Y Z of point p3 p4

 

(defun c:test ()
  (vl-load-com)
  (setq actdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
  (setq objm (vla-get-ModelSpace actdoc))
  (setq obju (vla-get-Utility actdoc))
(setq oldhigh (getvar "Highlight") oldsnap (getvar "Osmode") oldblip (getvar "BlipMode") oldecho (getvar "Cmdecho") );setq
(setvar "Highlight" 0) (setvar "Osmode" 517) (setvar "Cmdecho" 0)  (setvar "Blipmode" 0)

  (setq p3 (vlax-3D-point '(0 0 0)))
  (setq p4 (vlax-3D-point '(5000 2000 0)))
  (setq dat (vlax-variant-value p4) )  - it doesn't work

 
  (setq p1 '(0 0 0))
  (setq p2 '(5000 2000 0))
  (setq odD (- (nth 0 p2) (nth 0 p1)))
  (setq odT (- (nth 1 p2) (nth 1 p1)))

)

4 REPLIES 4
Message 2 of 5
pbejse
in reply to: Anonymous

(vlax-safearray->list (vlax-variant-value p4) )

 

Dont undertand what you're trying to do though

 

Why create p4 from a point list to safearray the convert it back?

 

Message 3 of 5
Anonymous
in reply to: pbejse

All right   I will try to explain

Please help me how to find out, what function use: I would like to know the X Y Z of points: p3 and p4 

 

(defun c:test ()
  (vl-load-com)
  (setq actdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
  (setq objm (vla-get-ModelSpace actdoc))
  (setq obju (vla-get-Utility actdoc))
(setq oldhigh (getvar "Highlight") oldsnap (getvar "Osmode") oldblip (getvar "BlipMode") oldecho (getvar "Cmdecho") );setq
(setvar "Highlight" 0) (setvar "Osmode" 517) (setvar "Cmdecho" 0)  (setvar "Blipmode" 0)

  (setq p3 (vlax-3D-point (getpoint)) )
  (setq p4 (vlax-3D-point (getpoint)) )
  
  (setq p1 '(0 0 0))
  (setq p2 '(5000 2000 0))
  (setq odD (- (nth 0 p2) (nth 0 p1)))
  (setq odT (- (nth 1 p2) (nth 1 p1)))

)

Message 4 of 5
Anonymous
in reply to: Anonymous

Your solution works

Thank You for help

Message 5 of 5
pbejse
in reply to: Anonymous


@Anonymous wrote:

Your solution works

Thank You for help



Good for you.. Glad i could help.

 

Cheers

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost