Need this LISP to allow for selection of multiple objects

Need this LISP to allow for selection of multiple objects

Anonymous
Not applicable
2,896 Views
10 Replies
Message 1 of 11

Need this LISP to allow for selection of multiple objects

Anonymous
Not applicable

I am trying to modify the attached LISP routine so I can manually select objects with a window instead of picking individual objects.  I cannot for the life of me get it right.  I am trying to use the following guidance I read online:

 

 

(setq sel1 (ssget "x"))

 

"This function allows you to select as many entities as you like using any selection method, such as Window, Crossing, Fence, etc.
You can also include a selection set filter within the function."

 

 I cannot make it work.  What am I doing wrong?

0 Likes
Accepted solutions (1)
2,897 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
Accepted solution

Sorrry Sorry Sorry!!! I forgot the LISP was supposed to be used OUTSIDE on the actual block and NOT inside the block editor!  I had what I wanted and didn't realize it!!  Learn from my mistakes!

0 Likes
Message 3 of 11

Satoews
Advocate
Advocate

try ssget without the x 

 

(ssget)
Shawn T
Message 4 of 11

Anonymous
Not applicable

You are right about the ssget with nothing afterward....but I am constantly getting  bad argument type: consp errors.  Plus, my selection set is the whole block, not the individual objects, so clearly I am trying to put a square peg in a round hole...

0 Likes
Message 5 of 11

hmsilva
Mentor
Mentor

@Anonymous wrote:

You are right about the ssget with nothing afterward....but I am constantly getting  bad argument type: consp errors.  Plus, my selection set is the whole block, not the individual objects, so clearly I am trying to put a square peg in a round hole...


Hi neeboy,

are you trying to run your code only in block editor?

 

Henrique

 

 

EESignature

0 Likes
Message 6 of 11

Anonymous
Not applicable

I need the code to run outside of the block editor.  I have to edit sometimes as many as several dozen, unique block definitions, and I'm looking to save time anywhere I can...hence trying to do away with constantly opening/closing the block editor every time.

0 Likes
Message 7 of 11

hmsilva
Mentor
Mentor

@Anonymous wrote:

I need the code to run outside of the block editor.  I have to edit sometimes as many as several dozen, unique block definitions, and I'm looking to save time anywhere I can...hence trying to do away with constantly opening/closing the block editor every time.


Ok!

And your goal is to select an INSERT and change all objects inside block definition to layer HILMOT-ARROWS, correct?

 

Henrique

EESignature

0 Likes
Message 8 of 11

Anonymous
Not applicable

No. not ALL the objects, just the ones I select...and when I say select, I mean select with the normal "drag a window across" method.  I'm trying to avoid picking each individual object, some of them are lines less than an inch long and that gets a little unnerving, trying to pick 20-30 reaaaaally small lines individually.

 

I've got the "move-all" option already covered.  

0 Likes
Message 9 of 11

hmsilva
Mentor
Mentor

@Anonymous wrote:

No. not ALL the objects, just the ones I select...and when I say select, I mean select with the normal "drag a window across" method.  I'm trying to avoid picking each individual object, some of them are lines less than an inch long and that gets a little unnerving, trying to pick 20-30 reaaaaally small lines individually.

 

I've got the "move-all" option already covered.  


We can't use nentsel with a selection window, therefore you'll probably have to open block editor and select the objects...

You can do all this in a code, but the selection have to be in block editor...

 

Henrique

EESignature

0 Likes
Message 10 of 11

Anonymous
Not applicable

Yeah that's what I was afraid of...I'm concurrently working on ways to select EVERYTHING through LISP and put different things on different layers automatically (which I'm sure you've seen me post about).  That is proceeding along fine, but I'm trying to plan also for the times where I might ultimately not be able to grab everything with LISP.

0 Likes
Message 11 of 11

hmsilva
Mentor
Mentor

@Anonymous wrote:

Yeah that's what I was afraid of...I'm concurrently working on ways to select EVERYTHING through LISP and put different things on different layers automatically (which I'm sure you've seen me post about).  That is proceeding along fine, but I'm trying to plan also for the times where I might ultimately not be able to grab everything with LISP.


This one?

 

'trying to pick 20-30 reaaaaally small lines'

 

If the lines are realy small, and if there are no more small lines, test the 'Length' propertie with some fuzz and change those lines to layer HILMOT-ARROWS...

 

Hope this helps,
Henrique

EESignature

0 Likes