Jump to content

Recommended Posts

Posted (edited)

Hello Guys

I want to make a lisp file for getting command lisp and produce a file with that command as follows :

(defun c:lspfilemake(/ mmm)
(setq mmm (getstring T "lsp command :"))
(setq filename ( strcat mmm ".lsp")
  (setq file (findfile filename))
   (if (not file)
   	(setq file (open filename "w"))
   );if
  (write-line (strcat  "(defun c:" mmm ".lsp" file))
  (close file)
)

its mean that
(c:bb)  ---->> bb.lsp

This is my all my mind about it, for any helping would be appreciated

Edited by hosyn
Posted

Can you describe what do you want to achieve... command functions can't have spaces so (getstring T) is wrong - it should be just (getstring)... But you want to make lsp file that has inside listed strings you input as command functions - "(defun c:" and ".lsp" is wrong then - it should be "(c:" and ")"... And if you want to invoke routine for several inputs, then (open filename "w") should actually be (open filename "a") - "a"-appending...

Posted

Your request does not make much sense why not set up menu etc to pick lisp to run. You could use the multi radio buttons.lsp to have a list of lisp programs to run like Marko can load and run.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...