Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA - Copy Selectionset entities to other layer

Status
Not open for further replies.

antoniomiranda

Civil/Environmental
Nov 20, 2002
2
Hello,

I need to create a Visual Basic Routine to copy entities to other layer, using acselectionsetall.

Thank´s
 
Replies continue below

Recommended for you

Just a few questions,
Are you copying any block references and do you want every single entity to "be" on this target layer (including the ones inside the block)?

BU
 
Hello,

Many thank's for your fast response

I need to copy everithing on a layer to another layer, using the VBA (selectionset).

At the momment I'm able to work whith selectionsets, but I don't know how to move or copy that information to other new layer (or not new).

I would be very gratfull if you could help me, PPPPlllleeeeaaaasssssseeeeee. ;-)

Best regard,
António Miranda
 
Since you know about selection sets already, this should iterate through all the items in your selection set and reassign their layers. Let me know if this does what you want.


Dim acEnt as AcadObject
If acSelSet.Count = 0 Then 'didn't find any
Exit Function
Else
For Each acEnt In acSelSet 'each item in selection set
acEnt.Layer = yourNewLayer
acEnt.Update
Next acEnt
End If
 
There is a list routine in the AutoCAD express tools that does what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor