Author Topic: ssget problem  (Read 1717 times)

0 Members and 1 Guest are viewing this topic.

dussla

  • Bull Frog
  • Posts: 297
ssget problem
« on: March 01, 2008, 04:24:23 AM »
hello friend

if you see  lisp file , that is  specific layer move lisp
but  there is problem



(defun c:sa ()
(setq  sela (ssget "x" ) )
(command "change" sela "" "P"  "c" "byBLOCK" "")
(setq  sel (ssget "x" (list (cons 8 (cdr (assoc 8 (entget (car (entsel)))))))) )
(command "change" sel "" "P"  "c" 1 "")
(command "move" sel "")
 
         <----------------   till this  part excute is good
(setq  lla (ssget "x" ) )
(command "change" lla "" "P"  "c" "bylayer" "")   
        <--------------  but this part is  working error   what problem ?

)         





DEVITG

  • Bull Frog
  • Posts: 481
Re: ssget problem
« Reply #1 on: March 01, 2008, 01:53:24 PM »
I think the problem is at the


(command "move" sel "")

because the move command need 2 arguments
the from point and the To point .
Maybe I'm wrong.

Please if error persist , post a copy of your text screen , and if possible the dwg where to apply.


 
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

daron

  • Guest
Re: ssget problem
« Reply #2 on: March 01, 2008, 07:35:46 PM »
No, you're entirely correct, but I have a question? Why dussla, are you changing the props of all items in the drawing, then changing one item, then changing all items again. It seems that all you need to do is select the one item in the ssget, move those objects and then do the ssget "x" to change all objects colors to bylayer. BTW, this might be how you'd do it
Code: [Select]
(defun c:sa ()
    (setq  sel (ssget "x" (list (cons 8 (cdr (assoc 8 (entget (car (entsel)))))))) )
    (command "move" sel "" pause pause)
    (setq  lla (ssget "x" ) )
    (command "change" lla "" "P"  "c" "bylayer" "")
)
or you could flip the last two lines with the first two lines to change the colors to bylayer first, but it really doesn't matter.

dussla

  • Bull Frog
  • Posts: 297
Re: ssget problem
« Reply #3 on: March 01, 2008, 10:30:26 PM »
hi friend ~
i think you are wondering my work process

i am 3d cad  user , i am not  2d plan make user ~
if i got the dwg file from other company , i have to check layer and  clean layer .
so i need rapid layer check or move  routine

can you understand ~~~

daron

  • Guest
Re: ssget problem
« Reply #4 on: March 02, 2008, 03:11:50 AM »
I do, but as a lisp routine will probably move quite fast, you won't even see half the things you're doing happening. If it's needing to see the objects that are moving, you will without changing the colors all to bylayer, then the objects to move to a different color. When the objects are selected they will be highlighted. You will know what's being moved. It'll work either way, I was just offering up an opinion and an option. I can see why you'd work through your process manually, but the way the lisp is set up shows two things: move all objects that reside on a specified layer based on object selection, then change all objects on all layers to bylayer. You seem to be adding more steps than is necessary. Either way, it will work. However, if you aren't really moving the objects, but are selecting them for checking what layer they reside on, you can either use laywalk from express tools, or just change the color of the layer to something that'll really stand out or look into redraw functions in the developer's help file.