Bill Tillman Posted August 18, 2014 Share Posted August 18, 2014 I have a small LISP program and it creates a new Layout Tab and gives it a name. (command "._LAYOUT" "_N" "8.5x11") Trouble is it comes with it's own default viewport which I really don't need. In fact, this default viewport gets smack dab in the way of a new viewport I create on this new layout tab. Is there a method to not have the default viewport created in the first place or if not, how could I delete it once the new layout tab is established? Quote Link to comment Share on other sites More sharing options...
Bill Tillman Posted August 18, 2014 Author Share Posted August 18, 2014 Okay, ask and ye shall receive. The searches I did were coming up with zilch until I changed the phrase "delete viewport" to "remove viewport" and that yielded this: (vlax-for Obj (vla-get-PaperSpace (vla-get-ActiveDocument (vlax-get-Acad-Object))) (if (= (vla-get-ObjectName Obj) "AcDbViewport") (vla-Delete Obj) ) ) which did the trick. It doesn't actually create a new layout tab without a viewport but it does remove the default one that came with it. And that's all I was really after. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 18, 2014 Share Posted August 18, 2014 First thing, you can preclude the creation of a new 'default' Viewport in Options, Display tab, Layout Elements area, un-check "Create viewport in new layouts." Second, be mindful that the first Viewport in Viewports Collection Object is the Paperspace Viewport itself... I do forget if that is also iterated over in the method you posted, or not. Just wanted to mention just in case. Cheers Quote Link to comment Share on other sites More sharing options...
Bill Tillman Posted August 18, 2014 Author Share Posted August 18, 2014 Thanks, and I didn't think about that setting in the options until you mentioned it. This is a down and dirty task that's going to be run on about 600 drawing files. So we can make the change only while this work is being done. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 18, 2014 Share Posted August 18, 2014 Thanks, and I didn't think about that setting in the options until you mentioned it. This is a down and dirty task that's going to be run on about 600 drawing files. So we can make the change only while this work is being done. If you find you need the option with/without down the road, you can simply create a duplicate production Profile, with the setting turned off for future, similar automations. Just launch application with the appropriate startup switch. Cheers 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.