PDA

View Full Version : using the "ssget x" function


stephen.coff
2007-07-25, 06:09 AM
Guys,
Can create a new layer with lisp and can select objects using the "ssget x".
In this situation i wish to select everything on the screen so "ssget x" is perfect. How do i use the two together to select everything and place it on a set layer and colour etc created ?

Stephen

Adesu
2007-07-25, 09:58 AM
Hi stephen,
How about this code

(setq col 1)
(setq lay "Layer1")
(setq ss (ssget "_x" (list '(0 . "Line")(cons 62 col)(cons 8 lay))))


Guys,
Can create a new layer with lisp and can select objects using the "ssget x".
In this situation i wish to select everything on the screen so "ssget x" is perfect. How do i use the two together to select everything and place it on a set layer and colour etc created ?

Stephen

stephen.coff
2007-07-25, 10:13 AM
Adesu,
I tried it though returned "nil" with no result as far as I can tell ?
Below is the cammand line:

Command: (setq col 1)
1
Command: (setq lay "Layer1")
"Layer1"
Command: (setq ss (ssget "_x" (list '(0 . "Line")(cons 62 col)(cons 8 lay))))
nil

I tried using it in a lisp routine and creating the layer first and then what is above though still nothing. Is what you have writen only select all lines ?

Stephen

Adesu
2007-07-25, 10:30 AM
try again and don't set your object as bylayer.

Adesu,
I tried it though returned "nil" with no result as far as I can tell ?
Below is the cammand line:

Command: (setq col 1)
1
Command: (setq lay "Layer1")
"Layer1"
Command: (setq ss (ssget "_x" (list '(0 . "Line")(cons 62 col)(cons 8 lay))))
nil

I tried using it in a lisp routine and creating the layer first and then what is above though still nothing. Is what you have writen only select all lines ?

Stephen

stephen.coff
2007-07-25, 11:25 AM
Adesu,
This may be very frustrating for you though what do you mean ?
Are talking about setting the colour, linetype and weight other than "bylayer" ?
Because this doesn't make any difference. I am not sure i understand what you mean, sorry.

Stephen

Tom Beauford
2007-07-25, 01:51 PM
Guys,
Can create a new layer with lisp and can select objects using the "ssget x".
In this situation i wish to select everything on the screen so "ssget x" is perfect. "ssget x" creates a selection set of every entity in the drawing. If you want to select everything on the screen here's an old routine for redrawing all the entities on the screen. ; ReView.lsp Regen Current View
(defun C:RV ( / ll ur COUNT ENTITY SET SET_LENGTH)
(setq ll (getvar "TARGET")
vc (getvar "VIEWCTR")
ur
(list
(+(car ll)(*(-(car vc)(car ll))2))
(+(cadr ll)(*(-(cadr vc)(cadr ll))2))
(+(caddr ll)(*(-(caddr vc)(caddr ll))2))
)
SET (ssget "C" ll ur)
SET_LENGTH (sslength SET)
COUNT 0
)
(while (< COUNT SET_LENGTH)
(setq ENTITY (ssname SET COUNT))
(entupd ENTITY)
(setq COUNT (1+ COUNT))
)
(princ)
); end ReView.lsp
Is that what you're looking for? How do i use the two together to select everything and place it on a set layer and colour etc created ?

Stephen What layer and colour etc do you wish to create and set the selection to? Would you mind vlisp?

stephen.coff
2007-07-26, 12:57 AM
Tom,
Thanks heaps. I don't know anything about vlisp and my knowledge of lispis very limited. Below is the layer and colour etc:


(command "-layer" "m" "-M-ARCH" "C" "202"
"-M-ARCH" "Lt" "CONTINUOUS"
"-M-ARCH" "p" "n" "-M-ARCH" ""
)


I wish to grab all of the drawing just opened and place it on the "-M-ARCH" layer.

Stephen

CAB2k
2007-07-26, 05:52 AM
Try this:

(command "-layer" "m" "-M-ARCH" "C" "202"
"-M-ARCH" "Lt" "CONTINUOUS"
"-M-ARCH" "p" "n" "-M-ARCH" ""
)
(setq ss (ssget "_X"))
(Command "_chprop" ss "" "_LA" "-M-ARCH" "")

stephen.coff
2007-07-26, 07:07 AM
CAB2k,
Thank you very much. This looks nice and simple as i thought it should be. I just couldn't work out how to do it.

Stephen