• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

count and number the blocks belonging to a layer

  • Thread starter Thread starter gennarochiocca
  • Start date Start date

gennarochiocca

Guest
Bye to all,

I need advice,
I would like to split a macro vba that accounts the blocks in a certain layer and then numbers them automatically, it could be useful to me the bcount command.
How can I do that?

thank you all.. .

and good to make.
 
Bye to all,

I need advice,
I would like to split a macro vba that accounts the blocks in a certain layer and then numbers them automatically, it could be useful to me the bcount command.
How can I do that?

thank you all.. .

and good to make.
What do you mean by numbering?

then to select blocks belonging to a layer an example is this:

dim element as acadblockreference
dim sset as acadselectionset

on error resume next

if not isnull(thisdrawing.selectionsets.item("element") then
set sset = thisdrawing.selectionsets.item("element")
sset.delete
end if


set sset = thisdrawing.selectionsets.add("element")
dim filtertype(1) as integer
dim filterdata(1) as variant
filtertype(0) = 0'(dxf filter entity code)
filterdata(0) = "insert"(block filter)
filtertype(1) = 8'(dxf filter layer code)
filterdata(1) = "name_layer"(code dxf filter name layer)

, filtertype, filterdata

sset.count (from the number of attachments covered in the filter selection)

'then there will be a cycle to make numbering (I have not understood what you mean) but it will start with:

for each element in sset
...... .
...... .
...... .
next element



with the information you gave the most I can't help you.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top