Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Mirroring selection sets in Autocad VBA

Status
Not open for further replies.

brucem

Mechanical
May 22, 2001
2
Can selection sets be mirrored or copied as a group? I am using VB in Autocad 14.
 
Replies continue below

Recommended for you

Hi

I wrote just now the code for mirroring a selection set and posted it on FAQ area.

I tested it about a dozen times on Acad2000 - looks OK.

Please try on Acad14 and let us see if any bugs show up.

Maybe you could revise it for COPY and tell us about it.

Thanks.
 
Sorry, it was not appropriate as FAQ. Here is the code for you:

Sub Tigrek_MirrorSelectionSet()
' ' This example mirrors all entities in a selection set
' made by picking on screen
' I wrote this code today and tested a dozen times
' but there may still be bugs - would appreciate feedback posts here
Dim ssTigrek As AcadSelectionSet
Set ssTigrek = ThisDrawing.SelectionSets.Add("TIGREK_SSET1")
' Add entities to a selection set by prompting user to select on the
screen
ssTigrek.SelectOnScreen
'get the points for mirror axis:
Dim point1 As Variant
point1 = ThisDrawing.Utility.GetPoint(, "Enter first point of mirror
axis: ")
Dim point2 As Variant
point2 = ThisDrawing.Utility.GetPoint(point1, "Enter second point: ")
Dim mirrorObj As AcadEntity
For I = 0 To ssTigrek.Count - 1
Set mirrorObj = ssTigrek(I).Mirror(point1, point2)
Next
ThisDrawing.SelectionSets("TIGREK_SSET1").Delete
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor