VBA - Invalid Group Name - Using ACAD2000

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings ... Simplest example I can muster to demonstrate group name reference call failure. When created via code and using more than two letters, it fails , use two letters it works
. Now if the same group is manually created through the UI using the group name of "Group4" the trim command works
.
Note: Code execution leaves the command open for item selection in the ACAD window. This image shows the commandline demonstrating the error message "Invalid Group Name" when using name Group4 and the success of name G4.
Please review these photos for the commandline output ... facebook account is not necessary to view.
http://www.facebook.com/album.php?ai...1&l=f06b8fe6e8
Any ideas how to work around this in ACAD2000? Does this work correctly in more current versions? Such as ACAD2002, 2004 or 2006? How about .NET API versions?
'Example of Group Name Reference Failure Public Sub Create_and_ReferenceGroup() 'Run with an empty open document Dim oacadapp As AutoCAD.AcadApplication Set oacadapp = AutoCAD.AcadApplication Dim oacaddoc As AutoCAD.AcadDocument Set oacaddoc = oacadapp.ActiveDocument Dim oGroup As AcadGroup Dim oGroupArray(1) As AcadEntity Set oGroup = oacaddoc.Groups.Add("Group4") Set oGroup = oacaddoc.Groups.Add("G4") oacaddoc.SendCommand "_trim" & vbCr & "g" & vbCr & oacaddoc.Groups.Item("Group4").Name & vbCr & oacaddoc.Groups.Item("G4").Name & vbCr End Sub
Thanks, Brian M Sardeson
Production Development Engr - Engr Support Specialist
Skyline Corp www.skylinecorp.com
AU Presenter - '08 / Attendee - '06-'07
Inventor 5 - 2010 / AutoCAD 12 - 2010
Pgmr: VB / VBA / .NET / SQL / LISP (If i must)
MAMSUG - Past Director '07 - '09