muthu123 Posted July 15, 2010 Share Posted July 15, 2010 Dear friends, How can i saveas the drawing using Vl-fucntion? Note that we have to check before the file name is there or not? Yours, Muthu. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 15, 2010 Share Posted July 15, 2010 Use the vla-saveas function Quote Link to comment Share on other sites More sharing options...
muthu123 Posted July 15, 2010 Author Share Posted July 15, 2010 Use the vla-saveas function Thank you Lee. But what it will do if the file is already exists? Yours, Muthu. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 15, 2010 Share Posted July 15, 2010 But what it will do if the file is already exists? You could use the vla-saveas option in both cases, or just use the vla-save function. eg. (defun save ( doc ) (if (zerop (strlen (vla-get-Fullname doc))) (vla-saveas doc (strcat (vla-get-path doc) (vla-get-name doc))) (vla-save doc) ) ) Or (vla-saveas doc (strcat (getvar 'DWGPREFIX) (getvar 'DWGNAME))) There are many options. Quote Link to comment Share on other sites More sharing options...
rbolton Posted December 10, 2021 Share Posted December 10, 2021 to add to this question -- How do I get the working folder variable for save, open and import to update when I call the Acad save open and import commands? I have a really neat function, but we do alot and alot of browsing for folders during heavy production. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 11, 2021 Share Posted December 11, 2021 Is this what you want ? (getvar 'dwgprefix) 1 Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 11, 2021 Share Posted December 11, 2021 (edited) Well if you do alot of browsing May i suggest this function. May times after opening a drawing I'll close out of explorer. Then find out I need the a spread sheet or some other file also in the project folder. Rather then clicking down the Russian doll like naming convention my business uses for projects. just type DIR and Bam I'm back in the folder. ;;----------------------------------------------------------------------------;; ;; OPEN NEW WINDOWS EXPLORER TO CURRENT DRAWING LOCATION (defun C:DIR () ;old dos command (startapp "explorer" (strcat "/n,/e," (getvar 'dwgprefix))) ) Also suggest to par (getvar 'dwgprefix) with the getfiled function. It gives you the flexibility to change the location if you want. Edited December 11, 2021 by mhupp 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted December 11, 2021 Share Posted December 11, 2021 3 hours ago, mhupp said: Well if you do alot of browsing May i suggest this function. May times after opening a drawing I'll close out of explorer. Then find out I need the a spread sheet or some other file also in the project folder. Rather then clicking down the Russian doll like naming convention my business uses for projects. just type DIR and Bam I'm back in the folder. ;;----------------------------------------------------------------------------;; ;; OPEN NEW WINDOWS EXPLORER TO CURRENT DRAWING LOCATION (defun C:DIR () ;old dos command (startapp "explorer" (strcat "/n,/e," (getvar 'dwgprefix))) ) Also suggest to par (getvar 'dwgprefix) with the getfiled function. It gives you the flexibility to change the location if you want. Also right click on the drawings tab to select "Open File Location". I use both the above DIR command and also right click depends if I have been mostly using the mouse or mostly typing comments at that point 2 Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 11, 2021 Share Posted December 11, 2021 Didn`t know about the right click or been using dir for so long I forgot. 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted December 11, 2021 Share Posted December 11, 2021 I was the same when I read about it too! Quote Link to comment Share on other sites More sharing options...
rbolton Posted December 18, 2021 Share Posted December 18, 2021 great tip thanks. I will use them, but I'm looking for something else. I'd like to get my function to be able to change the working folder as the user operates the function. The first step of the function is to load a step file into a empty .dwg folder, from a user chosen folder. Next the function saves the new drawing to a user chosen folder. And does some work to the result of the import, saving between steps. Some of these steps involve blocking out portions of the .dwg and requires the user to choose filenames for each. Then the finished file is saved out. The challenge is that each time I call the FILED function it always takes the user to my documents. I'd like to be able to have FILED take the user back to the last folder they chose. This would make them only one folder away from where they need to be on our servers t the most. But I can't get FiLED to do this even when providing it with a path. And the WORKINGFOLDER variable doesn't seem to update as the function goes along... Any more tips would be appreciated. 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.