本文整理汇总了C#中BIM.IFC.Utility.ProductWrapper类 的典型用法代码示例。如果您正苦于以下问题:C# ProductWrapper类的具体用法?C# ProductWrapper怎么用?C# ProductWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProductWrapper类 属于BIM.IFC.Utility命名空间,在下文中一共展示了ProductWrapper类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Create
/// <summary>
/// Static Create function for a child wrapper, with a different allowRelateToLevel value.
/// </summary>
/// <param name="parentWrapper">The parent wrapper.</param>
/// <param name="allowRelateToLevel">Whether or not handles are allowed to be related to levels.</param>
/// <returns>A new ProductWrapper.</returns>
public static ProductWrapper Create(ProductWrapper parentWrapper, bool allowRelateToLevel)
{
ProductWrapper productWrapper = new ProductWrapper();
productWrapper.m_InternalWrapper = IFCProductWrapper.Create(parentWrapper.m_InternalWrapper, allowRelateToLevel);
productWrapper.m_ParentWrapper = parentWrapper;
return productWrapper;
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:13, 代码来源:ProductWrapper.cs
示例2: ExportCeilingElement
/// <summary>
/// Exports a ceiling to IFC covering.
/// </summary>
/// <param name="exporterIFC">
/// The ExporterIFC object.
/// </param>
/// <param name="ceiling">
/// The ceiling element to be exported.
/// </param>
/// <param name="geomElement">
/// The geometry element.
/// </param>
/// <param name="productWrapper">
/// The ProductWrapper.
/// </param>
public static void ExportCeilingElement(ExporterIFC exporterIFC, Ceiling ceiling, GeometryElement geomElement, ProductWrapper productWrapper)
{
string ifcEnumType = CategoryUtil.GetIFCEnumTypeName(exporterIFC, ceiling);
if (String.IsNullOrEmpty(ifcEnumType))
ifcEnumType = "CEILING";
ExportCovering(exporterIFC, ceiling, geomElement, ifcEnumType, productWrapper);
}
开发者ID:stiter, 项目名称:ifcexporter, 代码行数:22, 代码来源:CeilingExporter.cs
示例3: Create
/// <summary>
/// Static Create function for a child wrapper.
/// </summary>
/// <param name="parentWrapper">The parent wrapper.</param>
/// <returns>A new ProductWrapper.</returns>
public static ProductWrapper Create(ProductWrapper parentWrapper)
{
ProductWrapper productWrapper = new ProductWrapper();
productWrapper.m_InternalWrapper = IFCProductWrapper.Create(parentWrapper.m_InternalWrapper);
productWrapper.m_ParentWrapper = parentWrapper;
return productWrapper;
}
开发者ID:stiter, 项目名称:ifcexporter, 代码行数:12, 代码来源:ProductWrapper.cs
示例4: ExportFabricArea
/// <summary>
/// Exports a FabricArea as an IfcGroup. There is no geometry to export.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="element">The element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
/// <returns>True if exported successfully, false otherwise.</returns>
public static bool ExportFabricArea(ExporterIFC exporterIFC, Element element, ProductWrapper productWrapper)
{
if (element == null)
return false;
HashSet<IFCAnyHandle> fabricSheetHandles = null;
if (!ExporterCacheManager.FabricAreaHandleCache.TryGetValue(element.Id, out fabricSheetHandles))
return false;
if (fabricSheetHandles == null || fabricSheetHandles.Count == 0)
return false;
IFCFile file = exporterIFC.GetFile();
using (IFCTransaction tr = new IFCTransaction(file))
{
string guid = GUIDUtil.CreateGUID(element);
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string revitObjectType = exporterIFC.GetFamilyName();
string name = NamingUtil.GetNameOverride(element, revitObjectType);
string description = NamingUtil.GetDescriptionOverride(element, null);
string objectType = NamingUtil.GetObjectTypeOverride(element, revitObjectType);
IFCAnyHandle fabricArea = IFCInstanceExporter.CreateGroup(file, guid,
ownerHistory, name, description, objectType);
productWrapper.AddElement(element, fabricArea);
IFCInstanceExporter.CreateRelAssignsToGroup(file, GUIDUtil.CreateGUID(), ownerHistory,
null, null, fabricSheetHandles, null, fabricArea);
tr.Commit();
return true;
}
}
开发者ID:whztt07, 项目名称:RevitIFC, 代码行数:42, 代码来源:FabricSheetExporter.cs
示例5: Export
/// <summary>
/// Exports a Rebar, AreaReinforcement or PathReinforcement to IFC ReinforcingBar.
/// </summary>
/// <param name="exporterIFC">The exporter.</param>
/// <param name="element">The element.</param>
/// <param name="filterView">The view.</param>
/// <param name="productWrapper">The product wrapper.</param>
public static void Export(ExporterIFC exporterIFC,
Element element, Autodesk.Revit.DB.View filterView, ProductWrapper productWrapper)
{
if (element is Rebar)
{
ExportRebar(exporterIFC, element, filterView, productWrapper);
}
else if (element is AreaReinforcement)
{
AreaReinforcement areaReinforcement = element as AreaReinforcement;
IList<ElementId> rebarIds = areaReinforcement.GetRebarInSystemIds();
Document doc = areaReinforcement.Document;
foreach (ElementId id in rebarIds)
{
Element rebarInSystem = doc.GetElement(id);
ExportRebar(exporterIFC, rebarInSystem, filterView, productWrapper);
}
}
else if (element is PathReinforcement)
{
PathReinforcement pathReinforcement = element as PathReinforcement;
IList<ElementId> rebarIds = pathReinforcement.GetRebarInSystemIds();
Document doc = pathReinforcement.Document;
foreach (ElementId id in rebarIds)
{
Element rebarInSystem = doc.GetElement(id);
ExportRebar(exporterIFC, rebarInSystem, filterView, productWrapper);
}
}
}
开发者ID:stiter, 项目名称:ifcexporter, 代码行数:39, 代码来源:RebarExporter.cs
示例6: Export
/// <summary>
/// Exports a hosted weep.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="hostedSweep">The hosted sweep element.</param>
/// <param name="geometryElement">The geometry element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
public static void Export(ExporterIFC exporterIFC, HostedSweep hostedSweep, GeometryElement geometryElement, ProductWrapper productWrapper)
{
ElementId catId = CategoryUtil.GetSafeCategoryId(hostedSweep);
if (catId == new ElementId(BuiltInCategory.OST_Gutter))
ExportGutter(exporterIFC, hostedSweep, geometryElement, productWrapper);
else
ProxyElementExporter.Export(exporterIFC, hostedSweep, geometryElement, productWrapper);
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:15, 代码来源:HostedSweepExporter.cs
示例7: CreateOpeningsIfNecessaryBase
/// <summary>
/// Creates openings if there is necessary.
/// </summary>
/// <param name="elementHandle">The element handle to create openings.</param>
/// <param name="element">The element to create openings.</param>
/// <param name="info">The extrusion data.</param>
/// <param name="extraParams">The extrusion creation data.</param>
/// <param name="offsetTransform">The offset transform from ExportBody, or the identity transform.</param>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="originalPlacement">The original placement handle.</param>
/// <param name="setter">The PlacementSetter.</param>
/// <param name="wrapper">The ProductWrapper.</param>
private static void CreateOpeningsIfNecessaryBase(IFCAnyHandle elementHandle, Element element, IList<IFCExtrusionData> info,
IFCExtrusionCreationData extraParams, Transform offsetTransform, ExporterIFC exporterIFC,
IFCAnyHandle originalPlacement, IFCPlacementSetter setter, ProductWrapper wrapper)
{
if (IFCAnyHandleUtil.IsNullOrHasNoValue(elementHandle))
return;
int sz = info.Count;
if (sz == 0)
return;
using (IFCTransformSetter transformSetter = IFCTransformSetter.Create())
{
if (offsetTransform != null)
transformSetter.Initialize(exporterIFC, offsetTransform.Inverse);
IFCFile file = exporterIFC.GetFile();
ElementId categoryId = CategoryUtil.GetSafeCategoryId(element);
Document document = element.Document;
string openingObjectType = "Opening";
int openingNumber = 1;
for (int curr = info.Count - 1; curr >= 0; curr--)
{
IFCAnyHandle extrusionHandle = ExtrusionExporter.CreateExtrudedSolidFromExtrusionData(exporterIFC, element, info[curr]);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(extrusionHandle))
continue;
IFCAnyHandle styledItemHnd = BodyExporter.CreateSurfaceStyleForRepItem(exporterIFC, document,
extrusionHandle, ElementId.InvalidElementId);
HashSet<IFCAnyHandle> bodyItems = new HashSet<IFCAnyHandle>();
bodyItems.Add(extrusionHandle);
IFCAnyHandle contextOfItems = exporterIFC.Get3DContextHandle("Body");
IFCAnyHandle bodyRep = RepresentationUtil.CreateSweptSolidRep(exporterIFC, element, categoryId, contextOfItems, bodyItems, null);
IList<IFCAnyHandle> representations = new List<IFCAnyHandle>();
representations.Add(bodyRep);
IFCAnyHandle openingRep = IFCInstanceExporter.CreateProductDefinitionShape(file, null, null, representations);
IFCAnyHandle openingPlacement = ExporterUtil.CopyLocalPlacement(file, originalPlacement);
string guid = GUIDUtil.CreateGUID();
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string openingName = NamingUtil.GetIFCNamePlusIndex(element, openingNumber++);
string elementId = NamingUtil.CreateIFCElementId(element);
IFCAnyHandle openingElement = IFCInstanceExporter.CreateOpeningElement(file, guid, ownerHistory,
openingName, null, openingObjectType, openingPlacement, openingRep, elementId);
wrapper.AddElement(null, openingElement, setter, extraParams, true);
if (ExporterCacheManager.ExportOptionsCache.ExportBaseQuantities && (extraParams != null))
ExporterIFCUtils.CreateOpeningQuantities(exporterIFC, openingElement, extraParams);
string voidGuid = GUIDUtil.CreateGUID();
IFCInstanceExporter.CreateRelVoidsElement(file, voidGuid, ownerHistory, null, null, elementHandle, openingElement);
}
}
}
开发者ID:whztt07, 项目名称:RevitIFC, 代码行数:70, 代码来源:OpeningUtil.cs
示例8: Export
/// <summary>
/// Exports a Rebar, AreaReinforcement or PathReinforcement to IFC ReinforcingBar.
/// </summary>
/// <param name="exporterIFC">The exporter.</param>
/// <param name="element">The element.</param>
/// <param name="productWrapper">The product wrapper.</param>
public static void Export(ExporterIFC exporterIFC, Element element, ProductWrapper productWrapper)
{
IList<IFCAnyHandle> createdRebars = null;
if (element is Rebar)
{
ExportRebar(exporterIFC, element, productWrapper);
}
else if (element is AreaReinforcement)
{
AreaReinforcement areaReinforcement = element as AreaReinforcement;
IList<ElementId> rebarIds = areaReinforcement.GetRebarInSystemIds();
Document doc = areaReinforcement.Document;
foreach (ElementId id in rebarIds)
{
Element rebarInSystem = doc.GetElement(id);
createdRebars = ExportRebar(exporterIFC, rebarInSystem, productWrapper);
}
}
else if (element is PathReinforcement)
{
PathReinforcement pathReinforcement = element as PathReinforcement;
IList<ElementId> rebarIds = pathReinforcement.GetRebarInSystemIds();
Document doc = pathReinforcement.Document;
foreach (ElementId id in rebarIds)
{
Element rebarInSystem = doc.GetElement(id);
createdRebars = ExportRebar(exporterIFC, rebarInSystem, productWrapper);
}
}
if (createdRebars != null && createdRebars.Count > 1)
{
IFCFile file = exporterIFC.GetFile();
using (IFCTransaction tr = new IFCTransaction(file))
{
string guid = GUIDUtil.CreateGUID(element);
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string revitObjectType = exporterIFC.GetFamilyName();
string name = NamingUtil.GetNameOverride(element, revitObjectType);
string description = NamingUtil.GetDescriptionOverride(element, null);
string objectType = NamingUtil.GetObjectTypeOverride(element, revitObjectType);
IFCAnyHandle rebarGroup = IFCInstanceExporter.CreateGroup(file, guid,
ownerHistory, name, description, objectType);
productWrapper.AddElement(element, rebarGroup);
IFCInstanceExporter.CreateRelAssignsToGroup(file, GUIDUtil.CreateGUID(), ownerHistory,
null, null, createdRebars, null, rebarGroup);
tr.Commit();
}
}
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:63, 代码来源:RebarExporter.cs
示例9: Export
/// <summary>
/// Exports a floor to IFC slab.
/// </summary>
/// <param name="exporterIFC">
/// The ExporterIFC object.
/// </param>
/// <param name="floor">
/// The floor element.
/// </param>
/// <param name="geometryElement">
/// The geometry element.
/// </param>
/// <param name="productWrapper">
/// The ProductWrapper.
/// </param>
public static void Export(ExporterIFC exporterIFC, HostObject floor, GeometryElement geometryElement, ProductWrapper productWrapper)
{
string ifcEnumType = CategoryUtil.GetIFCEnumTypeName(exporterIFC, floor);
// export parts or not
bool exportParts = PartExporter.CanExportParts(floor);
if (exportParts && !PartExporter.CanExportElementInPartExport(floor, floor.Level.Id, false))
return;
ExportFloor(exporterIFC, floor, geometryElement, ifcEnumType, productWrapper, exportParts);
}
开发者ID:stiter, 项目名称:ifcexporter, 代码行数:26, 代码来源:FloorExporter.cs
示例10: CreateOpeningsIfNecessary
/// <summary>
/// Creates openings if there is necessary.
/// </summary>
/// <param name="elementHandle">
/// The element handle to create openings.
/// </param>
/// <param name="element">
/// The element to create openings.
/// </param>
/// <param name="info">
/// The extrusion datas.
/// </param>
/// <param name="exporterIFC">
/// The ExporterIFC object.
/// </param>
/// <param name="originalPlacement">
/// The original placement handle.
/// </param>
/// <param name="setter">
/// The IFCPlacementSetter.
/// </param>
/// <param name="wrapper">
/// The ProductWrapper.
/// </param>
public static void CreateOpeningsIfNecessary(IFCAnyHandle elementHandle, Element element, IList<IFCExtrusionData> info,
ExporterIFC exporterIFC, IFCAnyHandle originalPlacement,
IFCPlacementSetter setter, ProductWrapper wrapper)
{
if (IFCAnyHandleUtil.IsNullOrHasNoValue(elementHandle))
return;
using (IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData())
{
CreateOpeningsIfNecessaryBase(elementHandle, element, info, extraParams, exporterIFC, originalPlacement, setter, wrapper);
}
}
开发者ID:stiter, 项目名称:ifcexporter, 代码行数:36, 代码来源:OpeningUtil.cs
示例11: ExportInsulation
/// <summary>
/// Exports an element as a covering of type insulation.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="element">The element.</param>
/// <param name="geometryElement">The geometry element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
/// <returns>True if exported successfully, false otherwise.</returns>
protected static bool ExportInsulation(ExporterIFC exporterIFC, Element element,
GeometryElement geometryElement, ProductWrapper productWrapper)
{
if (element == null || geometryElement == null)
return false;
IFCFile file = exporterIFC.GetFile();
using (IFCTransaction tr = new IFCTransaction(file))
{
using (IFCPlacementSetter placementSetter = IFCPlacementSetter.Create(exporterIFC, element, null, null, ExporterUtil.GetBaseLevelIdForElement(element)))
{
using (IFCExtrusionCreationData ecData = new IFCExtrusionCreationData())
{
ecData.SetLocalPlacement(placementSetter.GetPlacement());
ElementId categoryId = CategoryUtil.GetSafeCategoryId(element);
BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
IFCAnyHandle representation = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC, element,
categoryId, geometryElement, bodyExporterOptions, null, ecData, true);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(representation))
{
ecData.ClearOpenings();
return false;
}
string guid = GUIDUtil.CreateGUID(element);
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string revitObjectType = exporterIFC.GetFamilyName();
string name = NamingUtil.GetNameOverride(element, revitObjectType);
string description = NamingUtil.GetDescriptionOverride(element, null);
string objectType = NamingUtil.GetObjectTypeOverride(element, revitObjectType);
IFCAnyHandle localPlacement = ecData.GetLocalPlacement();
string elementTag = NamingUtil.GetTagOverride(element, NamingUtil.CreateIFCElementId(element));
IFCAnyHandle insulation = IFCInstanceExporter.CreateCovering(file, guid,
ownerHistory, name, description, objectType, localPlacement, representation, elementTag, IFCCoveringType.Insulation);
ExporterCacheManager.ElementToHandleCache.Register(element.Id, insulation);
productWrapper.AddElement(element, insulation, placementSetter.GetLevelInfo(), ecData, true);
ElementId matId = BodyExporter.GetBestMaterialIdFromGeometryOrParameter(geometryElement, exporterIFC, element);
CategoryUtil.CreateMaterialAssociation(exporterIFC, insulation, matId);
}
}
tr.Commit();
return true;
}
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:60, 代码来源:InsulationExporter.cs
示例12: Export
/// <summary>
/// Exports a wall swepp.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="wallSweep">The WallSwepp.</param>
/// <param name="geometryElement">The geometry element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
public static void Export(ExporterIFC exporterIFC, WallSweep wallSweep, GeometryElement geometryElement, ProductWrapper productWrapper)
{
WallSweepInfo wallSweepInfo = wallSweep.GetWallSweepInfo();
//Reveals are exported as openings with wall exporter.
if (wallSweepInfo.WallSweepType == WallSweepType.Reveal)
return;
if (!ProxyElementExporter.Export(exporterIFC, wallSweep, geometryElement, productWrapper))
return;
HostObjectExporter.ExportHostObjectMaterials(exporterIFC, wallSweep, productWrapper.GetAnElement(),
geometryElement, productWrapper,
ElementId.InvalidElementId, Toolkit.IFCLayerSetDirection.Axis2);
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:21, 代码来源:WallSweepExporter.cs
示例13: ExportDuctLining
/// <summary>
/// Exports an element as a covering of type insulation.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="element">The element.</param>
/// <param name="geometryElement">The geometry element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
/// <returns>True if exported successfully, false otherwise.</returns>
public static bool ExportDuctLining(ExporterIFC exporterIFC, Element element,
GeometryElement geometryElement, ProductWrapper productWrapper)
{
if (element == null || geometryElement == null)
return false;
IFCFile file = exporterIFC.GetFile();
using (IFCTransaction tr = new IFCTransaction(file))
{
using (IFCPlacementSetter placementSetter = IFCPlacementSetter.Create(exporterIFC, element))
{
using (IFCExtrusionCreationData ecData = new IFCExtrusionCreationData())
{
ecData.SetLocalPlacement(placementSetter.GetPlacement());
ElementId categoryId = CategoryUtil.GetSafeCategoryId(element);
BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
IFCAnyHandle representation = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC, element,
categoryId, geometryElement, bodyExporterOptions, null, ecData);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(representation))
{
ecData.ClearOpenings();
return false;
}
string guid = GUIDUtil.CreateGUID(element);
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string revitObjectType = exporterIFC.GetFamilyName();
string name = NamingUtil.GetNameOverride(element, revitObjectType);
string description = NamingUtil.GetDescriptionOverride(element, null);
string objectType = NamingUtil.GetObjectTypeOverride(element, revitObjectType);
IFCAnyHandle localPlacement = ecData.GetLocalPlacement();
string elementTag = NamingUtil.GetTagOverride(element, NamingUtil.CreateIFCElementId(element));
IFCAnyHandle ductLining = IFCInstanceExporter.CreateCovering(file, guid,
ownerHistory, name, description, objectType, localPlacement, representation, elementTag, IFCCoveringType.Wrapping);
productWrapper.AddElement(ductLining, placementSetter.GetLevelInfo(), ecData, LevelUtil.AssociateElementToLevel(element));
PropertyUtil.CreateInternalRevitPropertySets(exporterIFC, element, productWrapper);
}
}
tr.Commit();
return true;
}
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:58, 代码来源:DuctLiningExporter.cs
示例14: ExportBuildingElementProxy
/// <summary>
/// Exports an element as building element proxy.
/// </summary>
/// <remarks>
/// This function is called from the Export function, but can also be called directly if you do not
/// want CreateInternalPropertySets to be called.
/// </remarks>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="element">The element.</param>
/// <param name="geometryElement">The geometry element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
/// <returns>The handle if created, null otherwise.</returns>
public static IFCAnyHandle ExportBuildingElementProxy(ExporterIFC exporterIFC, Element element,
GeometryElement geometryElement, ProductWrapper productWrapper)
{
if (element == null || geometryElement == null)
return null;
IFCFile file = exporterIFC.GetFile();
IFCAnyHandle buildingElementProxy = null;
using (IFCTransaction tr = new IFCTransaction(file))
{
using (IFCPlacementSetter placementSetter = IFCPlacementSetter.Create(exporterIFC, element, null, null, ExporterUtil.GetBaseLevelIdForElement(element)))
{
using (IFCExtrusionCreationData ecData = new IFCExtrusionCreationData())
{
ecData.SetLocalPlacement(placementSetter.GetPlacement());
ElementId categoryId = CategoryUtil.GetSafeCategoryId(element);
BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
IFCAnyHandle representation = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC, element,
categoryId, geometryElement, bodyExporterOptions, null, ecData, true);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(representation))
{
ecData.ClearOpenings();
return null;
}
string guid = GUIDUtil.CreateGUID(element);
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string revitObjectType = exporterIFC.GetFamilyName();
string name = NamingUtil.GetNameOverride(element, revitObjectType);
string description = NamingUtil.GetDescriptionOverride(element, null);
string objectType = NamingUtil.GetObjectTypeOverride(element, revitObjectType);
IFCAnyHandle localPlacement = ecData.GetLocalPlacement();
string elementTag = NamingUtil.GetTagOverride(element, NamingUtil.CreateIFCElementId(element));
buildingElementProxy = IFCInstanceExporter.CreateBuildingElementProxy(file, guid,
ownerHistory, name, description, objectType, localPlacement, representation, elementTag, null);
productWrapper.AddElement(element, buildingElementProxy, placementSetter.GetLevelInfo(), ecData, true);
}
tr.Commit();
}
}
return buildingElementProxy;
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:61, 代码来源:ProxyElementExporter.cs
示例15: Export
/// <summary>
/// Exports mullion.
/// </summary>
/// <param name="exporterIFC">
/// The ExporterIFC object.
/// </param>
/// <param name="mullion">
/// The mullion object.
/// </param>
/// <param name="geometryElement">
/// The geometry element.
/// </param>
/// <param name="localPlacement">
/// The local placement handle.
/// </param>
/// <param name="setter">
/// The IFCPlacementSetter.
/// </param>
/// <param name="productWrapper">
/// The ProductWrapper.
/// </param>
public static void Export(ExporterIFC exporterIFC, Mullion mullion, GeometryElement geometryElement,
IFCAnyHandle localPlacement, IFCPlacementSetter setter, ProductWrapper productWrapper)
{
IFCFile file = exporterIFC.GetFile();
using (IFCPlacementSetter mullionSetter = IFCPlacementSetter.Create(exporterIFC, mullion, null, null, ExporterUtil.GetBaseLevelIdForElement(mullion)))
{
using (IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData())
{
IFCAnyHandle mullionPlacement = mullionSetter.GetPlacement();
Transform relTrf = ExporterIFCUtils.GetRelativeLocalPlacementOffsetTransform(localPlacement, mullionPlacement);
Transform inverseTrf = relTrf.Inverse;
IFCAnyHandle mullionRelativePlacement = ExporterUtil.CreateAxis2Placement3D(file, inverseTrf.Origin, inverseTrf.BasisZ, inverseTrf.BasisX);
IFCAnyHandle mullionLocalPlacement = IFCInstanceExporter.CreateLocalPlacement(file, localPlacement, mullionRelativePlacement);
extraParams.SetLocalPlacement(mullionLocalPlacement);
ElementId catId = CategoryUtil.GetSafeCategoryId(mullion);
BodyExporterOptions bodyExporterOptions = new BodyExporterOptions(true);
IFCAnyHandle repHnd = RepresentationUtil.CreateAppropriateProductDefinitionShape(exporterIFC, mullion, catId,
geometryElement, bodyExporterOptions, null, extraParams, true);
if (IFCAnyHandleUtil.IsNullOrHasNoValue(repHnd))
{
extraParams.ClearOpenings();
return;
}
string elemGUID = GUIDUtil.CreateGUID(mullion);
IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();
string elemObjectType = NamingUtil.CreateIFCObjectName(exporterIFC, mullion);
string name = NamingUtil.GetNameOverride(mullion, elemObjectType);
string description = NamingUtil.GetDescriptionOverride(mullion, null);
string objectType = NamingUtil.GetObjectTypeOverride(mullion, elemObjectType);
string elemTag = NamingUtil.GetTagOverride(mullion, NamingUtil.CreateIFCElementId(mullion));
IFCAnyHandle mullionHnd = IFCInstanceExporter.CreateMember(file, elemGUID, ownerHistory, name, description, objectType,
mullionLocalPlacement, repHnd, elemTag);
ExporterCacheManager.HandleToElementCache.Register(mullionHnd, mullion.Id);
productWrapper.AddElement(mullion, mullionHnd, mullionSetter, extraParams, false);
ElementId matId = BodyExporter.GetBestMaterialIdFromGeometryOrParameter(geometryElement, exporterIFC, mullion);
CategoryUtil.CreateMaterialAssociation(exporterIFC, mullionHnd, matId);
}
}
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:70, 代码来源:MullionExporter.cs
示例16: ExportHostPart
/// <summary>
/// Export all the parts of the host element.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="hostElement">The host element having parts to export.</param>
/// <param name="hostHandle">The host element handle.</param>
/// <param name="originalWrapper">The ProductWrapper object.</param>
public static void ExportHostPart(ExporterIFC exporterIFC, Element hostElement, IFCAnyHandle hostHandle,
ProductWrapper originalWrapper, IFCPlacementSetter placementSetter, IFCAnyHandle originalPlacement, ElementId overrideLevelId)
{
using (ProductWrapper subWrapper = ProductWrapper.Create(exporterIFC, true))
{
List<ElementId> associatedPartsList = PartUtils.GetAssociatedParts(hostElement.Document, hostElement.Id, false, true).ToList();
if (associatedPartsList.Count == 0)
return;
bool isWallOrColumn = IsHostWallOrColumn(exporterIFC, hostElement);
bool hasOverrideLevel = overrideLevelId != null && overrideLevelId != ElementId.InvalidElementId;
IFCExtrusionAxes ifcExtrusionAxes = GetDefaultExtrusionAxesForHost(exporterIFC, hostElement);
// Split parts if wall or column is split by level, and then export; otherwise, export parts normally.
if (isWallOrColumn && hasOverrideLevel && ExporterCacheManager.ExportOptionsCache.WallAndColumnSplitting)
{
if (!ExporterCacheManager.HostPartsCache.HasRegistered(hostElement.Id))
SplitParts(exporterIFC, hostElement, associatedPartsList); // Split parts and associate them with host.
// Find and export the parts that are split by specific level.
List<KeyValuePair<Part, IFCRange>> splitPartRangeList = new List<KeyValuePair<Part, IFCRange>>();
splitPartRangeList = ExporterCacheManager.HostPartsCache.Find(hostElement.Id, overrideLevelId);
foreach (KeyValuePair<Part, IFCRange> partRange in splitPartRangeList)
{
PartExporter.ExportPart(exporterIFC, partRange.Key, subWrapper, placementSetter, originalPlacement, partRange.Value, ifcExtrusionAxes, hostElement, overrideLevelId, false);
}
}
else
{
foreach (ElementId partId in associatedPartsList)
{
Part part = hostElement.Document.GetElement(partId) as Part;
PartExporter.ExportPart(exporterIFC, part, subWrapper, placementSetter, originalPlacement, null, ifcExtrusionAxes, hostElement, overrideLevelId, false);
}
}
// Create the relationship of Host and Parts.
ICollection<IFCAnyHandle> relatedElementIds = subWrapper.GetAllObjects();
if (relatedElementIds.Count > 0)
{
string guid = GUIDUtil.CreateGUID();
HashSet<IFCAnyHandle> relatedElementIdSet = new HashSet<IFCAnyHandle>(relatedElementIds);
IFCInstanceExporter.CreateRelAggregates(exporterIFC.GetFile(), guid, exporterIFC.GetOwnerHistoryHandle(), null, null, hostHandle, relatedElementIdSet);
}
}
}
开发者ID:whztt07, 项目名称:RevitCustomIFCexporter, 代码行数:55, 代码来源:PartExporter.cs
示例17: ExportCovering
/// <summary>
/// Exports an element as IFC covering.
/// </summary>
/// <param name="exporterIFC">
/// The ExporterIFC object.
/// </param>
/// <param name="element">
/// The element to be exported.
/// </param>
/// <param name="geometryElement">
/// The geometry element.
/// </param>
/// <param name="productWrapper">
/// The ProductWrapper.
/// </param>
public static void ExportCovering(ExporterIFC exporterIFC, Element element, GeometryElement geomElem, string ifcEnumType, ProductWrapper productWrapper)
{
bool exportParts = PartExporter.CanExportParts(element);
if (exportParts && !PartExporter.CanExportElementInPartExport(element, element.Level.Id, false))
return;
ElementType elemType = element.Document.GetElement(element.GetTypeId()) as ElementType;
IFCFile file = exporterIFC.GetFile();
using (IFCTransaction transaction = new IFCTransaction(file))
{
using (IFCPlacementSetter setter = IFCPlacementSetter.Create(exporterIFC, element))
{
IFCAnyHandle prodRep = exportParts ? null : RepresentationUtil.CreateSurfaceProductDefinitionShape(exporterIFC,
element, geomElem, false, false);
string instanceGUID = GUIDUtil.CreateGUID(element);
string instanceName = NamingUtil.GetIFCName(element);
string instanceDescription = NamingUtil.GetDescriptionOverride(element, null);
string instanceObjectType = NamingUtil.GetObjectTypeOverride(element, exporterIFC.GetFamilyName());
string instanceElemId = NamingUtil.CreateIFCElementId(element);
Toolkit.IFCCoveringType coveringType = GetIFCCoveringType(element, ifcEnumType);
IFCAnyHandle covering = IFCInstanceExporter.CreateCovering(file, instanceGUID, exporterIFC.GetOwnerHistoryHandle(),
instanceName, instanceDescription, instanceObjectType, setter.GetPlacement(), prodRep, instanceElemId, coveringType);
if (exportParts)
{
PartExporter.ExportHostPart(exporterIFC, element, covering, productWrapper, setter, setter.GetPlacement(), null);
}
productWrapper.AddElement(covering, setter, null, LevelUtil.AssociateElementToLevel(element));
Ceiling ceiling = element as Ceiling;
if (ceiling != null && !exportParts)
{
HostObjectExporter.ExportHostObjectMaterials(exporterIFC, ceiling, covering,
geomElem, productWrapper, ElementId.InvalidElementId, Toolkit.IFCLayerSetDirection.Axis3);
}
if (ExporterCacheManager.ExportOptionsCache.PropertySetOptions.ExportIFCCommon)
ExporterIFCUtils.CreateCoveringPropertySet(exporterIFC, element, productWrapper.ToNative());
PropertyUtil.CreateInternalRevitPropertySets(exporterIFC, element, productWrapper);
}
transaction.Commit();
}
}
开发者ID:stiter, 项目名称:ifcexporter, 代码行数:62, 代码来源:CeilingExporter.cs
六六分期app的软件客服如何联系?不知道吗?加qq群【895510560】即可!标题:六六分期
阅读:19143| 2023-10-27
今天小编告诉大家如何处理win10系统火狐flash插件总是崩溃的问题,可能很多用户都不知
阅读:9973| 2022-11-06
今天小编告诉大家如何对win10系统删除桌面回收站图标进行设置,可能很多用户都不知道
阅读:8317| 2022-11-06
今天小编告诉大家如何对win10系统电脑设置节能降温的设置方法,想必大家都遇到过需要
阅读:8686| 2022-11-06
我们在使用xp系统的过程中,经常需要对xp系统无线网络安装向导设置进行设置,可能很多
阅读:8627| 2022-11-06
今天小编告诉大家如何处理win7系统玩cf老是与主机连接不稳定的问题,可能很多用户都不
阅读:9643| 2022-11-06
电脑对日常生活的重要性小编就不多说了,可是一旦碰到win7系统设置cf烟雾头的问题,很
阅读:8611| 2022-11-06
我们在日常使用电脑的时候,有的小伙伴们可能在打开应用的时候会遇见提示应用程序无法
阅读:7991| 2022-11-06
今天小编告诉大家如何对win7系统打开vcf文件进行设置,可能很多用户都不知道怎么对win
阅读:8642| 2022-11-06
今天小编告诉大家如何对win10系统s4开启USB调试模式进行设置,可能很多用户都不知道怎
阅读:7527| 2022-11-06
请发表评论