Grigs Posted December 9, 2010 Posted December 9, 2010 I was wondering if someone might be able to help me. What I'm looking for is a routine that will let you pick a paperspace viewport, popup a dialog box that has the different scale choices, then change that viewport to the scale chosen. I have a lisp/dcl that already does this for text size/dimscale. I was wondering if someone could help me adapt it for changing viewport scales? dsl.dcl dsl.lsp Quote
BIGAL Posted December 10, 2010 Posted December 10, 2010 Try pick scale from dcl then z e pick centre pt of dwg then z C zzz where zzz is the scale factor for your chosen scale else use the zoom zzzXP again zzz is a scale factor 10XP =1:100 (setq sc (getstring "\nScale for this window 1: ")) (setq sc3 (strcat "1/" sc "xp")) (setq zc (getpoint "\nPoint to centre of view in Viewport:")) (command "_.zoom" "_center" zc sc3) Quote
Grigs Posted December 10, 2010 Author Posted December 10, 2010 I found this routine on the forums and was wondering if it could be integrated somehow into that DSL lisp/DCL routine? (defun c:Test (/ e s) (if (setq e (car (entsel "\nSelect viewport to change/view scale: "))) (if (eq "AcDbViewport" (vla-get-objectname (setq e (vlax-ename->vla-object e)))) (if (setq s (getreal (strcat "\nSpecify new scale (Current: 1\" = " (rtos (/ 1. (vla-get-customscale e)) 2) "'): " ) ) ) (vl-catch-all-apply (function vla-put-customscale) (list e (/ 1. s))) ) (princ "\nInvalid object!") ) ) (princ) ) Quote
JohnM Posted December 10, 2010 Posted December 10, 2010 Just curious. Why not use the AutoCAD properties box? Why do you need it in a lisp? Quote
Grigs Posted December 10, 2010 Author Posted December 10, 2010 Well, I have people in my office that aren't the brightest bulbs in the bunch I want to make setting up sheets the easiest way possible. The properties box doesn't work with civil scales (i.e. 1" = 10'). And I thought this would be a way to simplify the setting up of model windows. Quote
Guest kruuger Posted December 10, 2010 Posted December 10, 2010 maybe this. it is very simple but it works: (defun C:S1 () (DRAWVP 1)) (defun C:S2 () (DRAWVP 2)) (defun C:S4 () (DRAWVP 4)) (defun C:S8 () (DRAWVP ) (defun C:S12 () (DRAWVP 12)) (defun C:S16 () (DRAWVP 16)) (defun C:S24 () (DRAWVP 24)) (defun C:S32 () (DRAWVP 32)) (defun C:S48 () (DRAWVP 48)) (defun C:S96 () (DRAWVP 96)) --------------------------------------------------------------------------------------- (defun DRAWVP (Scale / OLDCMD CVP SS) (setq OLDCMD (getvar "cmdecho")) (setvar "cmdecho" 0) (if (/= (getvar "cvport") 1) (progn (command "_zoom" "_s" (strcat "1/" (itoa Scale) "xp")) (setq CVP (getvar "cvport")) (setq SS (ssget "_X" (list (cons 0 "viewport") (Cons 69 CVP) ) ) ) (command "_vports" "_L" "ON" SS "") (command "_pspace") ) ) (setvar "cmdecho" OLDCMD) (princ) ) (princ) Quote
Recommended Posts
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.