The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Import/Export to other CAD/BIM formats (DWG/DXF, IFC, SketchUp, 3DS etc.), spreadsheets, databases etc.

Moderators: Barry Kelly, Karl Ottenstein, LaszloNagy, ejrolon, gkmethy

By alemanda
#253063
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
Attachments
ifc new preset rule.jpg
By alemanda
#253259
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>
User avatar
By LaszloNagy
#253283
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:

Code: Select all<?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.
By alemanda
#253295
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.
By alemanda
#253296
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).
User avatar
By LaszloNagy
#253330
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":

Code: Select all<?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.
By alemanda
#253340
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 ...
User avatar
By daviddelven
#269164
Did anyone of you merged IFC 2x3 mapping rules into a Custom IFC 4 Scheme ?
By alemanda
#270260
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?