TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: vnanhvu on August 05, 2011, 05:17:53 AM

Title: HELP ME WITH LAYOUT
Post 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.
Title: Re: HELP ME WITH LAYOUT
Post by: ribarm on August 05, 2011, 05:46:16 AM
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 :
Code: [Select]
(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)
)
Title: Re: HELP ME WITH LAYOUT
Post by: vnanhvu on August 05, 2011, 08:23:39 AM
   Thank you very much :lmao:
Title: Re: HELP ME WITH LAYOUT
Post by: Tharwat on August 05, 2011, 05:28:55 PM
Code: [Select]
(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
Title: Re: HELP ME WITH LAYOUT
Post by: ronjonp on August 05, 2011, 05:49:46 PM
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)
)
Title: Re: HELP ME WITH LAYOUT
Post by: Lee Mac on August 05, 2011, 08:20:21 PM
Or perhaps just:

Code: [Select]
(vlax-put <object> <property> (~ (vlax-get <object> <property>)))
 :-)
Title: Re: HELP ME WITH LAYOUT
Post by: Tharwat on August 06, 2011, 01:40:25 AM
Thanks ron and Lee .

Very nice alternative codes .

I feel hard to get the boole and bitwise very well  .

Regards.

Title: Re: HELP ME WITH LAYOUT
Post by: alanjt on August 06, 2011, 01:51:53 AM
I feel hard
:-D
Title: Re: HELP ME WITH LAYOUT
Post by: Tharwat on August 06, 2011, 01:58:16 AM
I feel hard
:-D

Two feels for almost two days now .  :lmao:
Title: Re: HELP ME WITH LAYOUT
Post by: Jeff H on August 06, 2011, 01:59:08 AM
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
Title: Re: HELP ME WITH LAYOUT
Post by: ronjonp on August 06, 2011, 09:26:39 AM
Or perhaps just:

Code: [Select]
(vlax-put <object> <property> (~ (vlax-get <object> <property>)))
 :-)

Cool  :-)