ANDREWPCX Posted February 17, 2010 Posted February 17, 2010 Hey, i'm needing a very specific code. I need to know how, while iterating block references, get to know on which layout a given block reference is. For example: For Each objBlockReference in Thisdrawing.blocks 'Tell me where this block reference is... 'By this i say "i don't have the smallest clue on how to do it"... next bojBlockReference Please i need help on this. I'm trying to develop an auto-numbering drawing box for my company and i got stuck here. I need it to be VBA code, since i have no experience with lisp. Please any comment will be helpful... Quote
Lee Mac Posted February 17, 2010 Posted February 17, 2010 Looks like you are iterating through the block collection, which only contains the block definitions, not the block references. Annoying thing is, I am a LISP guy Quote
ANDREWPCX Posted February 17, 2010 Author Posted February 17, 2010 I just changed that approach a few minutes ago. Too bad if you can't help any more than that... if you can. I will appreciate it. However thanks for letting me know. If there is anything else you know you think can be helpful, i'll be happy to read it... Quote
Lee Mac Posted February 17, 2010 Posted February 17, 2010 Well, there are two ways you could approach it, iterate through the object collection for each layout, and check for the block name. Or try to create a SelectionSet for each layout, get its 'count' prooperty. Lee Quote
BIGAL Posted February 18, 2010 Posted February 18, 2010 Have a look under BIGAL i posted previous VBA code to look through blocks and do a title block update but this is global. A couple of problems though when you step through a number of title block sheets you know which one comes next sometimes a layout tab is renamed and pushed in the sequence order. I may be wrong here but if you compare the screen view that you look at versus the order autocad displays the tabs in the sheets could be numbered wrong. Autocad in a lot of situations supplies the table info in the order it was created not by the look. What I am saying is you will probably need to arrange the layout tabs or use a tab name to ensure correct numbering. Other than that it should be possible to renumber the sheets etc . Quote
BIGAL Posted February 18, 2010 Posted February 18, 2010 have a look at this also http://www.cadtutor.net/forum/showthread.php?t=41439&highlight=title+sheet 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.