×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VBA - Copy Selectionset entities to other layer

VBA - Copy Selectionset entities to other layer

VBA - Copy Selectionset entities to other layer

(OP)
Hello,

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

Thank´s

RE: VBA - Copy Selectionset entities to other layer

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

RE: VBA - Copy Selectionset entities to other layer

(OP)
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

RE: VBA - Copy Selectionset entities to other layer

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

RE: VBA - Copy Selectionset entities to other layer

There is a list routine in the AutoCAD express tools that does what you need.

RE: VBA - Copy Selectionset entities to other layer

Not 'list'  s be 'lisp' sorry.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources