/// <summary> /// Validates the values to be set to IfcRelAssigns. /// </summary> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> private static void ValidateRelAssigns(string guid, IFCAnyHandle ownerHistory, string name, string description, ICollection<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType) { if (ExporterCacheManager.ExportOptionsCache.ExportAs2x2) IFCAnyHandleUtil.ValidateSubTypeOf(relatedObjects, false, IFCEntityType.IfcObject); else IFCAnyHandleUtil.ValidateSubTypeOf(relatedObjects, false, IFCEntityType.IfcObjectDefinition); ValidateRelationship(guid, ownerHistory, name, description); }
/// <summary> /// Sets attributes to IfcRelAssigns. /// </summary> /// <param name="relAssigns">The IfcRelAssigns.</param> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> private static void SetRelAssigns(IFCAnyHandle relAssigns, string guid, IFCAnyHandle ownerHistory, string name, string description, ISet<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType) { IFCAnyHandleUtil.SetAttribute(relAssigns, "RelatedObjects", relatedObjects); IFCAnyHandleUtil.SetAttribute(relAssigns, "RelatedObjectsType", relatedObjectsType); SetRelationship(relAssigns, guid, ownerHistory, name, description); }
/// <summary> /// Creates a handle representing an IfcRelOccupiesSpaces and assigns it to the file. /// </summary> /// <param name="file">The file.</param> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> /// <param name="relatingActor">The actor.</param> /// <param name="actingRole">The role of the actor.</param> /// <returns>The handle.</returns> /// <remarks>Note that this has been obsoleted in IFC4, and replaced by IfcRelAssignsToActor.</remarks> public static IFCAnyHandle CreateRelOccupiesSpaces(IFCFile file, string guid, IFCAnyHandle ownerHistory, string name, string description, HashSet<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType, IFCAnyHandle relatingActor, IFCAnyHandle actingRole) { if (ExporterCacheManager.ExportOptionsCache.ExportAs4) return CreateRelAssignsToActor(file, guid, ownerHistory, name, description, relatedObjects, relatedObjectsType, relatingActor, actingRole); ValidateRelAssignsToActor(guid, ownerHistory, name, description, relatedObjects, relatedObjectsType, relatingActor, actingRole); IFCAnyHandle relOccupiesSpaces = CreateInstance(file, IFCEntityType.IfcRelOccupiesSpaces); SetRelAssignsToActor(relOccupiesSpaces, guid, ownerHistory, name, description, relatedObjects, relatedObjectsType, relatingActor, actingRole); return relOccupiesSpaces; }
/// <summary> /// Creates a handle representing an IfcRelAssignsToActor and assigns it to the file. /// </summary> /// <param name="file">The file.</param> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> /// <param name="relatingActor">Reference to the information about the actor.</param> /// <param name="actingRole">Role of the actor played within the context of the assignment to the object(s).</param> /// <returns>The handle.</returns> public static IFCAnyHandle CreateRelAssignsToActor(IFCFile file, string guid, IFCAnyHandle ownerHistory, string name, string description, ISet<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType, IFCAnyHandle relatingActor, IFCAnyHandle actingRole) { IFCAnyHandleUtil.ValidateSubTypeOf(relatingActor, false, IFCEntityType.IfcActor); IFCAnyHandleUtil.ValidateSubTypeOf(actingRole, true, IFCEntityType.IfcActorRole); ValidateRelAssigns(guid, ownerHistory, name, description, relatedObjects, relatedObjectsType); IFCAnyHandle relAssignsToActor = CreateInstance(file, IFCEntityType.IfcRelAssignsToActor); IFCAnyHandleUtil.SetAttribute(relAssignsToActor, "RelatingActor", relatingActor); IFCAnyHandleUtil.SetAttribute(relAssignsToActor, "ActingRole", actingRole); SetRelAssigns(relAssignsToActor, guid, ownerHistory, name, description, relatedObjects, relatedObjectsType); return relAssignsToActor; }
/// <summary> /// Creates a handle representing an IfcRelAssignsToGroup and assigns it to the file. /// </summary> /// <param name="file">The file.</param> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> /// <param name="relatingGroup">Reference to group that finally contains all assigned group members.</param> /// <returns>The handle.</returns> public static IFCAnyHandle CreateRelAssignsToGroup(IFCFile file, string guid, IFCAnyHandle ownerHistory, string name, string description, ISet<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType, IFCAnyHandle relatingGroup) { IFCAnyHandleUtil.ValidateSubTypeOf(relatingGroup, false, IFCEntityType.IfcGroup); ValidateRelAssigns(guid, ownerHistory, name, description, relatedObjects, relatedObjectsType); IFCAnyHandle relAssignsToGroup = CreateInstance(file, IFCEntityType.IfcRelAssignsToGroup); IFCAnyHandleUtil.SetAttribute(relAssignsToGroup, "RelatingGroup", relatingGroup); SetRelAssigns(relAssignsToGroup, guid, ownerHistory, name, description, relatedObjects, relatedObjectsType); return relAssignsToGroup; }
/// <summary> /// Sets attributes to IfcRelAssignsToActor. /// </summary> /// <param name="relActor">The IfcRelAssignsToActor.</param> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> /// <param name="relatingActor">The actor.</param> /// <param name="actingRole">The role of the actor.</param> private static void SetRelAssignsToActor(IFCAnyHandle relActor, string guid, IFCAnyHandle ownerHistory, string name, string description, HashSet<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType, IFCAnyHandle relatingActor, IFCAnyHandle actingRole) { IFCAnyHandleUtil.SetAttribute(relActor, "RelatingActor", relatingActor); IFCAnyHandleUtil.SetAttribute(relActor, "ActingRole", actingRole); SetRelAssigns(relActor, guid, ownerHistory, name, description, relatedObjects, relatedObjectsType); }
/// <summary> /// Validates the values to be set to IfcRelAssignsToActor. /// </summary> /// <param name="guid">The GUID.</param> /// <param name="ownerHistory">The owner history.</param> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="relatedObjects">Related objects, which are assigned to a single object.</param> /// <param name="relatedObjectsType">Particular type of the assignment relationship.</param> /// <param name="relatingActor">The actor.</param> /// <param name="actingRole">The role of the actor.</param> private static void ValidateRelAssignsToActor(string guid, IFCAnyHandle ownerHistory, string name, string description, HashSet<IFCAnyHandle> relatedObjects, IFCObjectType? relatedObjectsType, IFCAnyHandle relatingActor, IFCAnyHandle actingRole) { IFCAnyHandleUtil.ValidateSubTypeOf(relatingActor, false, IFCEntityType.IfcActor); IFCAnyHandleUtil.ValidateSubTypeOf(actingRole, true, IFCEntityType.IfcActorRole); ValidateRelAssigns(guid, ownerHistory, name, description, relatedObjects, relatedObjectsType); }