TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on February 15, 2006, 09:48:45 AM

Title: Script and Lisp..
Post by: Andrea on February 15, 2006, 09:48:45 AM
hi all...

i'm trying to run a script file....

_.open "C:\drawings\Divers\Centre Multi Fonctionel Boucherville\CMB101.DWG" (load "D:/Andrea/lisp/lisp22 (script file)/Detail Switch Propreties.LSP") _.close
_.open "C:\drawings\Divers\Centre Multi Fonctionel Boucherville\CMB102.DWG" (load "D:/Andrea/lisp/lisp22 (script file)/Detail Switch Propreties.LSP") _.close
_.open "C:\drawings\Divers\Centre Multi Fonctionel Boucherville\CMB103.DWG" (load "D:/Andrea/lisp/lisp22 (script file)/Detail Switch Propreties.LSP") _.close

etc....


and this is my lisp routine:

Code: [Select]
(setvar "TILEMODE" 1)
(setvar "CMDECHO" 1)
(if (not (tblsearch "LAYER" "S-N-DET"))
  (vl-cmdf "_-layer" "_N" "S-N-DET" "")
)
(setvar "LUNITS" 2)
(setvar "LUPREC" 0)
(setvar "CLAYER" "0")
(vl-cmdf "_-layer" "_t" "*" "_ON" "*" "_unlock" "*" "")
(vl-cmdf "_select" "_all" "")
(setq groupsel (ssget "_p"))
 (if groupsel
 (progn
 (setq sscount (sslength groupsel))
 (setq val1 (- sscount 1))
 (repeat sscount
   (setq a1 (entget (ssname groupsel val1)));;détail de l'entité
   (setq Gcolor (cdr (assoc 62 a1)));;Couleur
   (setq Gltype (cdr (assoc 6 a1)));;Type de ligne
   (setq Glayer (cdr (assoc 8 a1)));;Layer
   (if (not Gcolor)(setq Gcolor (cdr (assoc 62 (entget (tblobjname "layer" Glayer))))))
   (if (not Gltype)(setq Gltype (cdr (assoc 6 (entget (tblobjname "layer" Glayer))))))   
      ;; (alert (rtos Gcolor 2 0))
   (vl-cmdf "_chprop" (cdar a1) "" "_C" (rtos Gcolor 2 0) "_LT" Gltype "")
;;;   (setq Gcolor nil
;;;  Gltype nil)
   (setq val1 (- val1 1))
 )))
(vl-cmdf "_chprop" "_all" "" "_LA" "S-N-DET" "")
;;ZOOM EXTEND
(vl-cmdf "_regenauto" "_OFF" "_zoom" "_e" "_qsave")(princ)


This seem to work well...
but don't know how....sometime the script stop before the end...
need to restart the script..to continue...

any idea why ?
Title: Re: Script and Lisp..
Post by: Kerry on February 15, 2006, 06:34:00 PM
If the stoppage is intermittent then there is possibly a variance in variable values or properties that you haven't made allowance for.
You have CMDECHO on ... what is displayed on the command line when it stops. ?

You could add different prompt statements at intervals to give you a visual marker of progress through the file .. that is a fairly common bebugging technique.
Title: Re: Script and Lisp..
Post by: Andrea on February 15, 2006, 08:49:09 PM
If the stoppage is intermittent then there is possibly a variance in variable values or properties that you haven't made allowance for.
You have CMDECHO on ... what is displayed on the command line when it stops. ?

You could add different prompt statements at intervals to give you a visual marker of progress through the file .. that is a fairly common bebugging technique.


thanks Kerry,
But there is no error message and all steps follow the questions.
I have put the CMDECHO to see.....but nothin..

also, i have put many alert messages box...if not a string..if variable nil etc...
but all work properly.

the program stop at the end of lisp.....It did not make a _OPEN command again.
but dont k'now why...

I also verified the EXPERT mode....

I have thaw the possibilities in a read-only file....but was not.
a possibilities of a currupt file.....but nope !
a possibilities of xref, image, ole object......but...nothing..
I simply run the script for a simple details.

otherwise......why it work when i run the program again ?
hmmm.... :|
Title: Re: Script and Lisp..
Post by: Kerry on February 15, 2006, 09:09:33 PM

i'm trying to run a script file....
.....

This seem to work well...
but don't know how....sometime the script stop before the end...
need to restart the script..to continue...

any idea why ?
.....
the program stop at the end of lisp.....It did not make a _OPEN command again.
but dont k'now why...

....

Seems like 2 different stories .. may be 2 issues ?
Title: Re: Script and Lisp..
Post by: Amsterdammed on February 16, 2006, 08:43:14 AM
Andrea,
i can't help you with your lisp right now, but there is a command called "resume" which lets you go on with a script where it stopped due to error.

Bernd
Title: Re: Script and Lisp..
Post by: Andrea on February 16, 2006, 11:14:23 AM

i'm trying to run a script file....
.....

This seem to work well...
but don't know how....sometime the script stop before the end...
need to restart the script..to continue...

any idea why ?
.....
the program stop at the end of lisp.....It did not make a _OPEN command again.
but dont k'now why...

....

Seems like 2 different stories .. may be 2 issues ?

euh.....nope..
same issues.....same stories. :?