ksperopoulos Posted July 21, 2011 Share Posted July 21, 2011 I am trying to learn lisp and write a lisp that will take whatever current drawing file I have open and save it automatically to a different location on our server after I run the lisp. I have looked through the AutoCad lisp tutorial on how to get the name of the current drawing file, but I am unsure what I need to use. Is it "vl-filename-base"? Thanks for any help you can give me. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 21, 2011 Share Posted July 21, 2011 Current Drawing: (getvar 'DWGNAME) Current Drawing Path: (getvar 'DWGPREFIX) Current Drawing Filepath: (strcat (getvar 'DWGPREFIX) (getvar 'DWGNAME)) Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted July 21, 2011 Author Share Posted July 21, 2011 (edited) Thanks Lee Mac! I tried using this but it isn't working right just yet. It saves a file to the location I want to put it in, but it is giving it an incorrect filename. This is what I have: (SETQ FILENAME (GETVAR 'DWGNAME)) (COMMAND "_SAVEAS" "2010" "N:/Projects/Contractors/Ft. Benning Martin Army Hospital/VDC/09-Other Files/Upload Folder/FILENAME") I tried modifying this to: (SETQ FILENAME (GETVAR 'DWGNAME)) (COMMAND "_SAVEAS" "2010" "N:/Projects/Contractors/Ft. Benning Martin Army Hospital/VDC/09-Other Files/Upload Folder/[color="red"]" FILENAME[/color]) but that didn't work either. I just can't seem to figure out how to get the value to return as the value to name the new file. What am I doing wrong? Edited July 21, 2011 by ksperopoulos Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 21, 2011 Share Posted July 21, 2011 Please read the CODE POSTIN GUIDELINES!!!!! Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted July 21, 2011 Author Share Posted July 21, 2011 Sorry. Fixed it. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 21, 2011 Share Posted July 21, 2011 (edited) First I think you can not save as your current drawing to 2010 since you are using 2009 .:wink: Try this . (SETQ FILENAME (GETVAR 'DWGNAME)) (COMMAND "_SAVEAS" "2010" (strcat "N:\\Projects\\Contractors\\Ft. Benning Martin Army Hospital\\VDC\\09-Other Files\\Upload Folder\\" FILENAME)) Edited July 21, 2011 by Tharwat EDIT : strcat added Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted July 21, 2011 Author Share Posted July 21, 2011 Oops! I haven't updated my profile in a while. We are actually on 2011. I wish that was my problem. That would be an easy fix. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 21, 2011 Share Posted July 21, 2011 Sorry. Fixed it. Thank you, very much. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 21, 2011 Share Posted July 21, 2011 Hint: Take a look at how I have used the strcat function in my first post. :wink: Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted July 21, 2011 Author Share Posted July 21, 2011 I think I finally got it. It put the file (with the correct file name) in the correct folder. Is this how it should look? (COMMAND "_SAVEAS" "2010" (STRCAT "N:/Projects/Contractors/Ft. Benning Martin Army Hospital/VDC/09-Other Files/Upload Folder/" (GETVAR 'DWGNAME))) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.