TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on April 04, 2006, 03:45:22 PM
-
Hi all..
Im trying to make a routine to get the Handle name of current Viewport..
but How can i do that ?
VIEWPORT Layer: "0"
Space: Paper space
Layout: Layout1
Handle = f8
Status: On and Active
Scale relative to Paper space: 0.4855xp
center point, X= 128.5000 Y= 97.5000 Z= 0.0000
width 205.6000
height 156.0000
-
ok..i got it...
thanks anyway..
(setq ent (cdr (assoc 5 (entget (acet-currentviewport-ename)))))
-
Whada bout....
(vla-get-Handle (vlax-ename->vla-object (car (entsel "\n Select Viewport..."))))
-
Whada bout....
(vla-get-Handle (vlax-ename->vla-object (car (entsel "\n Select Viewport..."))))
thanks ronjonp..
but with your routine..
I need to select the viewport....
is not what i need...
but i'll take it in my library... :roll:
-
Andrea,
If you would like your own routine so as to not rely on ExpressTools being installed.....(defun getActVP ()
(if (= (getvar "TILEMODE") 1)
(vla-get-activeviewport
(vla-get-activedocument
(vlax-get-acad-object)))
(vla-get-activepviewport
(vla-get-activedocument
(vlax-get-acad-object)))
)
)
(defun vpHand ()
(vla-get-handle (getActVP))
)
-
thanks Jeff..
I'll take it..
but modified...
(defun getActVP ()
(if (and (> (getvar "CVPORT") 1)
(eq (getvar "TILEMODE") 0)
)
(vla-get-handle (vla-get-activepviewport
(vla-get-activedocument
(vlax-get-acad-object)))
)
))
-
Andrea, choose to ignore this if you like ..
but shouldn't that revised function be named :-
(defun getActiveVPHandle () .....
'cause it's not actually returning the VP object ....
-
your right Kerry...
thanks.