Files
RevitSdkSamples/SDK/Samples/NewHostedSweep/CS/ReadMe_NewHostedSweep.rtf
T
2021-04-20 11:36:21 +02:00

95 lines
7.7 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 ;\red0\green0\blue255;}
\viewkind4\uc1\pard\ltrpar\nowidctlpar\b\f0\fs20 Application:\b0 NewHostedSweep\line\b Revit Platform:\b0 Architecture\line\b Revit Version:\b0 2011.0\line\b First Released For:\b0 2009.0\line\b Programming Language:\b0 C#\line\b Skill Level:\b0 High\line\b Category:\b0 Elements\line\b Type:\b0 ExternalCommand\line\line\b Subject:\b0 Create hosted sweep (Fascia, Gutter, and SlabEdge).\line\b Summary:\b0 \line This sample will demonstrate how to create hosted sweep (includes Fascia, Gutter and SlabEdge), and how to modify their properties.\par
\par
\b Classes:\b0 \par
\pard\ltrpar\nowidctlpar\fi360 Autodesk.Revit.UI.IExternalCommand \f1\par
\f0 Autodesk.Revit.DB.Document\f1\par
\f0 Autodesk.Revit.Creation.Document\f1\par
\f0 Autodesk.Revit.DB.HostedSweep\par
Autodesk.Revit.DB\f1 .\f0 HostedSweepType\par
Autodesk.Revit.DB.SlabEdge\par
Autodesk.Revit.DB.SlabEdgeType\par
Autodesk.Revit.DB.Architecture.Fascia\par
Autodesk.Revit.DB.Architecture.Gutter\par
Autodesk.Revit.DB.Architecture.FasciaType\f1\par
\f0 Autodesk.Revit.DB.Architecture.GutterType\f1\par
\f0 Autodesk.Revit.DB.Solid\f1\par
\f0 Autodesk.Revit.DB.Edge\par
Autodesk.Revit.DB.Reference\f1\par
\f0 Autodesk.Revit.DB.Transform\f1\par
\pard\ltrpar\nowidctlpar\li720\f0\par
\pard\ltrpar\nowidctlpar\b Project Files:\b0 \par
Command.cs\par
This is the entrance of this sample. It implements IExternalCommand Execute method.\par
\par
HostedSweepCreator.cs\par
This is an abstract class and is the base class of FasciaCreator, GutterCreator, and SlabEdgeCreator.\par
\par
FasciaCreator.cs\par
This class inherits base class HostedSweepCreator, and it is intent to create Fascia.\par
\par
GutterCreator.cs\par
This class inherits base class HostedSweepCreator, and it is intent to create Gutter.\par
\par
SlabEdgeCreator.cs\par
This class inherits base class HostedSweepCreator, and it is intent to create SlabEdge.\par
\par
CreationMgr.cs\par
This is the manager of all hosted sweep creators, it contains all the creators and each creator can be used to create corresponding hosted sweep. Its "Execute\rdblquote method will show the main dialog for user to create hosted sweeps.\par
\par
\par
CreationData.cs\par
This class contains the data for hosted sweep creation.\par
\par
ModificationData.cs\par
This class contains the data for hosted sweep modification.\par
\par
EdgeFetchForm.cs\par
This form is intent to fetch edges for hosted sweep creation or modification. It contains a picture box for geometry preview and a tree view to list all the edges which hosted sweep can be created on.\par
\par
HostedSweepModifyForm.cs\par
This form contains a property grid control to modify the property of hosted sweep.\par
\par
MainForm.cs\par
This is the main form. It is the entry to create a new hosted sweep or to modify a created hosted sweep.\par
\par
ElementGeometry.cs\par
This class is intent to display element's wire-frame with C# GDI. It contains a solid and a bounding box of an element. It also contains transformation (translation, rotation and scale) to transform the geometry edges.\par
\par
TrackBall.cs\par
This class is intent to facilitate the geometry transformations. It can produce rotation and scale transformations.\f1\par
\f0\par
\b Description:\b0 \par
This sample let user create hosted sweep and modify the created hosted sweep. \par
Its Implementation lists as below:\par
\pard\ltrpar\nowidctlpar\fi-420\li420\f2\'d8\tab\f0 Types can be gotten via Document properties FasciaTypes, GutterTypes, and SlabEdgeTypes. These types can be used to create Fascia, Gutter, and SlabEdge.\par
\f2\'d8\tab\f0 Fascia will be created with NewFascia (FasciaType, ReferenceArray), Gutter with NewGutter (GutterType, ReferenceArray) and SlabEdge with NewSlabEdge (SlabEdgeType, ReferenceArray). The first parameter can be null (the default type will be used) or the types from Document and the second parameter will be the edges\rquote references of a roof or a floor.\par
\f2\'d8\tab\f0 Segments can be added via method AddSegment (Reference) of each subclass of HostedSweep. \par
\f2\'d8\tab\f0 Segments can be removed via method RemoveSegment (Reference) of HostedSweep.\par
\f2\'d8\tab\f0 Angle, HorizontalOffset and VerticalOffset are get/set properties of HostedSweep, and their value can be get and set easily. \par
\f2\'d8\tab\f0 Flip states in horizontal or vertical direction of HostedSweep can be changed via method HorizontalFlip (), and VerticalFlip (). Properties of HorizontalFlipped and VerticalFlipped can query the flip states in horizontal or vertical direction.\par
\f2\'d8\tab\f0 Transaction will be used in each operation (eg. creating HostedSweep or changing HostedSweep properties) in order to see the result immediately in Revit after each operation. Methods of Document\rquote s BeginTransaction (), EndTransaction () and AbortTransaction () will be used to do transaction operation.\par
\f2\'d8\tab\f0 The edges are filtered via method AddSegment (). If AddSegment () throws exception, then this edge will be discarded otherwise this edge will be treated as an eligible edge.\par
\pard\ltrpar\nowidctlpar\par
\par
\b Limitations:\par
\b0 In order to filter out the edges which hosted sweep can be created on, this sample uses below methods which may not be supported in future version:\par
Fascia fascia = NewFascia (null, new ReferenceArray ());\par
Gutter gutter = NewGutter (null, new ReferenceArray ());\par
SlabEdge slabEdge = NewSlabEdge (null, new ReferenceArray ()).\par
\par
\b Instructions:\cf1\b0 \par
\pard\ltrpar\nowidctlpar\fi-360\li360\cf0 1.\tab Open or new a Revit project and make sure some Roofs or Floors are placed. A sample project file NewHostedSweep.rvt is available in the sample\rquote s folder.\par
2.\tab Run this Command, the main dialog will be presented.\par
3.\tab In the main dialog, select a hosted sweep type in the combo-box list and click the button Create. A dialog will be presented for the user to fetch edges and select a type in the combo-box list for the hosted sweep creation. After fetching some edges and selecting a type, click OK button will create a hosted sweep, otherwise Cancel button will cancel this creation operation.\par
\pard\ltrpar\nowidctlpar\li360 Edge fetching operation details:\par
\pard\ltrpar\nowidctlpar\fi-420\li780\f2\'d8\tab\f0 If the user mouse-over an edge where a hosted sweep can be created, the edge will be highlighted in yellow.\par
\f2\'d8\tab\f0 If the user clicks on the highlighted edge, the edge will be selected with red color or click again to un-select. \par
\f2\'d8\tab\f0 Edge selection from preview box will be reflected in the edge list and vice versa. \par
\f2\'d8\tab\f0 The geometry displayed in the picture box can be rotated by holding down the left mouse button and turning, or zoom by holding down the right button to move. \f1\par
\f2\'d8\tab\f0 Pressing arrow keys will also rotate the geometry round X-axis or Y-axis.\f1\par
\pard\ltrpar\nowidctlpar\fi-360\li360\f0 4.\tab To modify, select a hosted sweep type in the combo-box list and select a created hosted sweep in the list box from the main dialog, then click the button Modify to popup the form to modify the properties of the selected sweep. In the modification form, user can change the value in the property grid and the changes will reflect in Revit immediately.\par
5.\tab User can create more than one hosted sweep, and each created hosted sweep will be listed in the list box based on category and grouped by their type. After user click OK button in the main form, this command will exit.\f1\par
}