本文整理汇总了C#中ExporterIFC.AddViewIdToExport方法的典型用法代码示例。如果您正苦于以下问题:C# ExporterIFC.AddViewIdToExport方法的具体用法?C# ExporterIFC.AddViewIdToExport怎么用?C# ExporterIFC.AddViewIdToExport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExporterIFC
的用法示例。
在下文中一共展示了ExporterIFC.AddViewIdToExport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginExport
//.........这里部分代码省略.........
IFCAnyHandle prevPlacement = null;
double prevHeight = 0.0;
double prevElev = 0.0;
for (int ii = 0; ii < levels.Count; ii++)
{
Level level = levels[ii];
if (level == null)
continue;
IFCLevelInfo levelInfo = null;
if (!LevelUtil.IsBuildingStory(level))
{
if (prevBuildingStorey == null)
unassignedBaseLevels.Add(level);
else
{
levelInfo = IFCLevelInfo.Create(prevBuildingStorey, prevPlacement, prevHeight, prevElev, scaleFactor, true);
ExporterCacheManager.LevelInfoCache.AddLevelInfo(exporterIFC, level.Id, levelInfo);
}
continue;
}
// When exporting to IFC 2x3, we have a limited capability to export some Revit view-specific
// elements, specifically Filled Regions and Text. However, we do not have the
// capability to choose which views to export. As such, we will choose (up to) one DBView per
// exported level.
// TODO: Let user choose which view(s) to export. Ensure that the user know that only one view
// per level is supported.
View view = LevelUtil.FindViewByLevel(document, ViewType.FloorPlan, level);
if (view != null)
{
exporterIFC.AddViewIdToExport(view.Id, level.Id);
}
double elev = level.ProjectElevation;
double height = 0.0;
List<ElementId> coincidentLevels = new List<ElementId>();
for (int jj = ii + 1; jj < levels.Count; jj++)
{
Level nextLevel = levels[jj];
if (!LevelUtil.IsBuildingStory(nextLevel))
continue;
double nextElev = nextLevel.ProjectElevation;
if (!MathUtil.IsAlmostEqual(nextElev, elev))
{
height = nextElev - elev;
break;
}
else if (ExporterCacheManager.ExportOptionsCache.WallAndColumnSplitting)
coincidentLevels.Add(nextLevel.Id);
}
double elevation = elev * scaleFactor;
XYZ orig = new XYZ(0.0, 0.0, elevation);
IFCAnyHandle axis2Placement3D = ExporterUtil.CreateAxis2Placement3D(file, orig);
IFCAnyHandle placement = IFCInstanceExporter.CreateLocalPlacement(file, buildingPlacement, axis2Placement3D);
string levelName = NamingUtil.GetNameOverride(level, level.Name);
string objectType = NamingUtil.GetObjectTypeOverride(level, null);
string description = NamingUtil.GetDescriptionOverride(level, null);
string longName = level.Name;
string levelGUID = GUIDUtil.GetLevelGUID(level);
IFCAnyHandle buildingStorey = IFCInstanceExporter.CreateBuildingStorey(file,
示例2: BeginExport
//.........这里部分代码省略.........
IFCAnyHandle prevPlacement = null;
double prevHeight = 0.0;
double prevElev = 0.0;
for (int ii = 0; ii < levels.Count; ii++)
{
Level level = levels[ii];
if (level == null)
continue;
IFCLevelInfo levelInfo = null;
if (!LevelUtil.IsBuildingStory(level))
{
if (prevBuildingStorey == null)
unassignedBaseLevels.Add(level);
else
{
levelInfo = IFCLevelInfo.Create(prevBuildingStorey, prevPlacement, prevHeight, prevElev, scaleFactor, true);
ExporterCacheManager.LevelInfoCache.AddLevelInfo(exporterIFC, level.Id, levelInfo);
}
continue;
}
// When exporting to IFC 2x3, we have a limited capability to export some Revit view-specific
// elements, specifically Filled Regions and Text. However, we do not have the
// capability to choose which views to export. As such, we will choose (up to) one DBView per
// exported level.
// TODO: Let user choose which view(s) to export. Ensure that the user know that only one view
// per level is supported.
View view = LevelUtil.FindViewByLevel(document, ViewType.FloorPlan, level);
if (view != null)
{
exporterIFC.AddViewIdToExport(view.Id, level.Id);
}
double elev = level.ProjectElevation;
double height = 0.0;
List<ElementId> coincidentLevels = new List<ElementId>();
for (int jj = ii+1; jj < levels.Count; jj++)
{
Level nextLevel = levels[jj];
if (!LevelUtil.IsBuildingStory(nextLevel))
continue;
double nextElev = nextLevel.ProjectElevation;
if (!MathUtil.IsAlmostEqual(nextElev, elev))
{
height = nextElev - elev;
break;
}
else if (ExporterCacheManager.ExportOptionsCache.WallAndColumnSplitting)
coincidentLevels.Add(nextLevel.Id);
}
double elevation = elev * scaleFactor;
XYZ orig = new XYZ(0.0, 0.0, elevation);
IFCAnyHandle axis2Placement3D = ExporterUtil.CreateAxis2Placement3D(file, orig);
IFCAnyHandle placement = IFCInstanceExporter.CreateLocalPlacement(file, buildingPlacement, axis2Placement3D);
string levelName = level.Name;
string levelGUID = LevelUtil.GetLevelGUID(level);
IFCAnyHandle buildingStorey = IFCInstanceExporter.CreateBuildingStorey(file,
levelGUID, exporterIFC.GetOwnerHistoryHandle(),
levelName, null, null, placement,
null, levelName, Toolkit.IFCElementComposition.Element, elevation);