VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Working with Layouts

3 REPLIES 3
Reply
Message 1 of 4
JeffWright5789
317 Views, 3 Replies

Working with Layouts

Hello Forum Users and thanks in advance for your replys.

 

Would like to "step thru" the layouts in the order shown on the screen and insert a block with an attribute at a predefined location on each layout. I believe using the ordinal position is not the answer because I believe that the ordinal position seems to report the order in which the  layout was created.

 

How can I access the order the item (layout) is displayed on the screen?   A short vba or lisp snippet to get started would be great.  I believe I can get it from there.

 

Appreciate all the help from the Forum
Version: AutoCAD C3D 2010
3 REPLIES 3
Message 2 of 4
Ed.Jobe
in reply to: JeffWright5789

VBA doesn't expose the information about the order that tabs appear on the dwg status bar. All you can do is iterate the Layouts collection. Still, I don't see why you would need that if you are just inserting a block on each. Would checking the layout's Name as you iterate help?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 4
JeffWright5789
in reply to: Ed.Jobe

The attribute of the block is going to be incremented by some index number, say 5 for each different layout and then inserted into each sheet, similar to numbering the sheets. As a whole different approach, I suppose if I named / coded the name of the layouts with that index as part of the tab name I could parse it out... the problem would arise if I move or reorder the layout tabs... is surprises me the layout display position is exposed...
Appreciate all the help from the Forum
Version: AutoCAD C3D 2010
Message 4 of 4
Ed.Jobe
in reply to: JeffWright5789

Pardon me. I never noticed that property before. However, that is a property of the Layout, so you can't iterate on the tab number. You would have to iterate the Layouts collection to get a layout and then decide what to do based on the TabOrder. Same idea as I mentioned before, just on a different property.

 

Model tab is fixed at 0, i.e. you can't move its position. You can use that to eliminate processing the model tab with (Layout.TabOrder >0)

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost