Skip to content

Commit

Permalink
Implemented IFC4x3 properties #6
Browse files Browse the repository at this point in the history
Removed net5 support (now EOL) and replaced with netstandard2.1 & net6
  • Loading branch information
andyward committed Dec 30, 2022
1 parent 8ebcae4 commit 1208531
Show file tree
Hide file tree
Showing 766 changed files with 64,146 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Xbim.Properties/DataType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ public enum DataTypeEnum
IfcThermalResistanceMeasure,
IfcThermalTransmittanceMeasure,
IfcTorqueMeasure,
IfcURIReference,
IfcVaporPermeabilityMeasure,
IfcVolumetricFlowRateMeasure,
IfcWarpingConstantMeasure,
IfcWarpingMomentMeasure
IfcWarpingMomentMeasure,
}
}
32 changes: 27 additions & 5 deletions Xbim.Properties/Definitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.Linq;
using System.Resources;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
Expand All @@ -30,6 +31,7 @@ public Definitions(Version version)
_version = version;
switch (version)
{

case Version.IFC4:
var ns = "";
if (typeof (T) == typeof (PropertySetDef))
Expand All @@ -41,6 +43,9 @@ public Definitions(Version version)
case Version.IFC2x3:
_serializer = new XmlSerializer(typeof (T));
break;
case Version.IFC4x3:
_serializer = new XmlSerializer(typeof(T));
break;
}
}

Expand Down Expand Up @@ -191,21 +196,37 @@ public void LoadAllDefault()
: Definitions.IFC4_Definition_files.ResourceManager;
}

if (_version == Version.IFC4x3)
{
mgr = typeof(T) == typeof(QtoSetDef)
? Definitions.IFC4x3_QTO_Definition_files.ResourceManager
: Definitions.IFC4x3_Definition_files.ResourceManager;
}

if (mgr == null)
throw new Exception("No default content defined for this combination of version and property type");

var resources = mgr.GetResourceSet(CultureInfo.InvariantCulture, true, true);
foreach (var value in from DictionaryEntry entry in resources select entry.Value as string)
foreach (var entry in from DictionaryEntry entry in resources select entry)
{
var value = entry.Value as string;
if (value == null) throw new Exception("Invalid input data");
var reader = new StringReader(value);
Load(reader);
try
{

Load(reader);
}
catch(Exception ex)
{
throw new InvalidOperationException($"Failed to Deserialise '{entry.Key}' file", ex);
}
}
}

