style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<_gile> wrote in messageHi,
href="news:6129283@discussion.autodesk.com">news:6129283@discussion.autodesk.com...
Another way (replace group_name by the name of the group you're
checking for): (member (cons 3 group_name) (dictsearch (namedobjdict)
"ACAD_GROUP"))
Try this sequence:
(setq dwgname (strcase(substr (setq dwgname (getvar "dwgname")) 1 (- (strlen dwgname) 4)))) ; get current drawing name stripping file extension
(if(member (cons 3 dwgname) (dictsearch (namedobjdict) "ACAD_GROUP"))
(command"-Group""_Create" dwgname "_Yes" dwgname) ; group exists and will need Yes to redefine
(command"-Group""_Create" dwgname dwgname)
)
Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator | Layer Apps | List on Steroids | VP Zoom Scales
Exchange App Store
One idea: make the group names a series, ie:
a constant prefix, and a variable suffix.
Example: prefix of "GN-" and
sufix of "1", "2" ...etc.
The name string by
(setq gnps "GN-" gnsi 1) ; ini
(setq gns (strcat gnps (itoa gnsi )) ) ; 1 name
Subsequent names by indexing the gnsi
(setq gnsi (1+ gnsi))
And the existance of each should be tested
before creating the 'group' object;
as shown elsewhere in this thread.