Revit 2023+ Ifc 'Select Export As IFC Entity' Dialog

Revit 2023+ Ifc 'Select Export As IFC Entity' Dialog

c_hanschen
Advocate Advocate
932 Views
9 Replies
Message 1 of 10

Revit 2023+ Ifc 'Select Export As IFC Entity' Dialog

c_hanschen
Advocate
Advocate

Since Revit 2023 there are Built-In Parameters for IFC properties.

When the user clicks on ' Export Type to IFC As' a DialogBox is shown:

IFC Dialog.png

 

Is there a way to call this Dialog from  your own code and get back the results?

 

Thanks again!

 

Chris Hanschen

LKSVDD architecten 

The Netherlands

 

0 Likes
933 Views
9 Replies
Replies (9)
Message 2 of 10

jeremy_tammik
Alumni
Alumni

First of all, I would check whether this form is defined as part of the Revit IFC open source project:

  

https://github.com/Autodesk/revit-ifc

  

Next, if any questions remain open, I would address them to the IFC discussion group:

  

https://sourceforge.net/p/ifcexporter/discussion/general

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 10

ekaterina.kudelina93H47
Explorer
Explorer

I guess you can try IIFCEntityTreeUIServer to show the dialog (but don't think it's possible to get contents).

Message 4 of 10

c_hanschen
Advocate
Advocate
IIFCEntityTreeUIServer is an Interface, can you share some code how to show the Dialog?

Thanks in advance!

Chris Hanschen
The Netherlands
0 Likes
Message 5 of 10

jeremy_tammik
Alumni
Alumni

Looking at the very limited list of IIFCEntityTreeUIServer members, I imagine the code can be pretty self-evident:

 

  • GetDescription -- Implement this method to return a description of the server.
  • GetName -- Implement this method to return the name of the server.
  • GetServerId -- Implement this method to return the id of the server.
  • GetServiceId -- Implement this method to return the id of the service.
  • GetVendorId -- Implement this method to return the id of the vendor of the server.
  • ShowDialog -- Shows dialog on managing IFCEntityTreeUI.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 6 of 10

TripleM-Dev.net
Advisor
Advisor

Interesting.

 

Also ShowDialog returns a IFCExternalServiceUIData

Which has certain properties like IsReset to reset the Ifc Export As value, and a SelectedIFCItem.

 

Seems this should be the resulting selection in the Dialog as a property (so also can be set to a starting value)

Message 7 of 10

c_hanschen
Advocate
Advocate
Sounds easy!
Maybe rooky-question, but how to perform a ShowDialog on a Interface?
It is not a Class, so I can't create a 'new IIFCEntityTreeUIServer'.

Directly accessing the IIFCEntityTreeUIServer.ShowDialog tells me it is not shared, so I need a Object Reference.
How to create this Object?

Thanks in advance!

Chris Hanschen
0 Likes
Message 8 of 10

ekaterina.kudelina93H47
Explorer
Explorer

Sorry, have never tried it before only IDirectContext3DServer, but Revit-IFC is an open source library and you can check implementation directly there on Github (there's a class implementing the interface - https://github.com/Autodesk/revit-ifc/blob/e63d059c69489a7fab829bdef2f03ae09bb7d16c/Source/IFCExport... ). Hope it will be helpful)

Message 9 of 10

TripleM-Dev.net
Advisor
Advisor

Ai, missed that it was a Interface.

 

I've taken a look at the IFC exporter code (the one linked by @ekaterina.kudelina93H47 )

 

So the interface is a way to pass a custom dialog to the event of the click on the button with the new Ifc Export parameters. The IfcExporter does this, it creates their own Class with the given interface and register it in revit as the current one to use. With the IFC exporter I don't see a way to subscribe to a event or something from it.

 

So the main idea behind the Interface is that you can create you're own class with a dialog requesting a selection of the user (a copy of the IFC exporter?....), and then you have the freedom to do whatever you want with the made selection. The return value of the form would be applied to the selected elements by Revit itself.

 

What is actually the goal of retrieving the results?

 

The result would be applied to the selected elements, or do you want to call the Dialog from you're own addin without editing parameters?  I think in that case, inspect the IFC exporter code and see where the IFC properties  are retrieved from and build you're own dialog.

Message 10 of 10

c_hanschen
Advocate
Advocate
"or do you want to call the Dialog from you're own addin without editing parameters?" - Yes! Thats what I want!

We use a own Created IFC helper, to get All Element Types from the model, with a set off comparisons (from a source file in Excel), the IFC Parameter Values are suggested! You can edit hundreds of ElementTypeParameters at once. But a user has the final say, so he/she should be able to overrule the suggested IFC Parameters, now the have to use one that's already in the model (dropdown) or type the new entry manually.
I would realy be fancy when our own Dialog can call the 'Select Export As IFC Entity' Dialog.

Thanks so far..!!!

Chris Hanschen
LKSVDD architecten
The Netherlands



0 Likes