Revit API取得变量的内参名称
与取得元素变量的内参名称类别有个BuiltInParameter
url:http://greatverve.cnblogs.com/p/GetBuiltInParameter.html
//取得内参名称
[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;
}
}
[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;
}
}
我这个博客废弃不用了,今天想寻找外链的时候,突然想到这个博客权重很高。
有需要免费外链的,留言即可,我准备把这个博客变成免费的友情链接站点。