mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-11 23:43:17 +00:00
52 lines
5.9 KiB
Plaintext
52 lines
5.9 KiB
Plaintext
{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033\deftab420{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fnil\fprq2\fcharset2 Wingdings;}{\f3\froman\fprq2\fcharset0 Times New Roman;}}
|
|
{\info{\horzdoc}{\*\lchars ([\'7b\'b7\'91\'93<\'ab?????(.[\'7b??}{\*\fchars !),.:\'3b?]\'7d\'a8\'b7?\'af??\'92\'94\'85:????>\'bb?????!"'),.:\'3b?]`|\'7d~?}}
|
|
\viewkind4\uc1\pard\ltrpar\nowidctlpar\qj\kerning2\b\f0\fs20 Application:\b0 Truss\line\b Revit Platform:\b0 Structure\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 Medium\line\b Category:\b0 Structure , Geometry\line\b Type:\b0 ExternalCommand\line\line\b Subject:\b0 Create truss, edit truss Profile and Members.\line\b Summary:\par
|
|
\kerning0\b0 This sample demonstrates how to create a truss and modify its truss members and profile.\par
|
|
\kerning2\b \par
|
|
Classes: \par
|
|
\pard\ltrpar\nowidctlpar\fi360\kerning0\b0 Autodesk.Revit.DB.Structure.Truss\par
|
|
Autodesk.Revit.DB.Structure.TrussType\par
|
|
Autodesk.Revit.DB.FamilyInstance\par
|
|
Autodesk.Revit.DB.FamilySymbol\par
|
|
Autodesk.Revit.DB.ViewPlan\par
|
|
Autodesk.Revit.DB.Strucure.TrussMemberInfo\par
|
|
Autodesk.Revit.DB.Line\par
|
|
Autodesk.Revit.DB.CurveArray\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2\par
|
|
\b Project Files: \par
|
|
\b0 Command.cs\par
|
|
\pard\ltrpar\nowidctlpar\li360\kerning0 This file contains a class Command that implements the IExternalCommand interface, creates TrussForm and gets ExternalCommandData.\par
|
|
\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2 TrussForm.cs\par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li720\tx720\kerning0\f1\'b7\tab\f0 This file contains a class TrussForm which inherits from Form. This Form has a TabControl which contains three pages: \ldblquote View\rdblquote , \ldblquote Truss Member\rdblquote and \ldblquote Profile Edit\rdblquote . \par
|
|
\pard\ltrpar\nowidctlpar\fi-360\li720\f1\'b7\tab\f0 In \ldblquote View\rdblquote page, User can draw the start point and end point of Truss in a PictureBox to create truss on selected level, all available levels should be listed in a ComboBox. \par
|
|
\f1\'b7\tab\f0 In \ldblquote Truss Member\rdblquote page, after user created truss, all the curves of truss should be displayed in a picture box, user can select truss member (beam) by clicking the curve in picture box, and user can change the beam type of selected truss member, all beam types should be listed in a ComboBox. \par
|
|
\f1\'b7\tab\f0 In \ldblquote ProfileEdit\rdblquote page, user can edit profile of the new created truss in a picture box which displays geometry information of the truss, and user can withdraw the editing by clicking \ldblquote Restore\rdblquote button. This page also gives a \ldblquote Update\rdblquote button use to update the geometry of truss after profile been edited.\par
|
|
\pard\ltrpar\nowidctlpar\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2 TrussGeometry.cs\par
|
|
\pard\ltrpar\nowidctlpar\li360\tx720\kerning0 This file contains a class \kerning2 TrussGeometry which used to calculate the geometry info of new created truss and change profile of truss\kerning0 . \kerning2 TrussGeometry \kerning0 consists of methods Draw2D() and SetProdile(). Draw2D() is used to draw truss curves on the picture box, and SetProfile() is used to reset the profile of truss by user input.\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2\par
|
|
LineTool.cs\par
|
|
\pard\ltrpar\nowidctlpar\li360\tx720\kerning0 This file contains a class named LineTool which provides some methods to draw lines on the form and store the data of drawn lines.\par
|
|
\pard\ltrpar\nowidctlpar\tx720\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2 MathTools.cs\par
|
|
\pard\ltrpar\nowidctlpar\li360\tx720\kerning0 This file contains Verctor4 and Matrix4 two classes. These two classes are used to transform points between 3D and 2D.\par
|
|
\pard\ltrpar\nowidctlpar\qj\kerning2\par
|
|
\b Description:\b0 \par
|
|
\pard\ltrpar\nowidctlpar This sample shows user how to create Truss by \par
|
|
Autodesk.Revit.Creation.Document.NewTruss(Symbols.TrussType trussType, Elements.SketchPlane sketchPlane, Geometry.Curve baseCurve, Elements.View dbView) method:\par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li420\tx420\f2\fs10 n\tab\f0\fs20 TrussType will specify the type of truss, can be get from Autodesk.Revit.Document.TrussTypes property.\par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li420\f2\fs10 n\tab\f0\fs20 sketchPlane used to define which sketch plane truss can base on\par
|
|
\f2\fs10 n\tab\f0\fs20 baseCurve used to define the start point and end point of new truss.\par
|
|
\f2\fs10 n\tab\f0\fs20 dbView used to specify which level truss create on.\par
|
|
\pard\ltrpar\nowidctlpar\qj\par
|
|
\b Instructions:\b0 \par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li420\qj\tx420 1.\tab Select two columns or an existed truss in Revit.\par
|
|
\pard\ltrpar\nowidctlpar\fi-420\li420\qj 2.\tab Run this command. (If there aren\rquote t any templates for truss type or column in the project, you should load some first, or open Truss.rvt)\par
|
|
3.\tab If user select two columns, should select a Level on which you want to create truss in ComboBox, then click \ldblquote Create\rdblquote button to create a truss.\par
|
|
4.\tab After creating a new truss, you can open the \ldblquote Truss Members\rdblquote and \ldblquote Profile Edit\rdblquote tab pages.\par
|
|
5.\tab Open \ldblquote Truss Members\rdblquote page, you can select a truss member by clicking the each curve of truss geometry. After it turns red, you can change its beam type by \ldblquote Change Type\rdblquote button, and you can select the beam type you want change to in the ComboBox.\par
|
|
6.\tab Open \ldblquote Profile Edit\rdblquote page, user can draw TopChord line and BottomChord line in picture box and after you finished new profile for truss, click \ldblquote Update\rdblquote button, and you can restore the truss profile by \ldblquote Restore\rdblquote button.\par
|
|
\pard\ltrpar\nowidctlpar\qj\f3\fs21\par
|
|
}
|
|
|