mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-12 06:22:01 +00:00
52 lines
5.2 KiB
Plaintext
52 lines
5.2 KiB
Plaintext
{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fmodern\fprq1\fcharset128 MS Mincho;}}
|
|
{\colortbl ;\red0\green0\blue255;\red192\green192\blue192;}
|
|
\viewkind4\uc1\pard\ltrpar\b\f0\fs20 Application:\b0 AutoParameter\b\f1\par
|
|
\f0 Revit Platform:\b0 All\line\b Revit Version:\b0 2010.0\line\b First Released For:\b0 2010.0\line\b Last Modified:\b0 09/11/2008\line\b Modified By:\b0 CZ Autodesk\line\b Programming Language:\b0 C#\line\b Skill Level:\b0 Medium\line\b Category:\b0 Parameters, Families\line\b Type:\b0 ExternalCommand\line\line\b Subject:\b0 Auto add parameters to family document\f1 .\f0\line\b Summary:\b0 \line This sample demonstrates how to automatically add parameters (shared or not) to family documents\f1 .\i\par
|
|
\b\i0\par
|
|
\f0 Classes: \f1\par
|
|
\pard\ltrpar\fi360\b0\f0 Autodesk.Revit.IExternalCommand\f1\par
|
|
\f0 Autodesk.Revit.Document\f1\par
|
|
\f0 Autodesk.Revit.FamilyManager\par
|
|
Autodesk.Revit.Parameters.FamilyParameter\par
|
|
Autodesk.Revit.Parameters.ExternalDefinition\f1\par
|
|
\pard\ltrpar\b\par
|
|
\f0 Project Files:\b0 \par
|
|
Command.cs\f1\par
|
|
\f0 This file contains 2 classes: AddParameterToFamily and AddParameterToFamilies. AddParameterToFamily implements the Execute method and be used to add parameters to the active family document. AddParameterToFamilies implements the Execute method and be used to add parameters to all families in the \ldblquote AutoParameter_Families\rdblquote folder under \ldblquote My Documents\rdblquote folder\f1 .\par
|
|
\f0 FamilyParameterAssigner.cs\par
|
|
This file contains the class FamilyParameterAssigner. This class adds all the parameters to the family file\f1 .\par
|
|
\par
|
|
\b\f0 Description:\b0 \par
|
|
This sample utilizes FamilyManager class to implement the features: add parameters (shared or not) to the specified family file\f1 .\par
|
|
\pard\ltrpar\fi-360\li360\tx360\f0 -\tab To add family parameters, use the AddParameter(String paramName, BuiltInParameterGroup paramGroup, ParameterType paramType, bool isInstance) method;\par
|
|
\pard\ltrpar\fi-360\li360 -\tab To add shared parameters, use the AddParameter(ExternalDefinition familyDefinition, BuiltInParameterGroup paramGroup\f1 ,\f0 bool isInstance) method;\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 auto-add parameters to family files, user should prepare the parameter files: family parameter file and shared parameter file.\f1\par
|
|
\pard\ltrpar\li360\f0 The family parameter file should be named as \ldblquote familyParameter.txt\rdblquote and put in the same folder as the sample DLL. \f1\par
|
|
\f0 The shared parameter file should be named as \ldblquote sharedParameter.txt\rdblquote and put in the same folder as the sample DLL.\f1\par
|
|
\f0 Here is a sample for how to organize the files:\f1\par
|
|
\pard\ltrpar\par
|
|
\pard\ltrpar\li720\fs24 RootFolder:\par
|
|
\f2\'84\'a0\f1 AutoParameter.dll\tab \highlight2 (this is the sample DLL)\highlight0\par
|
|
\f2\'84\'a0\f1 SharedParameter.txt\par
|
|
\f2\'84\'a0\f1 FamilyParameter.txt\par
|
|
\pard\ltrpar\li360\fs20\par
|
|
\pard\ltrpar\fi-360\li360\tx360\f0 2.\tab The format for the parameter files: for shared parameter file, it follows the format of Revit shared parameter file; for family parameter file, it has a similar format: Every line starts with \ldblquote #\rdblquote or \ldblquote *\rdblquote will be treated as the comment line and will be skipped, every parameter line should follow this format: \ldblquote ParamName\tab ParamGroup\tab ParamType\tab IsInstance\rdblquote , and be separated by spaces\f1 .\par
|
|
\pard\ltrpar\li360\f0 Here is a template for the family parameter file: \f1\par
|
|
\f0 # This is a Revit family parameter file.\par
|
|
# allows to edit manually.\par
|
|
# make sure the "ParamGroup" and "ParamType" values are correct (with or without #"BuiltInParameterGroup." and "ParameterType." doesn't affect the features).\par
|
|
\par
|
|
*ParamName\tab ParamGroup\tab ParamType\tab IsInstance\par
|
|
FamilyParam1\tab PG_TEXT\tab\tab Text\tab false\par
|
|
FamilyParam2\tab BuiltInParameterGroup.PG_TEXT\tab ParameterType.Text\tab true\par
|
|
\pard\ltrpar\f1\par
|
|
\pard\ltrpar\fi-360\li360\tx360\f0 3.\tab In order to add parameters to a family file, Launch Revit, open the family file, and click the external command \ldblquote AddParameterToFamily\rdblquote , all parameters (shared or not) will be added to the active family document;\f1\par
|
|
\pard\ltrpar\fi-360\li360\f0 4.\tab In order to add parameters to multiple family files, need to follow the steps:\par
|
|
\pard\ltrpar\fi-420\li840\tx840 a)\tab Create a folder \ldblquote AutoParameter_Families\rdblquote in \ldblquote My Documents\rdblquote folder;\par
|
|
\pard\ltrpar\fi-420\li840 b)\tab Put all the family files into that new folder, make sure all files are write-able (if some files are read-only, the parameters can\rquote t be added in.);\f1\par
|
|
\f0 c)\tab Launch Revit, create a project, click the external command \ldblquote AddParameterToFamilies\rdblquote , all the parameters will be added to all the family files in the \ldblquote AutoParameter_Families\rdblquote folder\par
|
|
\pard\ltrpar\f1\par
|
|
}
|
|
|