WBlock using a cross-window selection

WBlock using a cross-window selection

jagostinho74
Collaborator Collaborator
1,038 Views
6 Replies
Message 1 of 7

WBlock using a cross-window selection

jagostinho74
Collaborator
Collaborator

Hello,

 

I am using the code below to speed up the WBlock command. The desired behaviour is to overwrite the current DWG file using the objects that are visible in the current view bu using a window selection but it seems that it is using a cross window selection instead.

 

Any ideas on how can I get it to use a window selection?

 

Thank you

J

 

^C^C_qsave;qsave;(setq or_tm (getvar"tilemode"))(princ);(setvar"tilemode" 1)(princ);(command".ucs" "W")(princ);(command "wblock" (strcat(getvar"dwgprefix")(getvar"dwgname")) "Y" "" "non" "0,0" "w" (getvar"vsmin") (getvar"vsmax") "")(princ);(command"zoom" "E");(command"delay" 1000);(setvar"tilemode"or_tm)(princ);

 

Assistant BIM/CAD Manager

Manchester, UK


0 Likes
Accepted solutions (2)
1,039 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant
Accepted solution

Anything for which all of it that is visible on-screen is within a selection Window will be selected, even if it extends farther.  So a Window that covers the entire visible area will find everything that is in view at all, even partially.

 

I suggest you set the vsmin and vsmax points into variables, then Zoom 0.95x [you can give it just that without explicitly calling for the Scale option first], to back up a little, then do the WBLOCKing using those point variables for the selection Window [vsmin & vsmax will have changed from the Zooming out].  That way, things that extend beyond it will have portions that are visible now, but not within the Window, so they will not be selected.

Kent Cooper, AIA
Message 3 of 7

jagostinho74
Collaborator
Collaborator

perfect, @Kent1Cooper .

 

Thank you very much for the explanation and proposed solution.

Assistant BIM/CAD Manager

Manchester, UK


0 Likes
Message 4 of 7

jagostinho74
Collaborator
Collaborator

perfect, @Kent1Cooper .

 

Thank you very  much for the explanation and proposed solution.

Assistant BIM/CAD Manager

Manchester, UK


0 Likes
Message 5 of 7

jagostinho74
Collaborator
Collaborator

@Kent1Cooper , just wondering.

How could I make it so to prompt for the selection of objects by the user?

 

Assistant BIM/CAD Manager

Manchester, UK


0 Likes
Message 6 of 7

Kent1Cooper
Consultant
Consultant
Accepted solution

@jagostinho74 wrote:

.... How could I make it so to prompt for the selection of objects by the user?


It should work to replace this part:

  .... "non" "0,0" "w" (getvar"vsmin") (getvar"vsmax") "") ....

with a simple (ssget) for User selection, in place of the Window option and points:

  .... "non" "0,0" (ssget) "") ....

 

Kent Cooper, AIA
Message 7 of 7

jagostinho74
Collaborator
Collaborator

perfect @Kent1Cooper .

Many thanks!

Assistant BIM/CAD Manager

Manchester, UK


0 Likes