IFC-Dictionary

hello,
when i extract the ifc attributes from the disctonary (here a ifcdoor-object), i get a clear overview:

.....
******OverallHeight   1    5532
      is_hidden   false
******OverallWidth   1    5532
      is_hidden   false
******Tag   1    5532
      is_hidden   false
******ObjectPlacement   1    5532
      is_hidden   true
******Representation   1    5532
      is_hidden   true
******ObjectType   1    5532
      is_hidden   false
******GlobalId   1    5532
      is_hidden   true
******OwnerHistory   1    5532
      is_hidden   true
******Name   1    5532
      is_hidden   false
******Description   1    5532
      is_hidden   false
******href   3    5532
      attribute_type   string
      is_hidden   true
      value   
******ref   3    5532
      attribute_type   string
      is_hidden   true
      value   
******proxy   3    5532
      attribute_type   string
      is_hidden   true
      value   
******edo   3    5532
      attribute_type   string
      is_hidden   true
      value   
******instanceAttributes   1    5532
      is_hidden   true

question 1:

is this a normal hash? i would like to add own keys…

question 2:
what ever i try, i cannot assign a value , for example, to the width parameter in ifcdoor (or many others).

are there limitations in skp api 2021 ?

thanx
stan

This may help you

hello an thanx!

your plugin seems to be a very useful front-end-solution.
u made it : pset in skp, great respect!

yet i am still looking for some information in the api, which would allow me to define my own parameters within the exported ifc, but with my own parameters in my own ifc-viewer and in batch routines.
means: syntax for writing own parameters+values inti ifc.

anyway: thanx for helping !!

stan

instance.definition.attribute_dictionary("IFC 2x3") 
instance.definition.attribute_dictionary("IFC 4")

hi!

yes, that is where i stick:

i iterate thru schemes:

ifc_dict = inst.definition.attribute_dictionary(my_scheme)
						 
sub_ifc_dicts = ifc_dict.attribute_dictionaries
						 
status = ifc_dict.set_attribute "ZF_SET_0", "Parameter1", "#{inst.definition.name}"
status = ifc_dict.set_attribute "ZF_SET_0", "Parameter2", "#{inst.definition.instances.length}"

and can iterate thru dictionaries in ruby conslole and se the ZF_SET_0

but exporting ti ifc and opening in a external viewer show:

probably my new dictionary is at a wrong level…

stan

and: sketchup shows the parameters, but no values …

@ams Please post correctly formatted and colorized code, [How to] Post correctly formatted and colorized code on the forum?

You are skipping quite a few steps to insert values in your instances.

This is the attribute dictionary: (IFC 4 in this case)

ifcDict = ent.definition.attribute_dictionary("IFC 4")

This is your Pset name, it’s important to start with “Pset_”

ifcYourPsetName = ifcDict.attribute_dictionary("Pset_YourPsetName", true)

This is your parameter name

ifcYourPsetNameParameterName =ifcYourPsetName.attribute_dictionary(defDic, true)

And finally this is your parameter value name:

ifcYourPsetNameParameterName.set_attribute "IfcLabel", "value", val.to_s
ifcYourPsetNameParameterName.set_attribute "IfcLabel", "is_hidden", false
ifcYourPsetNameParameterName.set_attribute "IfcLabel", "attribute_type", String

You must take into account that for the parameter to appear you must set the is_hidden value to false and set the attribute_type you are going to insert.

Finally, I strongly recommend you to export with Ifc Manager in order to export your “Pset” correctly.

I hope it helps you. And please modify your post in order to have a clean post easy to search and read in the future.

1 Like

That is exactly what my plugin does. Your own parameters in your own ifc-viewer.

By the way I changed the topic to the correct category

hi rtches,
thank you so much - this is exactly thy syntax (and the needed structure of the library), i was missing and could not find.
it opens doors :slight_smile:
i will report the succes (hopefully soon).

regards stan

Please @ams update your previos post to be readable with the correct format. And mark the post as solved if you consider it closed.

@rtches:

  1. thanx for the help. i managed to create a pset the ifc and save my values into in and also set single values in all 3 standard schemes. so far, so good.
    however, when i export it
    -by skp, and reimport, it is not there.
    -using the ifc-manager: it gives me errors (some undefined id in the bt_manager).
    so probably i still did not implement the pset correctly.

  2. is there any guide for how i have to reformat my texts?

thanx and regards

stan

See the link in Post #6… :wink:

1 Like

got it :slight_smile: thanx,
stan

before i close the topic, only 1 question:
can it be, that skp does not reimport this own defined pset within 2x3 per se?
otherwise i did something wrong and habe to investigate…
thanx
stan

You must have done something wrong. In any case, 3 schemes? you should review it. Ifc is not as easy as adding dictionaries

how right you are…

well, i managed it to create a pset, which shows correctly (i think) in skp:

and reimport in new empty project gives me

image
and expanded:

so i stick a bit…

i think, i make a day off :slight_smile:
stan

Take a look to the differences between the tree in Ifc2x3 and Ifc4

ok,
but as a simple user,

i have only 2x3 - scheme in the model ,

i export with standard-sketchup,
import with standard sketchup.,

an that is the result.

i my images actually 4 oder 4x3 is not involved, …

but i will check , what you wrote…

thanx
stan

new file after import:
image

Check this thread also about adding your own classification (or psets):

1 Like

There is an issue with IFC 2x3 in the Sketchup IFC exporter; Sketchup has been notified about it several times, I ended up giving up & I have not tested IFC4.