Jump to content

Recommended Posts

Posted

I'm trying to lock all viewports. However, my macro don't work.

 

Can someone help me?

 

(DEFUN C:LV () (COMMAND "MV" "" "L" "" "ALL" "")(princ))

Posted

try this, not my creation:

;;;CADALYST 07/06  Tip2129: LV.lsp  Viewport Lock and Unlock    (c) Theodorus Winata  

;;; Function: Lock/Unlock Viewports 
;;; Command Line: LV 
;;; Description: By locking the Display you ensure your 
;;;              model view will not accidentally shift 
;;;              if you activate the viewport 
;;; 
;;; Developed by Theodorus Winata 
;;; April 2006 
;;; 

(defun get-objects () 
 (setq DPL (vlax-ename->vla-object (ssname SSG CNT)) 
   CNT (1+ CNT) 
 );;setq 
);;get-objects 

;;;********** Error Handler ********** 
(defun ERR (msg) 
 (princ) 
);;ERR 

;;;********** Main Program ********** 
(defun C:LV (/ CME CNT DPL *ERROR* OP SSG) 
 (vl-load-com) 
 (setq *ERROR* ERR 
       CME (getvar "CMDECHO") 
 );;setq 
 (setvar "CMDECHO" 0) 
 (if (= (getvar "TILEMODE") 1) (setvar "TILEMODE" 0)) 
 (command "pspace") 
 (setq SSG (ssget "X" (list (cons 0 "VIEWPORT"))) 
   CNT 0 
 );;setq 
 (initget "Yes No") 
 (setq OP (getkword "Display locked [Yes/No] <Y>: ")) 
 (cond 
   ((or (= OP nil) (= OP "Yes")) 
     (repeat (sslength SSG) 
       (get-objects)     
   (vla-put-DisplayLocked DPL :vlax-true) 
     );;repeat 
     (prompt "\n\tAll Viewports Locked...!") 
   );;"Yes" 
   ((= OP "No") 
     (repeat (sslength SSG) 
   (get-objects) 
   (vla-put-DisplayLocked DPL :vlax-false) 
     );;repeat 
     (prompt "\n\tAll Viewports Unlocked...!") 
   );;"No" 
 );;cond 
 (setvar "CMDECHO" CME) 
 (princ) 
);;C:LV 
(princ 
;  (strcat 
;    "  LV.LSP v1.0 (Copyright 2006 by " 
;    "\"Theo Winata and You\") loaded...!" 
;  ) 
) 
(princ) 
 

Posted

Thank you

 

However, because I put at my lisp programs into one, I try to conserve memory as it takes so long to load

 

Can anyone help me with the following?

 

(DEFUN C:LV () (COMMAND "MV" "" "L" "" "ALL" "")(princ))

Posted

Try this:

 

(DEFUN C:LV () (COMMAND "_.VPORTS" "L" "ON" "ALL" "")(princ)) 

Posted

is this macro for could be used for a new button?

if not how can create a macro for a button doing that function?

(display look on and off)

Posted

Can anyone help me with the following?

 

(DEFUN C:LV () (COMMAND "MV" "" "L" "" "ALL" "")(princ))

(DEFUN C:LV () (COMMAND "MView" "L" "ON" "ALL" "")(princ))

 

Footpeg

Posted
However, because I put at my lisp programs into one, I try to conserve memory as it takes so long to load

 

i'm sure, just as i did, that you will realize that combining them is not the best policy. i thought it was, now i have 1 startup lsp routine that either autoloads or loads all my lsps. the startup also has all of my setvars and any other customization settings i want. that way, when i sit down at a new version of autocad. i add my lsp folder to the support paths, add my one startup lsp file to the startup in appload and i'm good to go. when i restart cad, all my autocad settings are in place.

 

the biggest reason i went this route was it was just easier to make updates to my routines.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...