本文整理汇总了C#中BIM.IFC.Utility.ProductWrapper.AddSpace方法的典型用法代码示例。如果您正苦于以下问题:C# ProductWrapper.AddSpace方法的具体用法?C# ProductWrapper.AddSpace怎么用?C# ProductWrapper.AddSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BIM.IFC.Utility.ProductWrapper
的用法示例。
在下文中一共展示了ProductWrapper.AddSpace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateIFCSpace
//.........这里部分代码省略.........
}
else if (spatialElement is Autodesk.Revit.DB.Mechanical.Space)
{
Autodesk.Revit.DB.Mechanical.Space space = spatialElement as Autodesk.Revit.DB.Mechanical.Space;
geomElem = space.ClosedShell;
}
IFCAnyHandle spaceHnd = null;
using (IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData())
{
extraParams.SetLocalPlacement(localPlacement);
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 = BodyExporterOptions.BodyTessellationLevel.Coarse;
repHnd = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC, spatialElement,
catId, geomElem, bodyExporterOptions, null, extraParams);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(repHnd))
extraParams.ClearOpenings();
}
else
{
IFCAnyHandle shapeRep = ExtrusionExporter.CreateExtrudedSolidFromCurveLoop(exporterIFC, null, curveLoops, plane, zDir, roomHeight);
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 = roomHeight;
extraParams.ScaledArea = dArea;
string spatialElementName = NamingUtil.GetNameOverride(spatialElement, name);
string spatialElementDescription = NamingUtil.GetDescriptionOverride(spatialElement, desc);
string spatialElementObjectType = NamingUtil.GetObjectTypeOverride(spatialElement, null);
double? spaceElevationWithFlooring = null;
double elevationWithFlooring = 0.0;
if (ParameterUtil.GetDoubleValueFromElement(spatialElement, "IfcElevationWithFlooring", out elevationWithFlooring) == true)
spaceElevationWithFlooring = elevationWithFlooring;
spaceHnd = IFCInstanceExporter.CreateSpace(file, GUIDUtil.CreateGUID(spatialElement),
exporterIFC.GetOwnerHistoryHandle(),
spatialElementName,spatialElementDescription, spatialElementObjectType,
extraParams.GetLocalPlacement(), repHnd, longName, Toolkit.IFCElementComposition.Element,
internalOrExternal, spaceElevationWithFlooring);
transaction2.Commit();
}
productWrapper.AddSpace(spaceHnd, levelInfo, extraParams, true);
}
// Save room handle for later use/relationships
ExporterCacheManager.SpatialElementHandleCache.Register(spatialElement.Id, spaceHnd);
exporterIFC.RegisterSpatialElementHandle(spatialElement.Id, spaceHnd);
// Find Ceiling as a Space boundary and keep the relationship in a cache for use later
Boolean ret = getCeilingSpaceBoundary(spatialElement);
if (!MathUtil.IsAlmostZero(dArea) && !(ExporterCacheManager.ExportOptionsCache.FileVersion == IFCVersion.IFCCOBIE) &&
!ExporterCacheManager.ExportOptionsCache.ExportAs2x3CoordinationView2 && !ExporterCacheManager.ExportOptionsCache.ExportBaseQuantities)
{
ExporterIFCUtils.CreatePreCOBIEGSAQuantities(exporterIFC, spaceHnd, "GSA Space Areas", (isArea ? "GSA Design Gross Area" : "GSA BIM Area"), dArea);
}
// Export BaseQuantities for SpatialElement
if (ExporterCacheManager.ExportOptionsCache.ExportBaseQuantities && !(ExporterCacheManager.ExportOptionsCache.FileVersion == IFCVersion.IFCCOBIE))
{
// Skip this step. The "standard" quantities will be exported at the end of export element process in exportElement (Exporter.cs)
// ExporterIFCUtils.CreateNonCOBIERoomQuantities(exporterIFC, spaceHnd, spatialElement, dArea, roomHeight);
}
// Create general classification for Spatial element from ClassificationCode(s). This is not done here but rather at the end of exportElement process
// ClassificationUtil.CreateClassification(exporterIFC, file, spatialElement, spaceHnd, "");
// Export Classifications for SpatialElement for GSA/COBIE.
if (ExporterCacheManager.ExportOptionsCache.FileVersion == IFCVersion.IFCCOBIE)
{
CreateCOBIESpaceClassifications(exporterIFC, file, spaceHnd, document.ProjectInformation, spatialElement);
}
return true;
}