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

43 lines
3.3 KiB
Plaintext

{\rtf1\fbidis\ansi\ansicpg936\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 CreateShared\line\b Revit Platform:\b0 All\line\b Revit Version:\b0 2010.0\line\b First Released For:\b0 8.0\line\b Last Modified:\b0 02/26/2008\line\b Modified By:\b0 LL Autodesk\line\b Programming Language:\b0 VB.NET\line\b Skill Level:\b0 Beginning\line\b Category:\b0 Parameters\line\b Type:\b0 ExternalCommand\line\line\b Subject:\b0 Create and modify a shared parameter.\line\b Summary:\b0 \line This sample shows how a shared parameter can be created via the API and how a shared parameter can be modified via the API.\i\par
\i0\f1\par
\b\f0 Classes:\b0 \par
\pard\ltrpar\fi180\li180\lang1036 Autodesk.Revit.IExternalCommand\f1\par
\f0 Autodesk.Revit.Parameters.DefinitionFile\par
Autodesk.Revit.Parameters.DefinitionGroup\par
Autodesk.Revit.Parameters.Definition\par
Autodesk.Revit.CategorySet\par
Autodesk.Revit.Category\par
Autodesk.Revit.Parameters.InstanceBinding\par
Autodesk.Revit.ParameterSet\par
Autodesk.Revit.Symbol\par
\pard\ltrpar\lang1033\par
\b Project Files:\b0 \i\par
\i0 Command1.vb\par
\pard\ltrpar\li360\lang1036 It contains the class Command1 which implements interface IExternalCommand and shows how\lang1033 to add a a shared parameter via the API.\i\f1\par
\pard\ltrpar\i0\par
\f0 Command2.vb\f1\par
\pard\ltrpar\li360\f0 It contains the class Command2 which implements interface IExternalCommand and shows how a shared parameter can be set value via the API.\f1\par
\pard\ltrpar\par
\b\f0 Description:\b0 \f1\par
\f0 This sample adds two commands to Revit. The first shows how a shared parameter can be created via the API. Note that a shared parameter file named RevitParameters.txt must exist before running this sample. More details on how to create a shared parameter file please see the Revit help files. The second command shows how a shared parameter can be modified via the API.\f1\par
\par
\f0 This sample provides following functionality.\f1\par
\f0 In Command1\par
\pard\ltrpar\fi-360\li360\tx360 -\tab Opens the RevitParameters.txt file and gets the DefinitionGroup(If not exist, creates one). Then gets the \ldblquote APIParameter\rdblquote definition from the group (If not exist, creates one).\f1\par
\pard\ltrpar\fi-360\li360\f0 -\tab Creates a new instance binding for the wall categories.\f1\par
\f0 -\tab Adds the parameter binding of the definition and the instance binding to the project\rquote s ParameterBindingsMap.\f1\par
\pard\ltrpar\par
\pard\ltrpar\fi-100\li100\f0 In Command2\par
\pard\ltrpar\fi-360\li360\tx360 -\tab Gets the \ldblquote APIParameter\rdblquote definition.\f1\par
\pard\ltrpar\fi-360\li360\f0 -\tab Loops the walls in the project. Then gets the \ldblquote APIParameter\rdblquote Parameter of each wall and sets its value to "Hello Revit".\f1\par
\pard\ltrpar\par
\b\f0 Instructions:\cf1\b0 \f1\par
\pard\ltrpar\fi-360\li360\tx360\cf0\f0 1.\tab Note that a shared parameter file named \ldblquote RevitParameters.txt\rdblquote must exist before running this sample.\f1\par
\f0 2.\tab Open Revit.\par
3.\tab Execute the external Command1.\f1\par
\pard\ltrpar\fi-360\li360\f0 4.\tab Draw some walls.\par
5.\tab Execute the external Command2.\f1\par
}