Author Topic: Save Drawing  (Read 7165 times)

0 Members and 1 Guest are viewing this topic.

A_LOTA_NOTA

  • Guest
Save Drawing
« on: August 17, 2007, 09:44:00 AM »
Is it possible to call the “SAVEAS” dialogue?

I’ve got a situation where I want to get the drawing name. So I want to test to make sure the drawing has been saved first. If not I would like to “SAVEAS” then get the drawing name.

Thanks

Guest

  • Guest
Re: Save Drawing
« Reply #1 on: August 17, 2007, 09:50:29 AM »
(getvar "DWGTITLED")

If it = 0, the drawing hasn't been saved yet.
It if = 1, the drawing has already been saved.

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #2 on: August 17, 2007, 09:57:48 AM »
(getvar "DWGTITLED")

If it = 0, the drawing hasn't been saved yet.
It if = 1, the drawing has already been saved.

Thanks Matt but I knew that much. What I'm having a problem with it the "SAVEAS" part. If I just do a "Command SAVEAS" the user is not given a dialog box. I would like the "SAVEAS" dialog box to be displayed!
« Last Edit: August 17, 2007, 10:47:34 AM by A_LOTA_NOTA »

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Save Drawing
« Reply #3 on: August 17, 2007, 10:00:29 AM »
Look at (setvar 'filedia 1)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #4 on: August 17, 2007, 10:04:29 AM »
Look at (setvar 'filedia 1)

It's set to 1!

Guest

  • Guest
Re: Save Drawing
« Reply #5 on: August 17, 2007, 10:11:52 AM »
So what exactly is happening when the user does a SAVEAS?

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #6 on: August 17, 2007, 10:34:40 AM »
So what exactly is happening when the user does a SAVEAS?

If I click on "File" then "SAVEAS" everything works fine! But if I add (command ".SAVEAS") to my code it doesn't give a dialog box. So I thought I must be coding it wrong.
« Last Edit: August 17, 2007, 10:47:57 AM by A_LOTA_NOTA »

Guest

  • Guest
Re: Save Drawing
« Reply #7 on: August 17, 2007, 10:38:30 AM »
Is filedia set to 0 somewhere in your code prior to the saveas?

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #8 on: August 17, 2007, 10:44:00 AM »
No, I can have

Code: [Select]
(defun c:TEST ()
  (setvar 'filedia 1)
  (command ".SAVEAS")
  )

& I still get the command line version!

Willie

  • Swamp Rat
  • Posts: 958
  • Going nowhere slowly
Re: Save Drawing
« Reply #9 on: August 17, 2007, 10:47:56 AM »
Try


(defun c:TEST ()
  (initdia)
  (command ".SAVEAS")
  )
Soli Deo Gloria | Qui Audet Adipiscitur
Windows 8  64-bit Enterprise | Civil 3D 2015 and 2016| ArcGIS 10.1
Yogi Berra : "I'd give my right arm to be ambidextrous."

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #10 on: August 17, 2007, 10:49:15 AM »
Try


(defun c:TEST ()
  (initdia)
  (command ".SAVEAS")
  )

That did it!! Thanks everyone!!!!

Guest

  • Guest
Re: Save Drawing
« Reply #11 on: August 17, 2007, 10:49:24 AM »
No, I can have

Code: [Select]
(defun c:TEST ()
  (setvar 'filedia 1)
  (command ".SAVEAS")
  )

& I still get the command line version!

Part of the problem is with the second line of code...

(setvar 'filedia 1) should be (setvar "filedia" 1)

Notice the quotes. . . . . . . . . . . . .^ ^ ^

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #12 on: August 17, 2007, 10:58:51 AM »
No, I can have

Code: [Select]
(defun c:TEST ()
  (setvar 'filedia 1)
  (command ".SAVEAS")
  )

& I still get the command line version!

Part of the problem is with the second line of code...

(setvar 'filedia 1) should be (setvar "filedia" 1)

Notice the quotes. . . . . . . . . . . . .^ ^ ^

Try it my way, I think you will get the same results!

Willie fixed my problem.

Guest

  • Guest
Re: Save Drawing
« Reply #13 on: August 17, 2007, 11:02:15 AM »
No, I can have

Code: [Select]
(defun c:TEST ()
  (setvar 'filedia 1)
  (command ".SAVEAS")
  )

& I still get the command line version!

Part of the problem is with the second line of code...

(setvar 'filedia 1) should be (setvar "filedia" 1)

Notice the quotes. . . . . . . . . . . . .^ ^ ^

Try it my way, I think you will get the same results!

Willie fixed my problem.

Huh... no $*#%.  I never knew that nor have I ever seen it done that way (until today).

Cool.

A_LOTA_NOTA

  • Guest
Re: Save Drawing
« Reply #14 on: August 17, 2007, 11:16:12 AM »
No, I can have

Code: [Select]
(defun c:TEST ()
  (setvar 'filedia 1)
  (command ".SAVEAS")
  )

& I still get the command line version!

Part of the problem is with the second line of code...

(setvar 'filedia 1) should be (setvar "filedia" 1)

Notice the quotes. . . . . . . . . . . . .^ ^ ^

Try it my way, I think you will get the same results!

Willie fixed my problem.

Huh... no $*#%.  I never knew that nor have I ever seen it done that way (until today).

Cool.

Only saves one key stroke but I like it better!
« Last Edit: August 17, 2007, 11:19:19 AM by A_LOTA_NOTA »