Files
2024-12-12 10:25:07 +01:00

45 lines
4.3 KiB
Plaintext

{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\ltrpar\b\f0\fs20 Application:\b0 Journaling\line\b Revit Platform:\b0 All\line\b Revit Version:\b0 2010.0\line\b First Released For:\b0 9.1\line\b Last Modified:\b0 02/26/2008\line\b Modified By:\b0 JJ Autodesk\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 Journaling mechanism: Journal Data read and write.\line\b Summary:\b0 \line This sample demonstrates how an external application can be incorporated into the journaling mechanism\f1 .\par
\f0\par
\b Classes:\b0 \f1\par
\pard\ltrpar\fi360\f0 Autodesk.Revit.IExternalCommand\f1\par
\f0 Autodesk.Revit.Document\f1\par
\f0 Autodesk.Revit.Element\f1\par
\f0 Autodesk.Revit.Creation\f1\par
\f0 Autodesk.Revit.Collections.StringStringMap\f1\par
\pard\ltrpar\f0\par
\b Project Files:\b0 \par
Command.cs\f1\par
\pard\ltrpar\li360\f0 This file contains the class Command that inherits from IExternalCommand. The class implements the Execute method and be used to interoperate with Revit\f1 .\par
\pard\ltrpar\f0\par
Journaling.cs\f1\par
\pard\ltrpar\li360\f0 This file will implement the functions: get all Wall types and all Levels; show all Wall types and Level information in a Form; read and write journal data to journal file; create a Wall according to user setting\f1 .\f0 \f1\par
\pard\ltrpar\par
\f0 JournalingForm.cs\f1\par
\pard\ltrpar\li360\f0 This file contains the Form class which consists of: two ComboBox controls, one lists all Wall types, the other is for all Levels; a user control to get Wall location from user\rquote s inputting\f1 .\par
\pard\ltrpar\par
\f0 PointUserControl.cs\f1\par
\pard\ltrpar\li360\f0 This file contains user control class which implements a user control for getting XYZ data from user input\f1 .\par
\pard\ltrpar\par
\b\f0 Description:\b0 \par
This sample mostly uses StringStringMap class for implementing the functionality: read and write user data from/to journal file, the data exists in APIStringStringMapJournalData journal data section in journal file.\f1\par
\pard\ltrpar\fi-360\li360\tx360\f0 -\tab To read or write data which stored in the journal file\f1 ,\f0 use StringStringMap class\rquote s methods: get_Item(key) and Insert(key, value)\f1 .\par
\f0 -\tab The ExternalCommandData.Data property can be used to get/set the journal data (StringStringMap object)\f1 .\par
\f0 -\tab To get all Wall Type in Revit project, use ActiveDocument.WallTypes.\f1\par
\f0 -\tab To get an existing element by Id, use ActiveDocument.get_Element(ref ElementId).\f1\par
\pard\ltrpar\par
\b\f0 Instructions:\cf1\b0 \f1\par
\pard\ltrpar\fi-360\li360\tx360\cf0\f0 1.\tab In order to test the sample function about reading / writing journal data, firstly, user should manually execute this sample one time.\f1\par
\pard\ltrpar\fi-360\li360\f0 2.\tab Click the extern command, a dialog will be popped up; input the start and end point for new Wall, click Ok to create a new wall and then close Revit without saving\f1 .\par
\f0 3.\tab Open the latest journal file generated by Revit in Journals folder under Revit install directory(ensure there is Journals before run this sample), you will see the journal data (End Point, Start Point, Level Id, etc) added by API in APIStringStringMapJournalData section:\f1\par
\pard\ltrpar\li720\f0 Jrn.Data "APIStringStringMapJournalData" _\par
, 4, "End Point", "(100,0,0)" _\par
, "Level Id", "30", "Start Point" _\par
, "(0,0,0)", "Wall Type Name", "Curtain Wall 1"\f1\par
\par
\pard\ltrpar\fi-360\li360\tx360\f0 4.\tab When replay this sample journal (drag the journal to Revit.exe icon directly), you will find same Wall is created successfully via reading the journal data value reserved in above steps.\f1\par
\pard\ltrpar\fi-360\li360\f0 5.\tab However, if you comment the WriteJournalData() method in method Run() of Journaling.cs file then execute step1 to step3; in step4, the JournalingForm will be popped up and blocks the execution, because there is no journal data be reserved in step1 to step3\f1 .\par
\pard\ltrpar\par
}