command COPY using Group Name as SSGET filter?

command COPY using Group Name as SSGET filter?

scot-65
Advisor Advisor
1,362 Views
5 Replies
Message 1 of 6

command COPY using Group Name as SSGET filter?

scot-65
Advisor
Advisor

This office uses Groups in lieu of Blocks for certain procedures.

The behavior I wish to employ will replicate the command INSERT.

 

I am developing a dialog that shows a list_box populated with

group names. The user selects a group name and the resulting

group is at the crosshairs, ready for placement.

 

Generating the list (and filtering the names) is not the issue.

 

How to "select" a group [and (command pause) while in the

middle of command COPY] is what I am looking for?

 

- How to determine the group's insert point (grip) will also be required.

 

- There can be more than one copy of the named group in a particular file.

 

- LISP and/or VL* is acceptable.

 

scot-65

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
1,363 Views
5 Replies
Replies (5)
Message 2 of 6

ВeekeeCZ
Consultant
Consultant
Command: COPY
Select objects: G
Enter group name: Groupname
2 found
Select objects:
...
0 Likes
Message 3 of 6

john.uhden
Mentor
Mentor

I really don't like using groups.  I prefer anonymous blocks.

Anyway, if you can get at the named group vla-object it has a count property so you could use vlax-for to get all its entities, which you could put into a selection set.

I noticed that when you copy a group it gets a new name, like *A1" etc.  That's another reason why I like UBlocks.  You can copy them and the name stays the same.  Whereas once you've copied a group, and have more than one original group, you can't easily tell who its parent was (poor little ****).

 

I don't think groups have insertion points, but you could derive one using boundingbox on its members.

Oh yeah, and UBlocks do have insertion points.

John F. Uhden

0 Likes
Message 4 of 6

scot-65
Advisor
Advisor
I too do not like Groups.
Groups are good for "bundling" predefined items into a
package where the elements of this package can be arranged
once the copy of a group is positioned.

For example:
Building footprint, mechanical equipment and utility meters.
Once a copy of this group is placed, the mechanical equipment
and utility meters can be tailored around the building footprint
on a per-site basis.

Blocks cannot do this when unexploded.

🙂

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 5 of 6

scot-65
Advisor
Advisor

OK, thanks for the start.

For now, until I can extract bounding box properties, I can fetch

the first entity in the group and extract the starting/insert point

and use that as the "base point" for the COPY command.

 

(setq p1 (cdr (assoc 10 (entget (cdr (assoc 340 (dictsearch (cdar (dictsearch (namedobjdict) "ACAD_GROUP")) "G1")))))))

 

Scot-65

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 6 of 6

patrick_35
Collaborator
Collaborator

Hi

 

For example

(setq grp (vla-get-groups (vla-get-activedocument (vlax-get-acad-object))))
(prompt (strcat "\nFirst Group's name : " (vla-get-name (vla-item grp 0))))

 

@+

0 Likes