Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

VB group codes for Groups

Status
Not open for further replies.

rocheey

Programmer
Dec 26, 2007
8
0
0
US
Im attempting to try the filterdata on a selection set.
Straightforward enough for graphic entities; but how could i filter for a "Group" object itself?
 
Hi rocheey,

You don't. Use this utility I've adapted from my faq687-5792 :

Code:
Public Function vbdPowerGroup(strName As String) As AcadGroup
  '
  ' *** vbdPowerGroup ***
  '
  ' Function to add a new group by name, and check
  ' for an existing group.
  '
  Dim objGrp As AcadGroup
  Dim objGrpCol As AcadGroups
  Set objGrpCol = AcadDoc.Groups
    For Each objGrp In objGrpCol
      If objGrp.Name = strName Then
        objGrpCol.Item(strName).Delete
        Exit For
      End If
    Next
  Set objGrp = objGrpCol.Add(strName)
  Set vbdPowerGroup = objGrp
End Function

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top