Message 1 of 3
Is there a copy or move property for a group of objects?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a group of objects and can use the color property to color all the objects at once. Similarly, I would like to copy and move all the objects at once, but I am unsuccessful. Can this be confirmed? I can copy and move the objects individually, but that defeats the purpose of grouping.
Any advice or assistance would be welcomed. Below is the code that works fine for coloring all the objects at once.
Public Sub AddAGroup()
Dim GroupObject As AcadGroup
Dim ObjectsForGroup() As AcadEntity
Dim CircleObject As AcadCircle
Dim Center(0 To 2) As Double
Dim Radius As Double
Dim Count As Integer
Center(0) = 1: Center(1) = 1: Center(2) = 0
Radius = 1.5
Set CircleObject = ThisDrawing.ModelSpace.AddCircle(Center, Radius)
ReDim ObjectsForGroup(0 To ThisDrawing.ModelSpace.Count - 1) As AcadEntity
For Count = 0 To ThisDrawing.ModelSpace.Count - 1
Set ObjectsForGroup(Count) = ThisDrawing.ModelSpace.Item(Count)
Next
Set GroupObject = ThisDrawing.Groups.Add("MyGroup")
GroupObject.AppendItems ObjectsForGroup
GroupObject(0).Color = acGreen
GroupObject.Highlight True
ThisDrawing.Regen acActiveViewport
End Sub