| Author |
Message |
Kiwi Russ
Guest
|
Posted:
Mon Dec 20, 2004 11:18 am Post subject:
string within string |
|
|
Hi
I'm trying to write a few lines of code to make a fas file. The problem
is the names lisp must have quotation marks around it. How would I insert
these so that it can then inserted onto the command line?
Thanks Russ
(defun C:makefas( / lispname)
(setq lispname (getstring "\nName of lisp : "))
(setq lispname (strcat lispname ".lsp"))
(princ (strcat "(vlisp-compile 'st " lispname ")"))
(princ)
);defun
|
|
| Back to top |
|
 |
Rob Taylor
Guest
|
Posted:
Mon Dec 20, 2004 4:02 pm Post subject:
Re: string within string |
|
|
use \"
(princ (strcat "(vlisp-compile 'st \"" lispname "\")")) |
|
| Back to top |
|
 |
Kiwi Russ
Guest
|
Posted:
Tue Dec 21, 2004 12:34 pm Post subject:
Re: string within string |
|
|
Thanks Rob that did that trick.
However I have another problem my lisp prints the correct notation in the
command line but does not want to make a fas file, and I'm not sure why? Any
ideas anyone?
thanks Russ
This is what I have so far.......
(defun C:makefas( / lispname)
(setq lispname (getstring "\nName of lisp : "))
(setq lispname (strcat lispname ".lsp"))
(princ (strcat "Command:(vlisp-compile 'st \"" lispname "\")"))
(princ)
);defun
"Rob Taylor" <nospam@address.withheld> wrote in message
news:30228426.1103540602907.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | use \"
(princ (strcat "(vlisp-compile 'st \"" lispname "\")")) |
|
|
| Back to top |
|
 |
