speckle-sharp icon indicating copy to clipboard operation
speckle-sharp copied to clipboard

Dockable panel initialization not working when launching Revit form a file

Open teocomi opened this issue 2 years ago • 2 comments

If launching Revit by double-clicking on a Revit file (instead of first launching Revit and then opening a file) the initialization of the Dockable Panel is not working and throws The requested dockable pane has not been created yet.

This seems to be an issue with the Revit API as the panel under both circumstances is actually registered and initialized correctly.

As a matter of fact, as a workaround, opening another Revit file is correctly starting the dockable panel.

Steps to repro

  1. Add command line args to launch revit file:

image

  1. Click debug
  2. After the project has been opened, click on the Speckle command

Solution tried

I tried to simplify, and force a re-registration of the panel when clicking on the ribbon button, to no avail. I also tried changing when the panel is first initialized from the Idle to the a ControlledApplication.ApplicationInitialized event.

Some more details:

        var p1 = DockablePane.PaneIsRegistered(PanelId);  //true
        var p2 = DockablePane.PaneExists(PanelId); //false
        var p3 = App.AppInstance.GetDockablePane(PanelId); //throws "The requested dockable pane has not been created"

Also, no events like DocumentOpened, or ViewActivated are triggered under these circumstances.

image

teocomi avatar Aug 02 '22 08:08 teocomi

Repro with minimal reproducible project: https://github.com/teocomi/DockableDialogBug

teocomi avatar Aug 08 '22 06:08 teocomi

This has been recognized as an issue by ADSK and has been logged internally by them as:

REVIT-195285 [Dockable Panel not registered correctly when Revit is opened from a file -- 19345692]

teocomi avatar Aug 08 '22 15:08 teocomi

Will reopen when we have a resolution from ADSK.

teocomi avatar Jul 17 '23 12:07 teocomi

Hi @teocomi ,

sorry to bother you.

I still have this issue when I am using a specific workflow, not speckle system related. I am extracting Revit Database info using a "ModelChecker\bestpractices-2023.xml" pointing to the central file where I want to extract information.

the workflow works in this way. when I start the Revit session it automatically generate and excel file opning in the backgorung the central file.

so when I initialize the software I have this issue that keeps going to pup up even if I click on close. image

can you please help me with that?

GianClaudioScarafini avatar Nov 15 '23 12:11 GianClaudioScarafini

Hey @GianClaudioScarafini this is unfortunately a limitation of Revit, we can't do anything about it. You need to launch Revit and open a file afterwards.

teocomi avatar Nov 15 '23 13:11 teocomi

Hello @teocomi, this issue is closed but I might have a working solution, I opened a PR :)

Mehdi-Lucas avatar Apr 02 '24 13:04 Mehdi-Lucas

Amazing! Thanks @Mehdi-Lucas, we appreciate it a lot. We'll have a look :)

teocomi avatar Apr 02 '24 15:04 teocomi

@teocomi No problem, fingers crossed that it performs as intended and proves helpful for you guys 🤞

Mehdi-Lucas avatar Apr 02 '24 15:04 Mehdi-Lucas