mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-06 05:01:35 +00:00
42 lines
4.8 KiB
Plaintext
42 lines
4.8 KiB
Plaintext
{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052\deftab420{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}}
|
|
{\colortbl ;\red0\green0\blue255;}
|
|
{\info{\horzdoc}{\*\lchars (?[\'7b}{\*\fchars !),.:\'3b?D]\'7d}}
|
|
\viewkind4\uc1\pard\ltrpar\nowidctlpar\b\f0\fs20 Application:\b0 TransactionControl\line\b Revit Platform:\b0 All\line\b Revit Version:\b0 2011.0\line\b First Released For:\b0 2008.0\line\b Programming Language:\b0 C#\line\b Skill Level:\b0 Medium\line\b Category:\b0 Basics\line\b Type:\b0 ExternalCommand\line\line\b Subject:\b0 How to deal with transaction group, transaction and sub transaction.\line\b Summary:\b0 \line This sample demonstrates how to use transaction group, transaction and sub transaction\f1 .\par
|
|
\f0\par
|
|
\lang1036\b Classes:\b0 \f1\par
|
|
\pard\ltrpar\nowidctlpar\fi360\f0 Autodesk.Revit.Document\par
|
|
Autodesk.Revit.DB.TransactionGroup\par
|
|
Autodesk.Revit.DB.Transaction\par
|
|
Autodesk.Revit.DB.SubTransaction\par
|
|
\par
|
|
\pard\ltrpar\nowidctlpar\b Project Files:\b0\i \cf1\i0\f1\par
|
|
\pard\ltrpar\nowidctlpar\tx720\cf0\lang1033\f0 Command.cs\par
|
|
\pard\ltrpar\nowidctlpar\li420\tx720 It contains the class Command which implements interface IExternalCommand. This is the entry of this external command.\f1\par
|
|
\par
|
|
\pard\ltrpar\nowidctlpar\tx720\f0 TransactionForm.cs\f1\par
|
|
\pard\ltrpar\nowidctlpar\li420\tx720\f0 It contains the class TransactionForm which has options to start, rollback or commit transaction groups and transactions. The form also let user to create, move or delete walls inside transaction. The tree view is used to display all operations and transactions/transaction groups above and their relationship.\f1\par
|
|
\par
|
|
\pard\ltrpar\nowidctlpar\tx720\f0 CreateWallForm.cs\f1\par
|
|
\pard\ltrpar\nowidctlpar\li420\tx720\f0 It contains the class CreateWallForm which is used to create a wall. There is a combo box and several text boxes in this form to set parameters used to create wall\f1 .\par
|
|
\pard\ltrpar\nowidctlpar\f0\par
|
|
\b Description:\b0 \f1\par
|
|
\f0 Functionalities:\par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li780\tx780 -\tab Three buttons in group box of transaction group provide following operations: begin a transaction group, rollback a transaction group, commit a transaction group. \par
|
|
-\tab Three buttons in group box of transaction provide following operations: begin a transaction, rollback a transaction, commit a transaction. \par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li780 -\tab Three buttons in another operations group box provide following operations: create a wall, move a wall, delete a wall. \par
|
|
-\tab Provide a tree view to display transaction groups, transactions, operations and the relationship between them. \par
|
|
-\tab Allow user to use nested transaction groups to manage their transaction groups and transactions. Transactions cannot be nested and can be created inside or outside a transaction group. Sub transactions must be created inside a transaction. User can do one or more of the operations listed above inside a transaction or sub transaction.\par
|
|
-\tab When user clicks \ldblquote Ok\rdblquote /\rdblquote Cancel\rdblquote and there are some transaction groups or transactions which are not finished, show a message box to ask user whether to end all transactions.\par
|
|
\pard\ltrpar\nowidctlpar\li360\f1\par
|
|
\pard\ltrpar\nowidctlpar\f0 Implements:\f1\par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li780\tx780\f0 -\tab Transaction Group can be started/rolled back/committed via class TransactionGroup\rquote s Start/Rollback/Commit methods.\par
|
|
-\tab Transaction can be started/rolledback/committed via class Transaction\rquote s Start/Rollback/Commit methods.\par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li780 -\tab Wall can be created via Autodesk.Revit.Creation.Document\rquote s NewWall Method and can be moved/deleted via Autodesk.Revit.Document\rquote s Move/Delete methods\par
|
|
-\tab Tree node\rquote s ForeColor represents different status, e.g. green means that a transaction or transaction group has been started, black means that a transaction or transaction group has been committed and gray means that a transaction or transaction group has been rolled back.\f1\par
|
|
\pard\ltrpar\nowidctlpar\li360\kerning2\f0\fs21\par
|
|
\pard\ltrpar\nowidctlpar\kerning0\b\fs20 Instructions:\cf1\b0 \cf0\par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li360\tx360 1.\tab Run this external command.\par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li360 2.\tab A dialog will be shown. Do some operations such as start a transaction or transaction group or create a wall, and then the tree view adds corresponding nodes to describe these operations and their relationship.\f1\par
|
|
\f0 3.\tab When closing this dialog, if some transaction groups or transactions are not finished, a message box is shown to ask whether to end all transactions.\par
|
|
}
|
|
|