comcu Posted March 2, 2009 Posted March 2, 2009 Hi, have been messing around with this and it wont work properly. i am trying to cycle thru layouts using vba. i have the following code that works as long as the layout are in the correct order. as soon as i move the layouts about it wont work properly? Dim objLayouts As AcadLayouts Dim LayerNextNo As Integer Set objLayouts = ThisDrawing.Layouts LayerNextNo = ThisDrawing.ActiveLayout.TabOrder ThisDrawing.ActiveLayout = objLayouts.Item(LayerNextNo) i want to control the the active layout out by saying it active layout taborder no is "1" then got to layout tab no "2" but i cant get it to work? cheers, col Quote
ML0940 Posted March 3, 2009 Posted March 3, 2009 Hi Col, So let me see if I understand you; you want to enter the layout by its tab order (index) number, and have that become the active layout? Will that order change, or is it fixed? ML Quote
ML0940 Posted March 3, 2009 Posted March 3, 2009 Also, did you want to be prompted for the layout number? Quote
comcu Posted March 3, 2009 Author Posted March 3, 2009 Hi ML, yes the order will probably change. i manage to get some code to work but as soon as you change the positions of the layouts from the order they were creted it messes the whole thing up. i found some code that puts them back into the original order and then my code would work but thats not what i want. cheers, col. Quote
Cannibal Smurf Posted March 19, 2009 Posted March 19, 2009 Bump, also after something similar, keen to see some replies here... Quote
ML0940 Posted March 19, 2009 Posted March 19, 2009 Comcu, If you'd like, post your code, if it is VBA, and I can take a look. Also, in the acad.dvb file, there is an event that will trigger after a layout has been changed. So, if you were to put your second bit of code into that event module, the layouts would get re-indexed for you, after you do your thing. To see if this suggestion would truly work, or perhaps a different one, it would be best to take a look at the code. ML 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.