How to set API Export IFC Options?

Can someone tell me how I can put the IFC export options if I (through the API (Ruby) wants to export a model.export file as .ifc?
In the documentation of the API there is nothing about it, but at a manual export ’ for example, I can specify which ifc export elements should be exported.
I want to export an IFC ifc elements with just only the ’ Ifc_Window ’ elements…

Most of the File import / export “Options” dialogs are exposed to the APIs.

There may be a hack for Windows using SendKeys and the WIN32OLE class.

require 'win32ole'

module Author::SomeLibrary

  extend self

  def export_my_ifc(ifc_filename="myexport.ifc")
    # for SU2015+ using MS Common Dialogs v6
    shell = WIN32OLE::new("WScript.Shell")
    Sketchup::send_action(21149) # WIN only
    # Set export filename:
    # Select IFC filetype:
    # Select "Options" button, and click it
    # "Export double-sided faces" checkbox has focus.
    # Use "{SPACE}" to check check boxes, if wanted.
    # Tab down to selection list:
    # Switch to last item:
    # Tab to OK button and click it:
    # Back in File dialog, tab to "Export" button and click it:

The older file dialog is different. And this does not work on Mac.

This method will use the export directory path preset in:
Window > Preferences > Files > Export Models:

Otherwise you need to stuff a different directory into the filename box, and send an “{ENTER}”, and wait for the file broswer to update, before stuffing the ifc_filename into the box:

# then set the filename:
# etc,... as above

And as you may notice, this is fragile because if the order changes, or the IfcWindow is not the last, this’ll break and you’ll need to do a “{HOME}” followed by whatever number of “{DOWN}” arrows it takes to get to your item.

Thanks Dan!, yes it is fragile but it seems to work but…
anyway, you write “None of the File import / export “Options” dialogs are exposed to the APIs” Thats true, but for example: PDF options can be set. See: I hope this will be possible in SU2017 for ifc too…

Okay, got me. DAE also has an options hash. I changed the original to “Most”.