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

routine to count polyline numbers

  • Thread starter Thread starter Pepi65
  • Start date Start date

Pepi65

Guest
Bye to all,
Someone can help me solve my problem. I would like to find a macro that allows me to "recover" the number of polylines within a selected area (this selection should always be made by means of the macro).
Thank you. .
 
I mean, would you like the macro to ask for a window selection and then tell you how many polylines are contained within the selection?

only those fully understood or even those partially included in the selection ?
 
But you don't need a macro for something like that. ..just use a normal selection window and read the count in the property palette. . .
 
attached to the macro, it is a very simple thing.

This is the base, then if you want you can change to taste.
public sub pl_count()
dim sset as acadselectionset
dim element as acadentity
dim filtertype(0) as integer
dim filterdata(0) as variant

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")

filtertype(0) = 0
filterdata(0) = "lwpolyline"

sset.selectonscreen filtertype, filterdata

msgbox ("polilinee comprese nella selazione: " & sset.count)

end sub
 

Attachments

Forum statistics

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

Members online

No members online now.
Back
Top