MrCrozzB Posted June 3, 2013 Posted June 3, 2013 Can I modify an existing viewport in a macro or in the command line? Using a macro, I want to modify (specifically delete) the viewport from a layout tab after chspace from model space. Does anyone know how to do this? I have LT so no LISP. qselect works but cannot be put into a macro. If I "select all" on a layout tab in paperspace ACAD says 1 of the objects selected is the viewport so I know autocad recognizes the viewport as a different kind of object. Thanks for your help. Quote
steven-g Posted June 4, 2013 Posted June 4, 2013 (edited) LT doesn't give us a lot of options, you could try select and then enter "p" for previous, for me that selects the viewport after you have used pspace. when you are in a viewport "cvport" will tell you the number of that viewport and you can use that to swap between viewports on a layout (providing you know the numbers).It all depends on what you are doing. You can enter coordinates at the select prompt for a selection window. If at some point you can put the viewport into a named group, then select offers you the chance to select that as well. Jusdt a few ideas to look at. Edit ---oops the first option doesn't work, I had resized the viewport to try things thats why it showed up as the previous selection--- Edited June 4, 2013 by steven-g Quote
steven-g Posted June 4, 2013 Posted June 4, 2013 There are a couple of other methods you could use to just select viewports but it would only select all viewports, if you only have one viewport then ok but if you want to select one from many ?? Quote
MrCrozzB Posted June 4, 2013 Author Posted June 4, 2013 Lets assume I only have single viewport. I have written a maco to generate a generic viewport at extents on a new layout tab but then i want delete the viewport later in the macro. The whole point is to make a scale copy of everything in model space but save it on a layout tab in paperspace. Kind of a poor mans revision tracker. Quote
steven-g Posted June 4, 2013 Posted June 4, 2013 OK it's LT so a bit long winded, but probably your easiest would be create the viewport on it's own layer. Then when you are done you can use the command line -LAYER to lock all layers using "*" and then unlock the layer for the viewport using it's layer name, after that just select "all" and delete, everything else on locked layers is left alone, now just unlock everything. That's just a basic outline, I hope you can follow the line of thought, but sometimes in order to get something done, you have to start somewhere else. Quote
MrCrozzB Posted June 6, 2013 Author Posted June 6, 2013 (edited) I should mention that I wrote a macro that works using a combination of select all, previous, and remove but I would like to be able to be able to do other things with the viewport in the macro. I don't particularly mind if it takes longer, since its just going into a button so I will give this a try. If you can find a way to be able to select the viewport using the command line because ACAD will do it with qselect. What I would really like is to use command line for the same things you can do in qselect so that the same things can be done with macros if you know things like object type or color etc. Edited June 6, 2013 by MrCrozzB Quote
steven-g Posted June 6, 2013 Posted June 6, 2013 It isn't straight forward. I use tricks like the above, but it does mean planning ahead, do things like putting objects onto named layers, another method is putting things into named groups (you can select a group from the command line, for viewports you could draw a rectangle, use mview to to change it into a viewport and then use the selectsimilar command, it all depends on what you are doing and what you want to achive. 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.