I'm developing a lisp program that works with a 3D piping design, and i need to dimension an isometric view. It's supposed that with the system variable dimassoc = 2 the dimensions take the real value from model space, but only works with orthogonal views...
The question is... is there a lisp function that retrieves the world coordinates of an object in model space being in paper space?
(i tried with (trans [point] 3 2) but it doesn't works whit the world coordinates and i can't relate with it)
thanks
Cristian Leon
Chile
;;; Draws a line in paperspace between two points picked in modelspace.
;;; No error checking included.
;;; Assumes that you will already be "in" a pviewport.
;;; For demonstration purposes only.
(defun c:test (/ doc p1 p2 ht)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object))
p1 (getpoint "\nPick a point. ")
p2 (getpoint "\nPick another point. ")
p1 (trans p1 1 2) ;From model UCS to pviewport DCS
p2 (trans p2 1 2) ;From model UCS to pviewport DCS
;; Correct z-value for pviewport target height
ht (vlax-get (vla-get-ActivePViewport doc) 'Target)
ht (list 0 0 (last ht))
p1 (mapcar '+ p1 ht)
p2 (mapcar '+ p2 ht)
p1 (trans p1 2 3) ;From pviewport DCS to paper DCS
p2 (trans p2 2 3) ;From pviewport DCS to paper DCS
)
(vla-put-MSpace doc :vlax-False)
(setq ;; Correct z-value for paper target height
ht (vlax-get (vla-get-ActivePViewport doc) 'Target)
ht (list 0 0 (last ht))
p1 (mapcar '+ p1 ht)
p2 (mapcar '+ p2 ht)
p1 (trans p1 2 1) ;From paper DCS to paper UCS
p2 (trans p2 2 1) ;From paper DCS to paper UCS
)
(command "line" p1 p2 "")
)
"Cristian Leon" <nos...@address.withheld> wrote in message
news:1933703.109897371...@jiveforum2.autodesk.com...
It wasn't what exactly i need, but was very useful, i could make some changes that helps me.
One thing... i didn't understood what means the second part of the program:
(setq ;; Correct z-value for paper target height
ht (vlax-get (vla-get-ActivePViewport doc) 'Target)
ht (list 0 0 (last ht))
p1 (mapcar '+ p1 ht)
p2 (mapcar '+ p2 ht)
p1 (trans p1 2 1) ;From paper DCS to paper UCS
p2 (trans p2 2 1) ;From paper DCS to paper UCS
)
because i probe your program without this part and i get the same result...
Thanks a lot
Cristian Leon
Chile
> (setq p1 (trans p1 2 1) ;From paper DCS to paper UCS
> p2 (trans p2 2 1) ;From paper DCS to paper UCS
> )
This part allows for a non-world paper space ucs. In other words, if
(really big if I think) your paper space ucs is non-world, then this will
allow it to still return the correct point.
If your viewports target z value value equals zero and the paper space ucs
equals wcs, then none of the second portion has any effect. I put it in to
try to allow for any possibility. I am glad it was helpful.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO
"Cristian Leon" <nos...@address.withheld> wrote in message
news:21976387.109908834...@jiveforum2.autodesk.com...