Jump to content

saveas- how to use?


muthu123

Recommended Posts

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.

Link to comment
Share on other sites

Use the vla-saveas function

 

Thank you Lee.

But what it will do if the file is already exists?

 

Yours,

Muthu.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 11 years later...

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.

 

 

Link to comment
Share on other sites

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 by mhupp
  • Like 1
Link to comment
Share on other sites

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

  • Like 2
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...