Files
2021-04-20 11:36:21 +02:00

65 lines
5.1 KiB
Plaintext

{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}}
{\colortbl ;\red0\green0\blue255;}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\b\f0\fs20 Application:\b0 RevitCommands\line\b Revit Platform:\b0 All\line\b Revit Version:\b0 2011.0\line\b First Released For:\b0 8.0\line\b Programming Language:\b0 VB.NET\line\b Skill Level:\b0 Beginning\line\b Category:\b0 Basics, Families\line\b Type:\b0 ExternalCommand\line\line\b Subject:\b0 Simple Revit commands.\line\b Summary:\b0 These sample contains 5 commands, demonstrates:\f1\par
\pard\fi-1440\li1800\tx720\f0 1. How to load family from family file.\f1\par
\pard\fi-1440\li1800\f0 2. How to load family symbol from family file.\par
3. How to access the selection set.\f1\par
\f0 4. How to get and set library paths in Revit.\par
5. How to retrieve data from selected elements.\f1\par
\pard\f0\par
\b Classes:\b0 \f1\par
\pard\fi360\f0 Autodesk.Revit.DB.Element \f1\par
\f0 Autodesk.Revit.DB.Parameter\f1\par
\f0 Autodesk.Revit.DB.Document\f1\par
\f0 Autodesk.Revit.ApplicationServices.ApplicationServices.Application\par
Autodesk.Revit.DB.Location\par
Autodesk.Revit.DB.Parameter\f1\par
\f0 Autodesk.Revit.DB.GeometryElement\f1\par
\f0 Autodesk.Revit.DB.Solid\par
Autodesk.Revit.DB.Instance\par
Autodesk.Revit.DB.Curve\par
Autodesk.Revit.DB.Mesh\f1\par
\pard\f0\par
\b Project Files:\b0 \par
LoadFamily.vb\f1\par
\pard\li360\f0 This file contains two command classes RvtCmd_LoadFamily which loads a family of the given family name and RvtCmd_LoadFamilySymbol which loads a family symbol/type of the given file and symbol name.\f1\par
\pard\par
\f0 Selection.vb\f1\par
\pard\li360\f0 This file contains the command Selection which shows the access to the current selection set that displays the number of selected elements and some simple information of these elements such as name, category and so on.\par
\par
\pard LibraryPath.vb\f1\par
\pard\li360\f0 This file contains the command LibraryPath which goes through the list of library paths held in the Revit. If it has a certain key, it erases it. If not, it adds a new path to the existing set. In the Revit UI, you can check the list in: Revit --> Options... --> [File Locations] Tab --> Libraries.\f1\par
\pard\par
\f0 RvtUtils.vb\f1\par
\pard\li360\f0 This file contains the class RvtUtils which is used within the command ShowElementData, RvtUtils has a collection of functions such as GeometryElementToString() that can retrieve data from the selected elements and convert them to strings.\f1\par
\pard\par
\f0 ShowElementData.vb\f1\par
\pard\li360\f0 This file contains the command ShowElementData which will display the information such as parameters, locations and geometries of selected elements using the utility class RvtUtils.\f1\par
\pard\par
\b\f0 Description:\b0 \f1\par
\f0 5 commands:\par
\pard\fi-360\li360\tx360 -\tab Load Family: loads a family of the given family name.\f1\par
\f0 -\tab Load Family Symbol: loads a family symbol/type of the given file and symbol name.\f1\par
\pard\fi-360\li360\f0 -\tab Selection: shows the access to the current selection set.\f1\par
\pard\fi-360\li360\tx360\f0 -\tab Library Path: goes through the list of library paths held in the Revit. \f1\par
\pard\fi360\f0 If it has a certain key, it erases it. If not, it adds a new path to the existing set. \par
In the Revit UI, you could check the list in: \f1\par
\f0 Revit --> Options... --> [File Locations] Tab --> Libraries.\f1\par
\pard\fi-360\li360\tx360\f0 -\tab Show Element Data: displays a geometry, location, and parameter data of selected elements.\f1\par
\pard\par
\f0 Codes implementation instructions:\f1\par
\pard\fi-360\li360\tx360\f0 -\tab To load family, use Document.LoadFamily(string rfaPath).\f1\par
\pard\fi-360\li360\f0 -\tab To load family symbol, use Document.LoadFamilySymbol(string filename, string name), filename is the file that contains the family symbol and the parameter name is the symbol name.\f1\par
\f0 -\tab To get the selected element collection, use Document.Selection.Elements.\f1\par
\f0 -\tab To get or set the library paths, use Application.Options.LibraryPaths.\f1\par
\f0 -\tab To get the location of an element, use Element.Location\f1\par
\f0 -\tab To get the geometry object of an element, use Element.Geometry(Autodesk.Revit.Geometry.Options options), the parameter options can be created by Application.Create.NewGeometryOptions()\f1\par
\pard\fi-360\li360\tx360\f0 -\tab Use Autodesk.Revit.DB.GeometryElement.Objects to get the GeometryObjectArray, and then convert the objects in it to Solid, Instance, Curve, Mesh etc.\f1\par
\pard\par
\b\f0 Instructions:\cf1\b0 \f1\par
\pard\fi-360\li360\tx360\cf0\f0 1.\tab Prepare. Make sure there is a family file \ldblquote W-Wide Flange-Column.rfa\rdblquote with a type named \ldblquote W10X33\rdblquote in current folder.\f1\par
\pard\fi-360\li360\f0 2.\tab Run the command (for Load Family, Load Family Symbol, Library Path)\f1\par
\pard\fi360\f0 or\f1\par
\f0 Select some elements and then run the command (for Selection, Show Element Data)\f1\par
}