CadTechJGC184 Posted April 22, 2009 Share Posted April 22, 2009 At my last job they had a command or a lisp that took the exact shape of your view port and moved that same shape to the model space. This way you knew your drawing limits, so you got everything to show up in your view port. Any suggestions? Thank you!! Quote Link to comment Share on other sites More sharing options...
lpseifert Posted April 22, 2009 Share Posted April 22, 2009 Draw a rectangle (or polyline) over your viewport, then use Chspace. Quote Link to comment Share on other sites More sharing options...
CadTechJGC184 Posted April 22, 2009 Author Share Posted April 22, 2009 Lsp, that's what I'm doing now. at my last job.. all i had to do is select the view port and it would do that for me. It does it so you don't have to draw a rect. and then chspace. Type " whatever it was" and select the vp. Quote Link to comment Share on other sites More sharing options...
CadTechJGC184 Posted April 22, 2009 Author Share Posted April 22, 2009 I would love to be able to write it myself. I just have no clue how to create a lisp. I do want to learn, just really busy at work. I'm working in New Orleans rebuilding the levees and pump stations. 60 to 70 hour weeks. I was hoping someone had it available already. Quote Link to comment Share on other sites More sharing options...
Freerefill Posted April 22, 2009 Share Posted April 22, 2009 Did this up real quick. Won't let you select the viewport, only works for the first viewport on the layout tab. If you only have one viewport on your layout, it should work just fine. It basically does what you're doing, only automatically. (defun c:vex() (setq osnapz (getvar "osmode")) (setvar "osmode" 0) (command "rectang" (cadr (cadr (vports))) (caddr (cadr (vports)))) (command "chspace" (entlast) "") (command "pspace") (setvar "osmode" osnapz) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 22, 2009 Share Posted April 22, 2009 Just buildin on that: (defun c:vex (/ osnapz vp vpID) (setq osnapz (getvar "osmode")) (if (and (setq vp (car (entsel "\nSelect Viewport: "))) (eq "VIEWPORT" (cdadr (entget vp)))) (progn (setq vpID (cdr (assoc (cdr (assoc 69 (entget vp))) (vports)))) (setvar "osmode" 0) (command "rectang" (car vpID) (cadr vpID)) (command "chspace" (entlast) "") (command "pspace"))) (setvar "osmode" osnapz) (princ)) Quote Link to comment Share on other sites More sharing options...
Freerefill Posted April 22, 2009 Share Posted April 22, 2009 Just buildin on that: (defun c:vex (/ osnapz vp vpID) (setq osnapz (getvar "osmode")) (if (and (setq vp (car (entsel "\nSelect Viewport: "))) (eq "VIEWPORT" (cdadr (entget vp)))) (progn (setq vpID (cdr (assoc (cdr (assoc 69 (entget vp))) (vports)))) (setvar "osmode" 0) (command "rectang" (car vpID) (cadr vpID)) (command "chspace" (entlast) "") (command "pspace"))) (setvar "osmode" osnapz) (princ)) Nicely done, Lee. I was going to do something like that, but became daunted at the prospect of selection, checking to see if the selection was a viewport, and getting the limits from assoc 10, 40 and 41 and a bit of math. Should have known you'd come up with a slicker solution. ^^ Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 22, 2009 Share Posted April 22, 2009 Cheers Freerefill Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 22, 2009 Share Posted April 22, 2009 this is what i use, found it long ago: http://www.jtbworld.com/lisp/vp-outline.htm Quote Link to comment Share on other sites More sharing options...
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.