public void LoadIFC4COBie()
{
if (_version != Version.IFC4)
if (_version != Version.IFC4 && _version != Version.IFC4x3)
throw new Exception("IFC4 COBie properties can only be loaded if this set is defined to be IFC4.");
var resources =
Definitions.IFC4_COBie_Definition_files.ResourceManager.GetResourceSet(CultureInfo.InvariantCulture,
Expand All @@ -220,7 +241,7 @@ public void LoadIFC4COBie()

public void LoadIFC4AndCOBie()
{
if (_version != Version.IFC4)
if (_version != Version.IFC4 && _version != Version.IFC4x3)
throw new Exception("IFC4 COBie properties can only be loaded if this set is defined to be IFC4.");
var resources =
Definitions.IFC4_and_COBie_Definition_files.ResourceManager.GetResourceSet(CultureInfo.InvariantCulture,
Expand All @@ -237,6 +258,7 @@ public void LoadIFC4AndCOBie()
public enum Version
{
IFC2x3,
IFC4
IFC4,
IFC4x3
}
}
38 changes: 38 additions & 0 deletions Xbim.Properties/Definitions/IFC4x3/Pset_ActionRequest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" ?>
<PropertySetDef templatetype="PSET_OCCURRENCEDRIVEN" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://buildingSMART-tech.org/xml/psd/PSD_IFC4.xsd">
<IfcVersion version="IFC4X3"/>
<Name>Pset_ActionRequest</Name>
<Definition>An action request is a request for an action to fulfill a need. HISTORY: IFC4: Removed RequestSourceType, RequestDescription, Status</Definition>
<Applicability/>
<ApplicableClasses>
<ClassName>IfcActionRequest</ClassName>
</ApplicableClasses>
<ApplicableTypeValue>IfcActionRequest</ApplicableTypeValue>
<PropertyDefs>
<PropertyDef>
<Name>RequestSourceLabel</Name>
<Definition>A specific name or label that further qualifies the identity of a request source. In the event of an email, this may be the email address.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcLabel"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>RequestSourceName</Name>
<Definition>The person making the request, where known.</Definition>
<PropertyType>
<TypePropertyReferenceValue reftype="IfcPerson"/>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>RequestComments</Name>
<Definition>Comments that may be made on the request.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcText"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
</PropertyDefs>
</PropertySetDef>
40 changes: 40 additions & 0 deletions Xbim.Properties/Definitions/IFC4x3/Pset_ActorCommon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" ?>
<PropertySetDef templatetype="PSET_OCCURRENCEDRIVEN" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://buildingSMART-tech.org/xml/psd/PSD_IFC4.xsd">
<IfcVersion version="IFC4X3"/>
<Name>Pset_ActorCommon</Name>
<Definition>A property set that enables further classification of actors, including the ability to give a number of actors to be designated as a population, the number being specified as a property to be dealt with as a single value rather than having to aggregate a number of instances of IfcActor.</Definition>
<Applicability/>
<ApplicableClasses>
<ClassName>IfcActor</ClassName>
</ApplicableClasses>
<ApplicableTypeValue>IfcActor</ApplicableTypeValue>
<PropertyDefs>
<PropertyDef>
<Name>NumberOfActors</Name>
<Definition>The number of actors that are to be dealt with together in the population.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcCountMeasure"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>ActorCategory</Name>
<Definition>Designation of the category into which the actors in the population belong.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcLabel"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>SkillLevel</Name>
<Definition>Skill level exhibited by the actor and which indicates an extent of their capability to perform actions on the artefacts upon which they can act.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcLabel"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
</PropertyDefs>
</PropertySetDef>
34 changes: 34 additions & 0 deletions Xbim.Properties/Definitions/IFC4x3/Pset_ActuatorPHistory.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" ?>
<PropertySetDef templatetype="PSET_PERFORMANCEDRIVEN" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://buildingSMART-tech.org/xml/psd/PSD_IFC4.xsd">
<IfcVersion version="IFC4X3"/>
<Name>Pset_ActuatorPHistory</Name>
<Definition>Properties for history of actuators.HISTORY Added in IFC4.</Definition>
<Applicability/>
<ApplicableClasses>
<ClassName>IfcActuator</ClassName>
</ApplicableClasses>
<ApplicableTypeValue>IfcActuator</ApplicableTypeValue>
<PropertyDefs>
<PropertyDef>
<Name>PositionHistory</Name>
<Definition>Indicates position of the actuator over time where 0.0 is fully closed and 1.0 is fully open.</Definition>
<PropertyType>
<TypePropertyReferenceValue reftype="IfcTimeSeries"/>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>QualityHistory</Name>
<Definition>Indicates the quality of measurement or failure condition, which may be further qualified by the Status. True: measured values are considered reliable; False: measured values are considered not reliable (i.e. a fault has been detected); Unknown: reliability of values is uncertain.</Definition>
<PropertyType>
<TypePropertyReferenceValue reftype="IfcTimeSeries"/>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>StatusHistory</Name>
<Definition>Indicates an error code or identifier, whose meaning is specific to the particular automation system. Example values include: 'ConfigurationError', 'NotConnected', 'DeviceFailure', 'SensorFailure', 'LastKnown, 'CommunicationsFailure', 'OutOfService'.</Definition>
<PropertyType>
<TypePropertyReferenceValue reftype="IfcTimeSeries"/>
</PropertyType>
</PropertyDef>
</PropertyDefs>
</PropertySetDef>
83 changes: 83 additions & 0 deletions Xbim.Properties/Definitions/IFC4x3/Pset_ActuatorTypeCommon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" ?>
<PropertySetDef templatetype="PSET_TYPEDRIVENOVERRIDE" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://buildingSMART-tech.org/xml/psd/PSD_IFC4.xsd">
<IfcVersion version="IFC4X3"/>
<Name>Pset_ActuatorTypeCommon</Name>
<Definition>Actuator type common attributes.</Definition>
<Applicability/>
<ApplicableClasses>
<ClassName>IfcActuator</ClassName>
<ClassName>IfcActuatorType</ClassName>
</ApplicableClasses>
<ApplicableTypeValue>IfcActuator,IfcActuatorType</ApplicableTypeValue>
<PropertyDefs>
<PropertyDef>
<Name>Reference</Name>
<Definition>Reference ID for this specified type in this project (e.g. type 'A-1'), Also referred to as &quot;construction type&quot;. It should be provided as an alternative to the name of the &quot;object type&quot;, if the software does not support object types and no classification reference to a recognized classification system used.IFC4.3.0.0 DEPRECATION The Reference property is deprecated and shall no longer be used, use attribute Name on the relating type instead.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcIdentifier"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>ActuatorStatus</Name>
<Definition>Status of the element, predominately used in renovation or retrofitting projects. The status can be assigned to as &quot;New&quot; - element designed as new addition, &quot;Existing&quot; - element exists and remains, &quot;Demolish&quot; - element existed but is to be demolished, &quot;Temporary&quot; - element will exists only temporary (like a temporary support structure).</Definition>
<PropertyType>
<TypePropertyEnumeratedValue>
<EnumList name="PEnum_ElementStatus">
<EnumItem>DEMOLISH</EnumItem>
<EnumItem>EXISTING</EnumItem>
<EnumItem>NEW</EnumItem>
<EnumItem>TEMPORARY</EnumItem>
<EnumItem>OTHER</EnumItem>
<EnumItem>NOTKNOWN</EnumItem>
<EnumItem>UNSET</EnumItem>
</EnumList>
</TypePropertyEnumeratedValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>FailPosition</Name>
<Definition>Specifies the required fail-safe position of the actuator.</Definition>
<PropertyType>
<TypePropertyEnumeratedValue>
<EnumList name="PEnum_FailPosition">
<EnumItem>FAILCLOSED</EnumItem>
<EnumItem>FAILOPEN</EnumItem>
<EnumItem>OTHER</EnumItem>
<EnumItem>NOTKNOWN</EnumItem>
<EnumItem>UNSET</EnumItem>
</EnumList>
</TypePropertyEnumeratedValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>ManualOverride</Name>
<Definition>Identifies whether hand-operated operation is provided as an override (= TRUE) or not (= FALSE). Note that this value should be set to FALSE by default in the case of a Hand Operated Actuator.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcBoolean"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>ActuatorApplication</Name>
<Definition>Indicates application of actuator.</Definition>
<PropertyType>
<TypePropertyEnumeratedValue>
<EnumList name="PEnum_ActuatorApplication">
<EnumItem>DAMPERACTUATOR</EnumItem>
<EnumItem>ENTRYEXITDEVICE</EnumItem>
<EnumItem>FIRESMOKEDAMPERACTUATOR</EnumItem>
<EnumItem>LAMPACTUATOR</EnumItem>
<EnumItem>SUNBLINDACTUATOR</EnumItem>
<EnumItem>VALVEPOSITIONER</EnumItem>
<EnumItem>OTHER</EnumItem>
<EnumItem>NOTKNOWN</EnumItem>
<EnumItem>UNSET</EnumItem>
</EnumList>
</TypePropertyEnumeratedValue>
</PropertyType>
</PropertyDef>
</PropertyDefs>
</PropertySetDef>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" ?>
<PropertySetDef templatetype="PSET_TYPEDRIVENOVERRIDE" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://buildingSMART-tech.org/xml/psd/PSD_IFC4.xsd">
<IfcVersion version="IFC4X3"/>
<Name>Pset_ActuatorTypeElectricActuator</Name>
<Definition>A device that electrically actuates a control element.</Definition>
<Applicability/>
<ApplicableClasses>
<ClassName>IfcActuator/ELECTRICACTUATOR</ClassName>
<ClassName>IfcActuatorType/ELECTRICACTUATOR</ClassName>
</ApplicableClasses>
<ApplicableTypeValue>IfcActuator/ELECTRICACTUATOR,IfcActuatorType/ELECTRICACTUATOR</ApplicableTypeValue>
<PropertyDefs>
<PropertyDef>
<Name>ActuatorInputPower</Name>
<Definition>Maximum input power requirement.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcPowerMeasure"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>ElectricActuatorType</Name>
<Definition>Enumeration that identifies electric actuator as defined by its operational principle.</Definition>
<PropertyType>
<TypePropertyEnumeratedValue>
<EnumList name="PEnum_ElectricActuatorType">
<EnumItem>MAGNETIC</EnumItem>
<EnumItem>MOTORDRIVE</EnumItem>
<EnumItem>OTHER</EnumItem>
<EnumItem>NOTKNOWN</EnumItem>
<EnumItem>UNSET</EnumItem>
</EnumList>
</TypePropertyEnumeratedValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>ControlPulseCurrent</Name>
<Definition>The current of the electric actuator control pulse.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcElectricCurrentMeasure"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
</PropertyDefs>
</PropertySetDef>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<PropertySetDef templatetype="PSET_TYPEDRIVENOVERRIDE" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://buildingSMART-tech.org/xml/psd/PSD_IFC4.xsd">
<IfcVersion version="IFC4X3"/>
<Name>Pset_ActuatorTypeHydraulicActuator</Name>
<Definition>A device that hydraulically actuates a control element.</Definition>
<Applicability/>
<ApplicableClasses>
<ClassName>IfcActuator/HYDRAULICACTUATOR</ClassName>
<ClassName>IfcActuatorType/HYDRAULICACTUATOR</ClassName>
</ApplicableClasses>
<ApplicableTypeValue>IfcActuator/HYDRAULICACTUATOR,IfcActuatorType/HYDRAULICACTUATOR</ApplicableTypeValue>
<PropertyDefs>
<PropertyDef>
<Name>InputPressure</Name>
<Definition>Maximum input or design pressure for the object.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcPressureMeasure"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
<PropertyDef>
<Name>InputFlowrate</Name>
<Definition>Maximum input flowrate requirement.</Definition>
<PropertyType>
<TypePropertySingleValue>
<DataType type="IfcVolumetricFlowRateMeasure"/>
</TypePropertySingleValue>
</PropertyType>
</PropertyDef>
</PropertyDefs>
</PropertySetDef>
Loading

0 comments on commit 1208531

Please sign in to comment.