本文整理汇总了C#中Autodesk.OpenSharedParameterFile方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.OpenSharedParameterFile方法的具体用法?C# Autodesk.OpenSharedParameterFile怎么用?C# Autodesk.OpenSharedParameterFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autodesk
的用法示例。
在下文中一共展示了Autodesk.OpenSharedParameterFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSharedParamFile
public static DefinitionFile GetSharedParamFile(Autodesk.Revit.ApplicationServices.Application app, string sharedParamsFilePath)
{
string sharedParamsFileName;
sharedParamsFileName = app.SharedParametersFilename;
if (sharedParamsFileName.Length > 0)
{
return app.OpenSharedParameterFile();
}
else
{
string path = sharedParamsFilePath;
StreamWriter stream;
stream = new StreamWriter(path);
stream.Close();
app.SharedParametersFilename = path;
sharedParamsFileName = app.SharedParametersFilename;
return app.OpenSharedParameterFile();
}
}
示例2: SharedParamGUID
public static Guid SharedParamGUID(Autodesk.Revit.ApplicationServices.Application app, string defGroup, string defName)
{
Guid guid = Guid.Empty;
try
{
DefinitionFile file = app.OpenSharedParameterFile();
DefinitionGroup group = file.Groups.get_Item(defGroup);
Definition definition = group.Definitions.get_Item(defName);
ExternalDefinition externalDefinition = definition as ExternalDefinition;
guid = externalDefinition.GUID;
}
catch (Exception)
{
}
return guid;
}