Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

IFC rules

alemanda
Advocate
I'd like to define a new preset IFC rule creating new IFC properties and filling it with some preset data.
I saw some coding into the preset IFC rules defined in AC out of the box but I didn't find a "simple & readable" example of xml coding for new IFC properties.

For example I'd like to fill the field IFC "description" with a text using a custom made db properly coded as per IFC syntax

Is it possible?
Where can I find documentation on the IFC syntax and coding?

Thanks for any support

ifc new preset rule.jpg
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
8 REPLIES 8
alemanda
Advocate
Ok ... seems it working in this way ...
In this way, applying your preset rule archicad creates a new property set.
  • <Data>
    <DataEntries>
    <DataEntry>
    <DataEntry chapter="my chapter" number="my code" title="my title"/>
    </DataEntry>
    </DataEntries>
    </Data>
    <Script>
    <CreatePropertySingleValue>
    <IfcPropertySet Name="spec_ref">
    <IfcPropertySingleValue Name="A_Spec Division" ValueType="IfcLabel" Value="$chapter" />
    <IfcPropertySingleValue Name="B_Spec code" ValueType="IfcLabel" Value="$number" />
    <IfcPropertySingleValue Name="D_Spec title" ValueType="IfcLabel" Value="$title" />
    <IfcPropertySingleValue Name="C_BOQ ref" ValueType="IfcLabel" Value="*** add your BOQ reference here" />
    <IfcPropertySingleValue Name="E_Spec text" ValueType="IfcText" Value="*** add your text here" />
    </IfcPropertySet>
    </CreatePropertySingleValue>
    </Script>
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
Laszlo Nagy
Community Admin
Community Admin
Wow, it does work. Actually, what I did not know is if there is any command in the Script section of the XML file that can do this. I did not find any info on it during my search on the Internet. How did you know that this is the syntax you need to use?

Actually, I have modified your XML a bit so ARCHICAD will recognize it as a proper Rule file when placed in the IFC Rules folder. You may have to restart ARCHICAD after placing it in the IFC Rules folder. (Copy-paste the code to a Text Editor and save it as XML format.)
Here it is:

<?xml version="1.0" encoding="utf-8"?>
<Rules Name="MyCODE">
	<Rule>
		<Name>MyCODE Test Classification
		</Name>
		<Description>This is a test calssification.
		</Description>
		<ApplicableTo>
			<ClassName>IfcObject</ClassName>
			<ClassName>IfcTypeObject</ClassName>
		</ApplicableTo>
		<Data>
			<DataDescriptors>
				<DataDescriptor Variable="chapter" Title="Chapter" />
				<DataDescriptor Variable="number" Title="Number" />
				<DataDescriptor Variable="title" Title="Title" />
			</DataDescriptors>
			<DataEntries> 
				<DataEntry chapter="my chapter" number="my code" title="my title"/>
			</DataEntries> 
		</Data> 
		<Script> 
			<CreatePropertySingleValue> 
				<IfcPropertySet Name="spec_ref"> 
					<IfcPropertySingleValue Name="A_Spec Division" ValueType="IfcLabel" Value="$chapter" /> 
					<IfcPropertySingleValue Name="B_Spec code" ValueType="IfcLabel" Value="$number" /> 
					<IfcPropertySingleValue Name="D_Spec title" ValueType="IfcLabel" Value="$title" /> 
					<IfcPropertySingleValue Name="C_BOQ ref" ValueType="IfcLabel" Value="*** add your BOQ reference here" /> 
					<IfcPropertySingleValue Name="E_Spec text" ValueType="IfcText" Value="*** add your text here" /> 
				</IfcPropertySet> 
			</CreatePropertySingleValue> 
		</Script>
	</Rule>
</Rules>


For anyone else trying to understand this:
So basically you can apply a predefined rule which will create any number of IFC Properties, and even the IFC Property Set they should be placed under.
The only limitation I see here at the moment is that this cannot be done in the IFC Scheme Setup Dialog. You have to select the elements you wish to add the IFC Properties to, go to their Settings Dialog, click the Manage IFC Properties button, click the Apply Predefined Rule button, then select your Rule set file and select the Rule to apply. The Rule will create the IFC Property Set and IFC Properties.

I am wondering whether you have actually found a way to do something in ARCHICAD no one has thought of before.
In any case, great job.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
alemanda
Advocate
Laszlo,
I just read the xml files provided with archicad and tried to modify as a adapt to my needs.
Accordingly, as you know, I made my master spec rules.

IFC has great potentiality for documentation.

I'd need a readable guide to IFC Syntax coding.
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
alemanda
Advocate
laszlonagy wrote:
...
The only limitation I see here at the moment is that this cannot be done in the IFC Scheme Setup Dialog. ...
The property set can be define in the IFC scheme. I mean you can create the fields for all the element or for some type of elements ... but those fields will be empty

