Can I automate an IFC export with Ruby?

ifc
sketchup
ruby
export
automation

#1

I work with the Building Information Modelling (BIM) process and want to automate this.
In Sketchup 2017 I can automate 3D modelling and adding information to components with a Ruby script. But I also want to automate the IFC export.

In the SketchUp Ruby API I can’t find the solution for automating an IFC export.
Are there any solutions? Or is this not possible yet?


#2

You can iterate over the model and use the ComponentDefinition#get_classification_value method http://ruby.sketchup.com/Sketchup/ComponentDefinition.html#get_classification_value-instance_method. I have been planning myself to make a more intuitive and user friendly BIM interface for quite some time but haven’t had the time for it yet.


#3

If you have Pro and want to just call the Pro ifc exporter, try this in the Ruby Console.

Sketchup.active_model.export("C:/testmodel.ifc")

Check if the file exists.


#4

@eneroth3 the ComponentDefinition #get_classification_value method doesn’t export the model to IFC.
This function get the IFC classification value from a component.

@jim_foltz I work with the SketchUp 2017 Pro version.
SketchUp does export something, but I can’t find the file.

I keep searching for the answer.