Code Red > AutoLISP (Vanilla / Visual)

Trying to get filename to use but there is error

(1/2) > >>

HasanCAD:
I am trying to use file name as a prefix but when press enter result is not the filename

Thanks


--- Code - Auto/Visual Lisp: ---(setq filepath (getvar "dwgname"))(setq filename (VL-FILENAME-BASE filepath)) (setq fileprefix       (cond ((getstring (strcat "\nEnter filename prefix: < "                                 (setq fileprefix                                        (cond (fileprefix)                                              (filename)                                        )                                 )                                 " >?: "                         )              )             )             (fileprefix)       ))

The result is

--- Quote ---""
--- End quote ---

Keith™:
Check DWGTITLED
If it is 0 no path is included in DWGNAME

Dlanor:
Your condition (cond) is incorrect

Perhaps

--- Code - Auto/Visual Lisp: ---     (setq filepath (getvar "dwgname"))    (setq filename (VL-FILENAME-BASE filepath))         (setq fileprefix      (cond ( (getstring (strcat "\nEnter filename prefix: < " (setq fileprefix (if (not fileprefix) filename)) " >?: ")))            (t fileprefix)      )    )   

HasanCAD:
Thanks Keith

Thanks Dlaner but gives the same result
In command line shows the filename but when click Enter gives this

--- Code: ---"222-Layout2.dwg"
"222-Layout2"
""
--- End code ---

Dlanor:
What are you expecting to get?

Navigation

[0] Message Index

[#] Next page

Go to full version