mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-09 14:41:37 +00:00
31 lines
3.2 KiB
Plaintext
31 lines
3.2 KiB
Plaintext
{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052\deftab420{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}}
|
|
{\info{\horzdoc}{\*\lchars (.<?[\'7b\'ab\'b7\'91\'93}{\*\fchars !"'),.:\'3b>?]`|\'7d~\'a8\'af\'b7\'bb\'92\'94\'85}}
|
|
\viewkind4\uc1\pard\ltrpar\nowidctlpar\qj\kerning2\b\f0\fs20 Application:\b0 CancelSave\line\b Revit Platform:\b0 All\line\b Revit Version:\b0 2011.0\line\b First Released For:\b0 2010.0\line\b Programming Language:\b0 C#\line\b Skill Level:\b0 Beginning\line\b Category:\b0 Basics\line\b Type:\b0 ExternalApplication\line\line\b Subject:\b0 Cancel document save process\line\b Summary:\b0 \line This sample demonstrates how to cancel the document save process through DocumentSaving / DocumentSavingAs event\rquote s arguments.\par
|
|
\b\par
|
|
Classes: \par
|
|
\pard\ltrpar\nowidctlpar\fi360\qj\b0 Autodesk.Revit.UI.IExternalApplication\par
|
|
Autodesk.Revit.ApplicationServices.ControlledApplication \par
|
|
Autodesk.Revit.DB.ProjectInfo\par
|
|
\par
|
|
\pard\ltrpar\nowidctlpar\qj\b Project Files: \par
|
|
\b0 CancelSave.cs\par
|
|
\pard\ltrpar\nowidctlpar\li359\qj This file contains one class CancelSave which implements IExternalApplication interface. And it checks \ldblquote Project Status\rdblquote value once user saves the project. If the value has been updated accept the save else cancel the save and inform user.\par
|
|
\pard\ltrpar\nowidctlpar\qj\par
|
|
LogManager.cs\par
|
|
\pard\ltrpar\nowidctlpar\li359\qj This file contains one class LogManager in which one log file will be created for tracking events raise.\par
|
|
\par
|
|
\pard\ltrpar\nowidctlpar\qj\b Description:\b0 \par
|
|
\pard\ltrpar\nowidctlpar\fi1\qj The \ldblquote Project Status\rdblquote in Project Information dialog must be updated once the project is saved, else cancel the save and inform user. This sample shows how to implement this through API event mechanism.\par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li360\kerning0 -\tab Through DocumentOpened and DocumentCreated events, this sample reserves original Project Status value once user finished opening or creating a project.\par
|
|
-\tab Through DocumentSaving and DocumentSavingAs, this sample compares current Project Status value with the original value. If they are same cancel the save and inform user by a messageBox else pass the save and update the original value to prepare for next save.\par
|
|
\pard\ltrpar\nowidctlpar\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2\b Instructions:\b0 \par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li360\tx360 1.\tab Open Revit.exe\par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li360 2.\tab Create one project in Revit UI and then save it (because the project status wasn\rquote t updated, the save will be cancelled).\par
|
|
3.\tab Run menu command Setting\\Project Information, and then update project status in that dialog and click OK button to save the update.\par
|
|
\pard\ltrpar\nowidctlpar\fi-720\li720\tx360 4.\tab SaveAs this project (because the project status was updated, the save is allowed).\par
|
|
\pard\ltrpar\nowidctlpar\fs21\par
|
|
\pard\ltrpar\nowidctlpar\qj\b\fs20 Note:\par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li360\tx360\b0 1.\tab Because Family document doesn\rquote t support Project Information, this sample should not run on Family document.\fs21\par
|
|
}
|
|
|