mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-18 19:30:09 +00:00
35 lines
3.4 KiB
Plaintext
35 lines
3.4 KiB
Plaintext
{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fnil\fprq2\fcharset2 Wingdings;}}
|
|
{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}
|
|
\viewkind4\uc1\pard\ltrpar\b\f0\fs20 Application\b0 : AutoUpdate\f1\line\b\f0 Revit Platform\b0 : All\line\b Revit Version\b0 : 2010.0\f1\line\b\f0 First Released For\b0 : 2010\f1 .0\line\b\f0 Last Modified\b0 : 09/11/2008\line\b Modified By\b0 : EZ Autodesk\line\b Programming Language\b0 : C#\line\b Skill Level\b0 : Medium\line\b Category\b0 : Basics\f1\line\b\f0 Type\b0 : ExternalApplication\f1\line\line\b\f0 Subject:\b0 Auto-update Revit model after document is opened\f1 .\line\b\f0 Summary\b0 :\cf1 \line\cf0 This sample demonstrates how to subscribe DocumentOpened event and modify model in event handler in the event handler method.\f1\par
|
|
\b\f0\par
|
|
Classes:\b0 \f1\par
|
|
\pard\ltrpar\fi180\li180\lang1036\f0 Autodesk.Revit.IExternalApplication \par
|
|
Autodesk.Revit.Events.DocumentOpenedArgs\par
|
|
\pard\ltrpar\lang1033\par
|
|
\b Project Files:\b0 \f1\par
|
|
\f0 ExternalApplication.cs\par
|
|
\pard\ltrpar\li180\lang1036 This file contains a class Application which implements IExternalApplcation interface. The OnStartUp method will register DocumentOpened event when Revit starts. We just demonstrate changing the ProjectInformation.Address property, but user can do other modification for current project, like deleting, creating, etc.\f1\par
|
|
\pard\ltrpar\lang1033\par
|
|
\b\f0 Description:\b0 \f1\par
|
|
\f0 The sample implements IExternalApplication interface and provides the following functionalities:\f1\par
|
|
\pard\ltrpar\fi-420\li420\f0 -\tab There is no UI provided for user, the sample will subscribe event handlers to DocumentOpened event and the string \ldblquote United States-Massachusetts - Waltham - 610 Lincoln St\rdblquote will be assigned to ProjectInformation.Address property as the new address.\par
|
|
-\tab ProjectInformation.Address property can be accessed from the EventArgs.Document property of DocumentOpened event.\par
|
|
-\tab After modification is finished, the value of the ProjectInformation.Address property will be dumped to the log file.\par
|
|
-\tab DocumentOpenedEventArgs properties Cancel, Cancellable and Status will be dumped to log when event is raised\f1 .\par
|
|
\pard\ltrpar\par
|
|
\b\f0 Instructions:\cf2\b0 \cf0\f1\par
|
|
\pard\ltrpar\fi-360\li360\tx360\f0 1.\tab Add the following lines to the Revit.ini file \f1\par
|
|
\pard\ltrpar\fi426\tx284\f0 [ExternalApplications]\par
|
|
EACount = 1\par
|
|
EAClassName1=Revit.SDK.Samples.AutoUpdate.CS.ExternalApplication\par
|
|
EAAssembly1= (your path)\\ AutoUpdate.dll\f1\par
|
|
\pard\ltrpar\fi-360\li360\tx360\f0 2.\tab Run Revit and open a document.\f1\par
|
|
\pard\ltrpar\fi-360\li360\f0 3.\tab And then, go to Settings \f2\'e0\f0 Project Information \f2\'e0\f0 Project Address, and then you can see the value of this property is changed into what we assigned. In this sample, we trigger this event from UI, so it must be registered on ControlledApplication.\f1\par
|
|
\f0 4.\tab You can also refer to the log file to check whether the operation is successful.\f1\par
|
|
\pard\ltrpar\par
|
|
\b\f0 Note:\par
|
|
\pard\ltrpar\fi-420\li420\tx360\cf2\b0 1.\tab \cf0 Because Family document doesn\rquote t support Project Information, this sample should not run on Family document.\f1\par
|
|
\pard\ltrpar\li360\qc\par
|
|
\pard\ltrpar\par
|
|
}
|
|
|