TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: vnanhvu on August 05, 2011, 05:17:53 AM
-
I cant display frame viewport layout with this drawing. Can you help me? Thanks for all.
-
Here it is... I turned on from layer drop down menu "freeze or thaw in current viewport" Layer "A-_ANOTVPRT_P-" and viewports reappeared... You may also consider that that layer is not plottable - use command "layer" and you'll see that that option is marked red - unplottable...
M.R.
Hope this helps...
Firstly I thought this was the problem, but I was wrong... Anyway, someone could do this so consider it also :
(defun c:vpsvisibility ( / adoc pspcoll psplst ch)
(vl-load-com)
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(setq pspcoll (vla-get-paperspace adoc))
(vlax-for ent pspcoll
(setq psplst (cons (vl-catch-all-apply 'vla-get-objectname (list ent)) psplst))
)
(setq psplst (reverse psplst))
(princ psplst)
(prompt "\nPress ENTER to continue")
(textscr)
(command pause)
(initget 1 "Yes No")
(setq ch (getkword "\nDo you want to turn on/off visibility <Yes/No> : "))
(vlax-for ent pspcoll
(if (= ch "Yes")
(vla-put-visible ent :vlax-true)
(vla-put-visible ent :vlax-false)
)
)
(princ)
)
-
Thank you very much :lmao:
-
(defun c:VP-on-off (/ ss sset v)
;; == Tharwat 06. 08. 2011 == ;;
(vl-load-com)
(if (eq (vla-get-activespace
(vla-get-activedocument (vlax-get-acad-object))
)
0
)
(progn
(setq
ss (ssget "_x"
(list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab)))
)
)
(while
(setq sset (ssname ss 0))
(cond
((eq (vla-get-visible (setq v (vlax-ename->vla-object sset)))
:vlax-false
)
(vla-put-visible v :vlax-true)
)
((eq (vla-get-visible (setq v (vlax-ename->vla-object sset)))
:vlax-true
)
(vla-put-visible v :vlax-false)
)
)
(ssdel sset ss)
)
)
(print "\n ** Command not allowed in Model Space ** ")
)
(princ)
)
Tharwat
-
FWIW ... here's a cool little trick for a toggle:
(defun c:vp-on-off (/ o ss sset v)
;; == Tharwat 06. 08. 2011 == ;;
(vl-load-com)
(if (zerop (vla-get-activespace (vla-get-activedocument (vlax-get-acad-object))) 0)
(progn (setq ss (ssget "_x" (list '(0 . "VIEWPORT") (cons 410 (getvar 'ctab)))))
(while (setq sset (ssname ss 0))
(setq o (vlax-ename->vla-object sset))
(vlax-put o 'visible (boole 8 0 (vlax-get o)))
(ssdel sset ss)
)
)
(print "\n ** Command not allowed in Model Space ** ")
)
(princ)
)
-
Or perhaps just:
(vlax-put <object> <property> (~ (vlax-get <object> <property>)))
:-)
-
Thanks ron and Lee .
Very nice alternative codes .
I feel hard to get the boole and bitwise very well .
Regards.
-
I feel hard
:-D
-
I feel hard
:-D
Two feels for almost two days now . :lmao:
-
I feel hard to get the boole and bitwise very well
Had the same problem I would get all exicted about using booles and bitwise's in programming
but just take a deep breath and relax that might help or imagine your grandma naked
-
Or perhaps just:
(vlax-put <object> <property> (~ (vlax-get <object> <property>)))
:-)
Cool :-)