Jeff Mishler
Guest
|
Posted:
Tue Dec 21, 2004 12:51 pm Post subject:
Re: string within string |
|
|
Check what you are having it do.....as it is, you are only printing to the
command line a string that looks like the result you want....but this works,
providing the lisp is in the support path.
(defun C:makefas( / lispname)
(setq lispname (getstring "\nName of lisp : "))
(setq lispname (strcat lispname ".lsp"))
(vlisp-compile 'st lispname )
(princ)
);defun
--
Jeff
check out www.cadvault.com
"Kiwi Russ" <russell@pl.net> wrote in message news:41c7d21b_1@newsprd01...
| Quote: | Thanks Rob that did that trick.
However I have another problem my lisp prints the correct notation in the
command line but does not want to make a fas file, and I'm not sure why?
Any ideas anyone?
thanks Russ
This is what I have so far.......
(defun C:makefas( / lispname)
(setq lispname (getstring "\nName of lisp : "))
(setq lispname (strcat lispname ".lsp"))
(princ (strcat "Command:(vlisp-compile 'st \"" lispname "\")"))
(princ)
);defun
"Rob Taylor" <nospam@address.withheld> wrote in message
news:30228426.1103540602907.JavaMail.jive@jiveforum2.autodesk.com...
use \"
(princ (strcat "(vlisp-compile 'st \"" lispname "\")"))
|
|
|
| Back to top |
|
 |
Kiwi Russ
Guest
|
Posted:
Tue Dec 21, 2004 2:20 pm Post subject:
Re: string within string |
|
|
Jeff
perfect that works!!!
many thanks
Russ
"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:41c7d5ff$1_3@newsprd01...
| Quote: | Check what you are having it do.....as it is, you are only printing to the
command line a string that looks like the result you want....but this
works, providing the lisp is in the support path.
(defun C:makefas( / lispname)
(setq lispname (getstring "\nName of lisp : "))
(setq lispname (strcat lispname ".lsp"))
(vlisp-compile 'st lispname )
(princ)
);defun
--
Jeff
check out www.cadvault.com
"Kiwi Russ" <russell@pl.net> wrote in message news:41c7d21b_1@newsprd01...
Thanks Rob that did that trick.
However I have another problem my lisp prints the correct notation in the
command line but does not want to make a fas file, and I'm not sure why?
Any ideas anyone?
thanks Russ
This is what I have so far.......
(defun C:makefas( / lispname)
(setq lispname (getstring "\nName of lisp : "))
(setq lispname (strcat lispname ".lsp"))
(princ (strcat "Command:(vlisp-compile 'st \"" lispname "\")"))
(princ)
);defun
"Rob Taylor" <nospam@address.withheld> wrote in message
news:30228426.1103540602907.JavaMail.jive@jiveforum2.autodesk.com...
use \"
(princ (strcat "(vlisp-compile 'st \"" lispname "\")"))
|
|
|
| Back to top |
|
 |
Kiwi Russ
Guest
|
Posted:
Tue Dec 21, 2004 2:38 pm Post subject:
Re: string within string |
|
|
One last question anyone :
If the lisp does not lie in the support path then I get an error message.
How would I add some code to turn the below message into an alert box
message?
; *** ERROR Cannot find file test.lsp
thanks |
|
| Back to top |
|
 |
Rob Taylor
Guest
|
Posted:
Tue Dec 21, 2004 3:24 pm Post subject:
Re: string within string |
|
|
use the findfile function like this
(defun C:makefas( / ); lispname)
(setq lispname (getstring "\nName of lisp : "))
(if (findfile (strcat lispname ".lsp"))
(vlisp-compile 'st lispname )
(alert (strcat lispname " Not Found.."))
)
(princ)
);defun |
|
| Back to top |
|
 |
Marc'Antonio Alessi
Guest
|
Posted:
Tue Dec 21, 2004 9:39 pm Post subject:
Re: string within string |
|
|
I use this, there are some problems switching the
Vlide and AutoCAD window, maybe somebody can
help me and you.
Cheers.
; Marc'Antonio Alessi - http://xoomer.virgilio.it/alessi
; Function: C:ALE_LispComp
;
; Note: require DOSLIB
;
; Description: compile a list of selected files
;
; Arguments: none
;
; modify these to your own use:
;
; (getcfg "AppData/Custom/LispSorg")
; (setcfg "AppData/Custom/LispSorg")
;
(defun C:ALE_LispComp ( / CfgPat FilLst FilPat)
(if
(or
(= "" (setq CfgPat (getcfg "AppData/Custom/LispSorg")))
(null CfgPat)
(null (vl-file-directory-p CfgPat))
)
(setcfg "AppData/Asso/LispSorg" (setq CfgPat (dos_pwdir)))
)
(if
(setq FilLst
(dos_getfilem
"Files to compile" CfgPat
"Lisp files (*.lsp;*.fas)|*.lsp;*.fas|All Files (*.*)|*.*"
); I use this filter to see the last compiled FAS
)
(progn
(C:VLISP)
(setq FilPat (car FilLst) FilLst (cdr FilLst))
(or
(= CfgPat FilPat)
(setcfg "AppData/Custom/LispSorg" FilPat)
)
(foreach file FilLst
(vlisp-compile 'st (strcat FilPat file))
)
)
)
(princ)
) |
|
| Back to top |
|
 |
Kiwi Russ
Guest
|
Posted:
Wed Dec 22, 2004 1:52 pm Post subject:
Re: string within string |
|
|
Thanks once again Rob! :-)
Russ
"Rob Taylor" <nospam@address.withheld> wrote in message
news:32132866.1103624694911.JavaMail.jive@jiveforum1.autodesk.com...
| Quote: | use the findfile function like this
(defun C:makefas( / ); lispname)
(setq lispname (getstring "\nName of lisp : "))
(if (findfile (strcat lispname ".lsp"))
(vlisp-compile 'st lispname )
(alert (strcat lispname " Not Found.."))
)
(princ)
);defun |
|
|
| Back to top |
|
 |
Kiwi Russ
Guest
|
Posted:
Wed Dec 22, 2004 1:55 pm Post subject:
Re: string within string |
|
|
Thanks Marc
thats an interesting mutiple compiler. getcfg and setcfg I am not familar
with - I must read up about it.
cheers Russ
"Marc'Antonio Alessi" <nospam maalessi at tin dot it> wrote in message
news:41c8532f_1@newsprd01...
| Quote: | I use this, there are some problems switching the
Vlide and AutoCAD window, maybe somebody can
help me and you.
Cheers.
; Marc'Antonio Alessi - http://xoomer.virgilio.it/alessi
; Function: C:ALE_LispComp
;
; Note: require DOSLIB
;
; Description: compile a list of selected files
;
; Arguments: none
;
; modify these to your own use:
;
; (getcfg "AppData/Custom/LispSorg")
; (setcfg "AppData/Custom/LispSorg")
;
(defun C:ALE_LispComp ( / CfgPat FilLst FilPat)
(if
(or
(= "" (setq CfgPat (getcfg "AppData/Custom/LispSorg"))) (null CfgPat)
(null (vl-file-directory-p CfgPat))
)
(setcfg "AppData/Asso/LispSorg" (setq CfgPat (dos_pwdir)))
)
(if
(setq FilLst
(dos_getfilem
"Files to compile" CfgPat
"Lisp files (*.lsp;*.fas)|*.lsp;*.fas|All Files (*.*)|*.*"
); I use this filter to see the last compiled FAS
)
(progn
(C:VLISP)
(setq FilPat (car FilLst) FilLst (cdr FilLst))
(or
(= CfgPat FilPat)
(setcfg "AppData/Custom/LispSorg" FilPat)
)
(foreach file FilLst
(vlisp-compile 'st (strcat FilPat file)) )
)
)
(princ)
)
|
|
|
| Back to top |
|
 |
Rob Taylor
Guest
|
Posted:
Wed Dec 22, 2004 5:19 pm Post subject:
Re: string within string |
|
|
Your welcome Russ.
I find these forums very useful
and now I have a makefas routine
aswell :)
Merry Xmas All!
Aussie Rob ;) |
|
| Back to top |
|
 |
|
|
|
|