Revit API取得变量的内参名称实例代码
本文导语: 与取得元素变量的内参名称类别有个BuiltInParameter 代码如下://取得内参名称[Transaction(TransactionMode.Manual)][Regeneration(RegenerationOption.Manual)]public class cmdGetBuiltInParam : IExternalCommand{ public Result Execute(ExternalCommandData cmdData, ref string ms...
与取得元素变量的内参名称类别有个BuiltInParameter
//取得内参名称
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class cmdGetBuiltInParam : IExternalCommand
{
public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elements)
{
UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
Document doc = uiDoc.Document;
Selection sel = uiDoc.Selection;
Duct duct = doc.GetElement(sel.PickObject(ObjectType.Element, "选择")) as Duct;
foreach (Parameter p in duct.Parameters)
{
if (p.Definition.Name == "高度")
{
BuiltInParameter biParam = (BuiltInParameter)p.Id.IntegerValue;
TaskDialog.Show("builtIn", biParam.ToString());
}
}
return Result.Succeeded;
}
}
您可能感兴趣的文章:
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。