The fantastic thing that you achieve with preset rule is that you can fill those fields, creating (if they are not present in the scheme) or not (if they are already in the scheme).
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
Laszlo Nagy
Community Admin
Community Admin
What I meant is that in the IFC Scheme Setup Dialog it is not possible to apply a Predefined Rule and thereby add an IFC Property Set and IFC Properties to a selected level of the IFC Type hierarchy. This can only be done manually, typing each IFC Property manually.

Actually, now that I am thinking about it, this is something that can be done using IFC Schemes. You just simply need to Clear All Scheme Settings in a new project file, then create the IFC Property Set and Properties at the desired level of the IFC type hierarchy and Export this as an IFC Scheme to an XML file. The created XML file will contain only the custom IFC Properties you have created.

Here is a sample of an XML. This XML, when merged in the IFC Scheme Setup Dialog, will create an IFC Property Group named "NL_Set" at the IfcWall level of the IFC Hierarchy, and create 3 IFC Properties as well: "MyProperty1", "MyProperty2", and "MyProperty3":

<?xml version="1.0" encoding="UTF-8"?>
<SchemeItemList>
	<SchemeProperty IFCEntityType="IfcWall" PropertySetName="NL_Set">
		<PropertyDef>
			<Name>MyProperty1</Name>
			<PropertyType>
				<TypePropertySingleValue>
					<DataType type="IFCLABEL"/>
				</TypePropertySingleValue>
			</PropertyType>
		</PropertyDef>
	</SchemeProperty>
	<SchemeProperty IFCEntityType="IfcWall" PropertySetName="NL_Set">
		<PropertyDef>
			<Name>MyProperty2</Name>
			<PropertyType>
				<TypePropertySingleValue>
					<DataType type="IFCLABEL"/>
				</TypePropertySingleValue>
			</PropertyType>
		</PropertyDef>
	</SchemeProperty>
	<SchemeProperty IFCEntityType="IfcWall" PropertySetName="NL_Set">
		<PropertyDef>
			<Name>MyProperty3</Name>
			<PropertyType>
				<TypePropertySingleValue>
					<DataType type="IFCLABEL"/>
				</TypePropertySingleValue>
			</PropertyType>
		</PropertyDef>
	</SchemeProperty>
</SchemeItemList>

So you could create one or multiple such XML files. Whenever you need those Properties for all your Walls, you just merge the corresponding IFC Scheme XML file containing those IFC Property definitions (and their default values, if needed).
Maybe it is a good idea to have a separate IFC Scheme XML file for each separate level of the IFC type hierarchy that contains all possible IFc Properties you might need in that level (e.g. IfcWall or IfcElement). Then it is very easy to delete the ones you don't need. Much easier then adding them manually, anyway.
So this may be another thing you can consider.

Your IFC Rules XML solution is good when you need to add IFC Properties only to selected elements.
The IFC Scheme XML solution is good when you need to add IFC Properties to all elements belonging to an IFC type.

By the way, I suspect the syntax of these XML files may have been created by Graphisoft, not BuildingSMART. Maybe this is why we don't find documentation on it in the Internet.
I will ask them if this is the case and if the XML structures and possible Script commands can be made available.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
alemanda
Advocate
Yes Laszlo,
what you thought seems to be correct.
Depending on the use of the new property set, it could be useful to add to the entire model or to the single element.

I started studying IFC data mapping, IFC rules and scheme with the precise intent to combine KEYNOTE, SPECIFICATIONS and BOQ at once in a consistent way through out the entire project.

And actually I got it ... except for the slowness of the schedule updating process which is really so slow in case of datamapping.

What I think is that the schedule updating process in case of data mapping seems not to be optimized inside archicad ... because it's unbelievable that calculating 10 more quantities (I used 10 datamapping rules) takes so much time ...
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it
daviddelven
Advocate
Did anyone of you merged IFC 2x3 mapping rules into a Custom IFC 4 Scheme ?
David Delgado Vendrell

http://www.daviddelgado.cat
i7-7820HK CPU 2,90GHz 32GB RAM
Triple Monitor 17"+25"+32" Nvidia Geforce GTX 1080
SSD+HDD, Win10 Home - 64 ENG
AC18-AC26 INT/SPA (64-bit, latest build)
Surfing with Archicad since 2013
alemanda
Advocate
laszlonagy wrote:
...
I will ask them if this is the case and if the XML structures and possible Script commands can be made available.
Any news about it, Laszlo?
AC 19 and AC21 latest hotfix
Win 10 Pro 64bit
Double XEON 14 CORES (tot 28 physical cores)
32GB RAM - SSD 256GB - Nvidia Quadro K620
Display DELL 25'' 2560x1440
www.almadw.it