Hi,
I'm try to write a list to produce a script file!
I just want to insert a dwg file in current drawing.
back to MS Windows, in case of having [space] in a folder's name, we should use "" marks:
CD "Program Files"; DEL "file 10.txt"; ....
I tried both with and without "" marks but I failed!
I pasted part of my code below with result of each case:
---------------- FIRST TRY: without "" marks-----------------------------------
(setq TBFile "H:\z.autocad\A1 A2 A3.dwg")
(write-line "-INSERT" des)
(write-line (strcat "*" TBFile) des); ; *H:\z.autocad\A1 A2 A3.dwg <<=should be this
(write-line "0,0" des);;insert point
(write-line "1" des);;xyz scale
(write-line "0" des);;rotation
;;after script running:
Command: -INSERT
Enter block name or [?]: *H:\z.autocad\A1 <<<=== truncate filename!
"A1.dwg": Can't find file in search path
---------------- SECOND TRY: with "" marks ------------------------------------
(setq TBFile "H:\z.autocad\A1 A2 A3.dwg")
(write-line "-INSERT" des)
(write-line (strcat "*" (strcat "\"" TBFile "\"")) des); *"H:\z.autocad\A1 A2 A3.dwg" <<=should be this
(write-line "0,0" des);;insert point
(write-line "1" des);;xyz scale
(write-line "0" des);;rotation
;;after script running:
Command: -INSERT
Enter block name or [?]: *"H:\z.autocad\A1 <<<=== truncate filename also!
""H:\z.autocad\A1.dwg": Invalid file name.
*Invalid*
-----------------------------------------------------------------------------
Please help me!
Thanks,
Solved! Go to Solution.
Solved by aqdam1978. Go to Solution.
Solved by pbejse. Go to Solution.
Not sure, but did you try wraqpping the filepath with a double quote ""
(setq TBFile "H:\\z.autocad\\A1 A2 A3.dwg")
(write-line (strcat "\"*" TBFile "\"") des)
I'm not really a big fan os script 🙂
Hello
If possible when I run Scripts on many DWGs, I try to have my DWGs files
inside Pathes without any special chars (please no space/blank) !
With this constraint, Script Files are easier to write and test ...
Bye, Patrice
Patrice BRAUD
ReHello
And of course no special chars (no space/blank) inside filenames !
And the life (with ACAD, Scripts, Lisp, etc) is better and easier ...
Bye, Patrice
Patrice BRAUD
Hi,
this scrip is ok:
---------------------
-INSERT
"*C:\Users\aaqdam\Desktop\A1 A2 A3.dwg"
0,0
1
0
-------------------
Thanks for your help.
Can't find what you're looking for? Ask the community or share your knowledge.