muck Posted April 23, 2009 Share Posted April 23, 2009 AutoCAD 2009 How can a person use VBA to control viewport layers vers controling model space layers? With a drawing with more than one viewport? Thank you, Quote Link to comment Share on other sites More sharing options...
CmdrDuh Posted April 23, 2009 Share Posted April 23, 2009 thinking out loud, grab the viewport you want, get its handle, go inside the VP and then manipulate the layers from there Quote Link to comment Share on other sites More sharing options...
muck Posted April 24, 2009 Author Share Posted April 24, 2009 How do you change layer name and color using VBA Code? For example say you want layer 1 in a view port to be red. Layer one in model space to be green. Say you want layer one to be blue in second view port. How can this be done with VBA code? Thank you, Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 24, 2009 Share Posted April 24, 2009 Some more info in here: http://www.cadtutor.net/forum/showthread.php?t=34934 Quote Link to comment Share on other sites More sharing options...
muck Posted April 24, 2009 Author Share Posted April 24, 2009 I can scan thru the layers collections and use something like objLayer.color = TxBoxLayerColor(k) to set color of a layer for the drawing but how can I set a color in a viewport in paper space without changing the drawing layer color. There must be a way to access the color in the view port some how. Quote Link to comment Share on other sites More sharing options...
CmdrDuh Posted April 24, 2009 Share Posted April 24, 2009 I will check tomorrow at work, but I would think IF it can be done, there will be a property in the layout or viewport collection, not the layer collection Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 24, 2009 Share Posted April 24, 2009 I was under the impession from reading that thread that I posted, that it couldn't be done... 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.