AnsweredAssumed Answered

Find number of block instances on active sheet

Question asked by Xing Chen on Nov 22, 2019
Latest reply on Nov 23, 2019 by Peter Brinkhuis

Hi,

 

Our company has old setup of the revision block which came from AutoCAD time. Instead of using revision block function, we created a block and then edited the attribute of the block to change content of the revision block. I made a macro to add revision block and place it in the correct position. The macro runs well when there is only one sheet in the drawing file. It start to get problem when multiple sheets presented in the drawing.

 

We don’t differentiate first sheet with the rest of them .So they all have exact sheet template which already include a revision block instance.  We only put revision table in sheet 1. So I can use

 (number of block instances) -  (number of sheets) +1

to count how many revision blocks on sheet 1. I used this number to find the proper position of my new block instance.

 

However, some people in my team doesn’t like revision block in sheets other than sheet 1. They manually delete them. That causes issue for the macro to count number of block instance.  Is there a method to count number of block instance on active sheet? GetInstanceCount() method will take all instances of the entire drawing.

 

Thanks

Outcomes