How to suppress "Export with Preview Visibility" dialog through API

How to suppress "Export with Preview Visibility" dialog through API

developer2W5KBH
Explorer Explorer
268 Views
1 Reply
Message 1 of 2

How to suppress "Export with Preview Visibility" dialog through API

developer2W5KBH
Explorer
Explorer

Hello all,

 

I have a family which contains multiple types and each type has different color and a different view as a result. When I change doc.FamilyManager.CurrentType in Family Editor View, the new type's visual features are not visible, therefore I use PreviewFamilyVisibilityMode.On to see the differences. 

 

The reason I need this is to be able to export each type as OBJ and see them in a viewer later on. But when I toggle on the PreviewFamilyVisibilityMode, then export the OBJ through API, I receive the following dialog for each export of the family type, since the PreviewFamilyVisibilityMode is on:

developer2W5KBH_0-1636541765322.png

 

Is there any possibiltiy to suppress this dialog through the API? I would like to go with the second option all the time ("Leave the Preview Visibility mode on and export"). Or preferably any other way to have the unique visibility of each type of the family without using PreviewFamilyVisibilityMode?

 

Thank you in advance for the answers!

0 Likes
269 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

Subscribe to UIApplication.DialogBoxShowing event

 

Then use:
DialogBoxShowingEventArgs.OverrideResult

 

Since that is a task dialogue the meaning of 'resultcode' is as below

 

Under DialogBoxShowingEventArgs.OverrideResult in Revit.chm

"TaskDialog: Standard Message Box IDs and Revit Custom IDs are accepted, depending on the buttons used in a dialog. Standard buttons, such as OK and Cancel, have standard IDs described in Windows API documentation. Buttons with custom text have custom IDs with incremental values starting at 1001 for the left-most or top-most button in a task dialog."

 

So 1002.

0 Likes