.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 2
mahepriya
389 Views, 1 Reply

SaveAs Event

Hi,

I want to cancel the "saveas" event through my code in vb.net. I am capturing the "saveas" event when user fires the "saveas" command and througgh my coding I am showing a saveas dialog with the name of the file of my choice and if he clicks Save button I am saving that dwg. But after this save again the save as dialog appears and also when I select Cancel button. Any idea how to achieve this task? In short what I want to do is in the "save as" dialog I want set the name of the file of my choice through coding and save it with that name.
I am using AutoCAD 2008 and vb.net.

Thanks in advance.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: mahepriya

You can't stop a command from running using the CommandWillStart event.

You can try handling the DocumentCollection's DocumentLockModeChanged event, and if the GlobalCommandName property of the event arguments is "SAVEAS", then call the Veto() method of the event arguments.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5883753@discussion.autodesk.com...
Hi,

I want to cancel the "saveas" event through my code in vb.net. I am capturing the "saveas" event when user fires the "saveas" command and througgh my coding I am showing a saveas dialog with the name of the file of my choice and if he clicks Save button I am saving that dwg. But after this save again the save as dialog appears and also when I select Cancel button. Any idea how to achieve this task? In short what I want to do is in the "save as" dialog I want set the name of the file of my choice through coding and save it with that name.
I am using AutoCAD 2008 and vb.net.

Thanks in advance.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost