Does 'My Folder' exist?


Registered forum members do not see this ad.
Hello,
How to save my dwg to the drive D and to specific folder . for example called My Folder.
Why the above file path is not working ?Code:(setq Fname (getstring T "\n new file name :")) (setq x (strcat "D:\\My Folder\\" Fname ".dwg"))
Thanks
Does 'My Folder' exist?
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper


please post the rest of the code so we can see what's going on


Yes Lee the "My Folder" is already made or existed in drive D.
Mr Johnm. Here are the codes nothings more than that up to this moment .
By Mr Lee 's question, Is it possible also to create a folder before save the dwg and include it within ?Code:(if (and (setq Fname (getstring T "\n new file name :")) (setq x (strcat "D:\\My Folder\\" Fname ".dwg")) ) (command "_.save" x) (princ) )
many thanks for you all.
Perhaps something like this...
Code:(defun c:test ( / dir file ) (setq dir "D:\\My Folder") (vl-mkdir dir) (if (and (vl-file-directory-p dir) (snvalid (setq file (getstring t "\nEnter Filename: "))) ) (vla-saveas (vla-get-ActiveDocument (vlax-get-acad-object)) (strcat dir "\\" file ".dwg") ) ) (princ) )
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper


Thanks Michaels
snvalid checks whether the string is valid for use as a symbol table name, hence it checks for characters such as /\?*" etc - the help files document it better.
(BTW, I updated the code above to include the .dwg extension)
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper


Life doesn't suck, although we all go through periods when it may be easier to think that, than to discern the solution to whatever problem is the most formidable
at the moment in one's personal UCS.
Go to PLAN view instead. - Dadgad
Bookmarks