Author Topic: Getting commands to work in a sequence  (Read 2072 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Getting commands to work in a sequence
« on: February 16, 2005, 11:26:52 AM »
I have some commands which i took from the mns file:

^C^C^C^P(ad_mnl)(zz_sdsk '(f:adcmds 34));LDD
^C^C^C^P(cd_mnl)(zz_sdsk '(ad_dft 0 4));LDD
^C^C^C^P(cd_mnl)(zz_sdsk '(progn (setq z:n 1)(load2 "ad" "profile")));LDD
^C^C^C^P(pw_chk)(dt_chk)(zz_sdsk '(pw_run_cmd 8));LDD
^C^C^C^P(pw_chk)(dt_chk)(hd_chk)(zz_sdsk '(pw_run_cmd 6));LDD
^C^C^C^P(pw_chk)(zz_sdsk '(pw_plfinish));LDD
^C^C^C^P(pw_chk)(zz_sdsk '(pw_prfinish));LDD

I want to get them to be in a scr or lsp so when i start it, it takes me through all these commands.

All though, in each command there are other steps i need to do.
but after i get the first commands done, it takes me to the next step which is the next command...

what do you recommend on this?

thanks!
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Getting commands to work in a sequence
« Reply #1 on: February 16, 2005, 12:17:56 PM »
You need to work through each sequence by putting each line in a lisp and testing it
to see if additional input or error handling is needed.

Basically any command in the menu or button can be used in a lisp by wrapping it with
Code: [Select]
(command <what you would type> <responses to the prompts>)
In you're case the first line is
Code: [Select]
^C^C^C^P(ad_mnl)(zz_sdsk '(f:adcmds 34));LDD
so the first two are calls to a lisp routine. Do a test like this:
Code: [Select]
(defun c:test()
   ;;  first two items look like they do not require user input
  (ad_mnl) ; what does this do?
  (zz_sdsk '(f:adcmds 34))
  ;;  this LDD is a command
  (command "LDD")
 )

 
A lisp terminate with a command active and the user interacts with the active command.
If this is the case you may want to control that.
In that you want to move on to other functions and not terminate the lisp, you will certainly
have to deal with the user interaction with the command LDD.

Do this for each line from the menu & when each test lisp if complete you can then combine
then into one lisp.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Getting commands to work in a sequence
« Reply #2 on: February 16, 2005, 12:49:56 PM »
ill try it out cab... ill post here shortly

thxs:)
Civil3D 2020