Autocad removes space at end of filename.

Autocad removes space at end of filename.

Anonymous
Not applicable
829 Views
2 Replies
Message 1 of 3

Autocad removes space at end of filename.

Anonymous
Not applicable

I have a lisp routine that works on dwg files, and then saves back as the original file name.

When there is a space at the end of the file name, autocad removes it. This is not acceptable, as it creates 2 files in the folder.

The simple lisp function of 

(command "save" "test  .dwg")

Will save the dwg as "test.dwg". Not acceptable.

Thanks.

0 Likes
830 Views
2 Replies
Replies (2)
Message 2 of 3

Shneuph
Collaborator
Collaborator

Can you use (chr 32) instead of the " " spaces?

 

(command "save" (strcat "test" (chr 32) ".dwg"))

(untested)

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 3 of 3

Anonymous
Not applicable

No luck with that solution.

 

I found a workaround with the  (vla-saveas (vla-get-ActiveDocument (vlax-get-Acad-Object))  "dwgname .dwg")

 

Not great, but it works.

0 Likes