本文整理汇总了C#中Revit.IFC.Export.Utility.ProductWrapper.AddSpace方法的典型用法代码示例。如果您正苦于以下问题:C# ProductWrapper.AddSpace方法的具体用法?C# ProductWrapper.AddSpace怎么用?C# ProductWrapper.AddSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Revit.IFC.Export.Utility.ProductWrapper
的用法示例。
在下文中一共展示了ProductWrapper.AddSpace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateIFCSpace
//.........这里部分代码省略.........
extraParams.PossibleExtrusionAxes = IFCExtrusionAxes.TryZ;
using (IFCTransaction transaction2 = new IFCTransaction(file))
{
IFCAnyHandle repHnd = null;
if (!ExporterCacheManager.ExportOptionsCache.Use2DRoomBoundaryForRoomVolumeCreation && geomElem != null)
{
BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
bodyExporterOptions.TessellationLevel = BodyExporter.GetTessellationLevel();
repHnd = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC, spatialElement,
catId, geomElem, bodyExporterOptions, null, extraParams, false);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(repHnd))
extraParams.ClearOpenings();
}
else
{
IFCAnyHandle shapeRep = ExtrusionExporter.CreateExtrudedSolidFromCurveLoop(exporterIFC, null, curveLoops, plane, zDir, scaledRoomHeight);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(shapeRep))
return false;
IFCAnyHandle styledItemHnd = BodyExporter.CreateSurfaceStyleForRepItem(exporterIFC, document,
shapeRep, ElementId.InvalidElementId);
HashSet<IFCAnyHandle> bodyItems = new HashSet<IFCAnyHandle>();
bodyItems.Add(shapeRep);
shapeRep = RepresentationUtil.CreateSweptSolidRep(exporterIFC, spatialElement, catId, exporterIFC.Get3DContextHandle("Body"), bodyItems, null);
IList<IFCAnyHandle> shapeReps = new List<IFCAnyHandle>();
shapeReps.Add(shapeRep);
IFCAnyHandle boundingBoxRep = BoundingBoxExporter.ExportBoundingBox(exporterIFC, geomElem, Transform.Identity);
if (boundingBoxRep != null)
shapeReps.Add(boundingBoxRep);
repHnd = IFCInstanceExporter.CreateProductDefinitionShape(file, null, null, shapeReps);
}
extraParams.ScaledHeight = scaledRoomHeight;
extraParams.ScaledArea = dArea;
spatialElementName = NamingUtil.GetNameOverride(spatialElement, name);
string spatialElementDescription = NamingUtil.GetDescriptionOverride(spatialElement, desc);
string spatialElementObjectType = NamingUtil.GetObjectTypeOverride(spatialElement, null);
string spatialElementLongName = NamingUtil.GetLongNameOverride(spatialElement, longName);
double? spaceElevationWithFlooring = null;
double elevationWithFlooring = 0.0;
if (ParameterUtil.GetDoubleValueFromElement(spatialElement, null, "IfcElevationWithFlooring", out elevationWithFlooring) != null)
spaceElevationWithFlooring = UnitUtil.ScaleLength(elevationWithFlooring);
spaceHnd = IFCInstanceExporter.CreateSpace(file, GUIDUtil.CreateGUID(spatialElement),
ExporterCacheManager.OwnerHistoryHandle,
spatialElementName, spatialElementDescription, spatialElementObjectType,
extraParams.GetLocalPlacement(), repHnd, spatialElementLongName, Toolkit.IFCElementComposition.Element,
internalOrExternal, spaceElevationWithFlooring);
transaction2.Commit();
}
if (spaceHnd != null)
{
productWrapper.AddSpace(spatialElement, spaceHnd, levelInfo, extraParams, true);
if (isArea)
{
Element areaScheme = spatialElementAsArea.AreaScheme;
if (areaScheme != null)
{
ElementId areaSchemeId = areaScheme.Id;
HashSet<IFCAnyHandle> areas = null;
if (!ExporterCacheManager.AreaSchemeCache.TryGetValue(areaSchemeId, out areas))
{
areas = new HashSet<IFCAnyHandle>();
ExporterCacheManager.AreaSchemeCache[areaSchemeId] = areas;
}
areas.Add(spaceHnd);
}
}
}
}
// Save room handle for later use/relationships
ExporterCacheManager.SpaceInfoCache.SetSpaceHandle(spatialElement, spaceHnd);
// Find Ceiling as a Space boundary and keep the relationship in a cache for use later
bool ret = GetCeilingSpaceBoundary(spatialElement, out results);
if (!MathUtil.IsAlmostZero(dArea) && !(ExporterCacheManager.ExportOptionsCache.ExportAsCOBIE) &&
!ExporterCacheManager.ExportOptionsCache.ExportAs2x3CoordinationView2 && !ExporterCacheManager.ExportOptionsCache.ExportBaseQuantities)
{
bool isDesignGrossArea = (string.Compare(spatialElementName, "GSA Design Gross Area") > 0);
PropertyUtil.CreatePreCOBIEGSAQuantities(exporterIFC, spaceHnd, "GSA Space Areas", (isDesignGrossArea ? "GSA Design Gross Area" : "GSA BIM Area"), dArea);
}
// Export Classifications for SpatialElement for GSA/COBIE.
if (ExporterCacheManager.ExportOptionsCache.ExportAsCOBIE)
{
ProjectInfo projectInfo = document.ProjectInformation;
if (projectInfo != null)
CreateCOBIESpaceClassifications(exporterIFC, file, spaceHnd, projectInfo, spatialElement);
}
return true;
}