Search the Knowledge Base Report a bug
Post new topic   Reply to topic   printer-friendly view   .    ArchiCAD-Talk Forum Index >>> Data Exchange and Information Sharing >>> IFC rules
View previous topic :: View next topic
Author Message
alemanda
Veteran member
Veteran member

Joined: 21 Nov 2008
Posts: 754
Location: Italy

PostPosted: Wed Mar 09, 2016 8:57 am    Post subject: IFC rules Reply with quote

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
 Description:
 Filesize:  176.57 KB
 Viewed:  175 Time(s)

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
Back to top
View user's profile Send private message    
alemanda
Veteran member
Veteran member

Joined: 21 Nov 2008
Posts: 754
Location: Italy

PostPosted: Mon Mar 14, 2016 11:01 am    Post subject: Re: IFC rules Reply with quote

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
Back to top
View user's profile Send private message    
laszlonagy
Site Admin
Site Admin

Joined: 20 Oct 2003
Posts: 8006
Location: Budapest, Hungary

PostPosted: Mon Mar 14, 2016 4:33 pm    Post subject: Re: IFC rules Reply with quote

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:

<?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.

_________________

Laszlo Nagy, Moderator, Site Admin
https://twitter.com/laszlonagy

AMD Ryzen 1700X 3.4 GHz, 32 GB DDR4 RAM
28" (2560x1440), NVidia GTX 1060 6GB
500 GB NVMe SSD, WIN10 PRO ENG
AC13-AC21
Loving ARCHICAD since 1995
Back to top
View user's profile Send private message Visit poster's website    
alemanda
Veteran member
Veteran member

Joined: 21 Nov 2008
Posts: 754
Location: Italy

PostPosted: Mon Mar 14, 2016 5:55 pm    Post subject: Re: IFC rules Reply with quote

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
Back to top
View user's profile Send private message    
alemanda
Veteran member
Veteran member

Joined: 21 Nov 2008
Posts: 754
Location: Italy

PostPosted: Mon Mar 14, 2016 7:16 pm    Post subject: Re: IFC rules Reply with quote

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
Back to top
View user's profile Send private message    
laszlonagy
Site Admin
Site Admin

Joined: 20 Oct 2003
Posts: 8006
Location: Budapest, Hungary

PostPosted: Tue Mar 15, 2016 1:32 pm    Post subject: Re: IFC rules Reply with quote

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:

<?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.

_________________

Laszlo Nagy, Moderator, Site Admin
https://twitter.com/laszlonagy

AMD Ryzen 1700X 3.4 GHz, 32 GB DDR4 RAM
28" (2560x1440), NVidia GTX 1060 6GB
500 GB NVMe SSD, WIN10 PRO ENG
AC13-AC21
Loving ARCHICAD since 1995
Back to top
View user's profile Send private message Visit poster's website    
alemanda
Veteran member
Veteran member

Joined: 21 Nov 2008
Posts: 754
Location: Italy

PostPosted: Tue Mar 15, 2016 3:49 pm    Post subject: Re: IFC rules Reply with quote

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
Back to top
View user's profile Send private message    
daviddelven
New member
New member

Joined: 31 May 2015
Posts: 32
Location: Barcelona

PostPosted: Mon Jul 10, 2017 10:22 am    Post subject: Re: IFC rules Reply with quote

Did anyone of you merged IFC 2x3 mapping rules into a Custom IFC 4 Scheme ?
_________________
David Delgado Vendrell
http://www.daviddelgado.cat
i5-2300 16GB RAM
Dual Monitor 19"+21" (1440x900), AMD Radeon HD 5450
SSD+HDD, Win10 Home - 64 ENG
AC18-AC21 INT (64-bit, latest build)
Surfing with ARCHICAD since 2013
Back to top
View user's profile Send private message Visit poster's website    LinkedIn Profile Link (Full URL, please)
alemanda
Veteran member
Veteran member

Joined: 21 Nov 2008
Posts: 754
Location: Italy

PostPosted: Thu Aug 03, 2017 12:51 pm    Post subject: Re: IFC rules Reply with quote

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
Back to top
View user's profile Send private message    
Display posts from previous:   
View previous topic :: View next topic
Post new topic   Reply to topic   printer-friendly view       ArchiCAD-Talk Forum Index >>> Data Exchange and Information Sharing >>> IFC rules All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2001, 2005 phpBB Group
Copyright 2012 - Graphisoft SE. All rights reserved worldwide. Terms of Use | Privacy Policy