TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: w64bit on May 09, 2021, 08:37:18 AM
-
I use this code for some DWGs but sometimes it stops.
Can anyone tell me what I have to add to make it working?
Thank you
(foreach tab (layoutlist) (setvar 'CTAB lay) (if (setq selblk (ssget "_X" '((0 . "INSERT"))))(command "_DRAWORDER" selblk "" "_BACK")))
-
I don't know where the problem lies, but personaly I'd do it this way...
(foreach tab (layoutlist) (if (setq selblk (ssget "_X" (list '(0 . "INSERT") (cons 410 tab))))(command "_DRAWORDER" selblk "" "_BACK")))
-
The code stops on several drawings with:
Select objects: 4 found
4 were not in current space.
Select objects:
Command: _BACK Unknown command "BACK".
-
(foreach tab (layoutlist) (setvar 'CTAB tab) (if (setq selblk (ssget "_X" (list '(0 . "INSERT") (cons 410 tab))))(command "_DRAWORDER" selblk "" "_BACK")))
-
Yes. Yes. Yes.
Thank you very much.
-
Prego :)
-
For what it's worth, if you were to download & load my set of Draw Order Functions (http://lee-mac.com/draworderfunctions.html), you can use the following program to achieve the same result without the need to switch the active layout:
(LM:movetobottom
(ssget "_X" (list '
(0 .
"INSERT") (cons 410 tab
)))) )
)
-
Please correct me if I am wrong, but shouldn't ssget "_X" be able to select everything in the entire drawing if you don't use (cons 410 tab) ?
Or is this a case where you only want to select these objects if they are in paperspace, but not modelspace?
-
Please correct me if I am wrong, but shouldn't ssget "_X" be able to select everything in the entire drawing if you don't use (cons 410 tab) ?
Or is this a case where you only want to select these objects if they are in paperspace, but not modelspace?
That is correct but most likely a limitation of the command call.
-
Please correct me if I am wrong, but shouldn't ssget "_X" be able to select everything in the entire drawing if you don't use (cons 410 tab) ?
Or is this a case where you only want to select these objects if they are in paperspace, but not modelspace?
As Ron wrote: That is correct but most likely a limitation of the command call.
See replay #2
Select objects: 4 found
4 were not in current space.
Select objects:
Command: _BACK Unknown command "BACK".
-
I believe that the draworder can be set using activex calls, can't it?
-
I believe that the draworder can be set using activex calls, can't it?
Yes .. that was Lee's contribution :)
http://www.theswamp.org/index.php?topic=56731.msg604592#msg604592
-
Ah, I missed that one, leave it to him to beat me to it.