Selection set by window selection

Selection set by window selection

Anonymous
Not applicable
11,684 Views
92 Replies
Message 1 of 93

Selection set by window selection

Anonymous
Not applicable

I am trying to create a selection set by selecting entities by a window. i thought it was

 

(prompt "\nSelect Objects by Window")
(setq p1 (getpoint "\nFirst Corner: "))
(setq p2 (getpoint p1 "\nSecond Corner: "))
(setq ss1 (ssget "w" p1 p2))

 

i am having some trouble though. I must be missing something & just not thinking of it.

0 Likes
Accepted solutions (1)
11,685 Views
92 Replies
Replies (92)
Message 2 of 93

cadffm
Consultant
Consultant

What is the feedback after the 4. line?

(copy paste the line to your commandline)

 

Then [F2] to see the feedback

If it is not "nil"

Start move command and select the items by type in P<enter>

 

What is your product/version?

Are the objects visible?

fully inside the window corners of p1 and p2?

[EDIT]Using a english version?[/ EDIT]

Sebastian

0 Likes
Message 3 of 93

dlanorh
Advisor
Advisor

This works for me in 2012. Are you using an English or International version of AutoCAD?

I am not one of the robots you're looking for

0 Likes
Message 4 of 93

Anonymous
Not applicable

I'm using vanilla AutoCAD 2016. United States English version. Its just a floor plan consisting of lines, & some blocks of windows, doors, etc. I'm trying to create a selection set by selecting the objects with a window. I get a dashed  single line when I try to run it instead of the window selection I was expecting

0 Likes
Message 5 of 93

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... I get a dashed  single line when I try to run it instead of the window selection I was expecting


To me, that sounds like maybe you're viewing the whole situation edge-wise to the current Coordinate System.  If you do UCS World / PLAN World, does it still do that?

Kent Cooper, AIA
0 Likes
Message 6 of 93

dlanorh
Advisor
Advisor

@Anonymous wrote:

I'm using vanilla AutoCAD 2016. United States English version. Its just a floor plan consisting of lines, & some blocks of windows, doors, etc. I'm trying to create a selection set by selecting the objects with a window. I get a dashed  single line when I try to run it instead of the window selection I was expecting


This is caused by collecting the preselecting the points p1 and p2 using getpoint. Try just using

 

(prompt "\nSelect Objects by Window")
(setq ss1 (ssget "w" (getpoint) (getpoint)))

 

I am not one of the robots you're looking for

0 Likes
Message 7 of 93

cadffm
Consultant
Consultant

@Anonymous wrote:

 I get a dashed  single line when I try to run it instead of the window selection I was expecting


So is this your "trouble" ? It works (object selection), but you want this dashed rectangle?

LOL, then i missed your point, sorry.

Sebastian

0 Likes
Message 8 of 93

Anonymous
Not applicable

Maybe i should tell you guys what i'm trying to do. i will have a drawing open. The routine will get every multileader in the drawing & explode them. It will then select some entities with a window & then change the color of all entities to the white color. It will then wblock those entities to the directory that the drawing is open to naming it pool.dwg. It will do the same thing to a second bunch of entities naming that pool2.dwg. i found a Lee Mac routine on one of the forums that handles the multleader part, but i'm having trouble with the window to select the entities. Finally it will undo back to the point where the multleaders are exploded making the drawing look like it did with the routine was run. i am attaching the file.

 

 

0 Likes
Message 9 of 93

Sea-Haven
Mentor
Mentor

If you want a box as input you need a GRDRAW box function to temporary draw a box , other way is use rectang and get max min cnrs.

 

Need to google draw a box.

 

Look at yinyang I am sure there is a draw box some where. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/grread/td-p/2706707

0 Likes
Message 10 of 93

Anonymous
Not applicable

i mostly want to be able to select the entities. I was just expecting it to be a window selection. much like if i just typed change properties into the command prompt it asks me to select the objects.

 

 

sovby_0-1601098184208.png

 

0 Likes
Message 12 of 93

Anonymous
Not applicable

Thank you. I'll start looking through this

0 Likes
Message 13 of 93

Anonymous
Not applicable

Must be a few errors in the code that was posted. i found one area that was missing a double quote. I get a too few arguments error message so ill have to look at it some more. i am trying the first post in the link by the way

0 Likes
Message 14 of 93

hak_vz
Advisor
Advisor
(prompt "\nSelect Objects by Window")
(setq p1 (getpoint "\nFirst Corner: "))
(setq p2 (getcorner p1 "\nSecond Corner: "))
(setq ss1 (ssget "w" p1 p2))

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 15 of 93

hak_vz
Advisor
Advisor

Also you can use command SELECT, and after that you have selection set as:

(command "Select")(setq ss (ssget "p"))

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 16 of 93

ВeekeeCZ
Consultant
Consultant

Just curios, why simple

(setq ss (ssget)) is not enough?

That allows you a window selection within dashed rectangle... what am I missing?

0 Likes
Message 17 of 93

hak_vz
Advisor
Advisor

@ВeekeeCZ wrote:

Just curios, why simple

(setq ss (ssget)) is not enough?

That allows you a window selection within dashed rectangle... what am I missing?


It is just enough to create selection set.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 18 of 93

Anonymous
Not applicable

I was getting an error message when i tried that originally. It turns out that the area i thought was creating the problem was not correct. Right after the selection set i want to change all the colors of the objects selected to color white. The code that i had is (COMMAND "change" ss1 "p" "COLOR" "7" ""). This seems to be causing the error.

 

I am attaching the error i am getting. After that i want to wblock that same selection set to the directory that i am working from

 
 

 

 

0 Likes
Message 19 of 93

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

I was getting an error message when i tried that originally. It turns out that the area i thought was creating the problem was not correct. Right after the selection set i want to change all the colors of the objects selected to color white. The code that i had is (COMMAND "change" ss1 "" "p" "COLOR" "7" ""). This seems to be causing the error.

 

I am attaching the error i am getting. After that i want to wblock that same selection set to the directory that i am working from

 
 

 

 


you still need to close the ss

0 Likes
Message 20 of 93

Anonymous
Not applicable

hmmm. It doesn't seem to be running the change command. I wonder if i need a progn statement or something.

 

(prompt "\nSelect Objects for Pool.dwg by Window")
(setq p1 (getpoint "\nFirst Corner: "))
(setq p2 (getcorner p1 "\nSecond Corner: "))
(setq ss1 (ssget "w" p1 p2))

(COMMAND "change" ss1 "" "p" "COLOR" "7" "")

0 Likes