Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

Also, did you want to be prompted for the layout number?

Posted

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.

  • 3 weeks later...
Posted

Bump, also after something similar, keen to see some replies here...

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...