abra-CAD-abra 发表于 2022-7-5 20:21:07

Save-As with Suffix - I am mis

This should be easy, yet I am clearly missing something simple!!
 

(defun c:test    (/ pathx namex suffx dwgx)   (setvar "CMDECHO" 0)   (setvar "FILEDIA" 0)   (setq pathx (getvar 'dwgprefix))   (setq namex (get-dwgnameonly))   (setq suffx "-Link")      (setq dwgx (strcat (pathx namex suffx ".dwg")))   (command "._saveas" "" dwgx)   (setvar "CMDECHO" 1)   (setvar "FILEDIA" 1)   (princ))(defun get-dwgnameonly ()   (vl-filename-base (getvar 'dwgname))   )
 
I keep getting:
 
error: bad function: "D:\\"
 
Please put me out of my misery
 
Cheers..

Tharwat 发表于 2022-7-5 20:56:16

Just remove the two brackets as shown below .
 

(setq dwgx (strcat (pathx namex suffx ".dwg")))

abra-CAD-abra 发表于 2022-7-5 21:08:49

Thank you Tharwat,
 
It was that easy! I wonder why that is not identified in VLIDE after selecting 'Check Text in Editor'?
 
Thank you for your help.

Tharwat 发表于 2022-7-5 21:22:04

 
You are welcome .
 
Actually it won't give you any error report even if you add more open with close brackets because that is not related to a function. I guess .
页: [1]
查看完整版本: Save-As with Suffix - I am mis