speckle-sharp
speckle-sharp copied to clipboard
Dockable panel initialization not working when launching Revit form a file
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
- Add command line args to launch revit file:
- Click debug
- 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.
Repro with minimal reproducible project: https://github.com/teocomi/DockableDialogBug
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]
Will reopen when we have a resolution from ADSK.
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.
can you please help me with that?
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.
Hello @teocomi, this issue is closed but I might have a working solution, I opened a PR :)
Amazing! Thanks @Mehdi-Lucas, we appreciate it a lot. We'll have a look :)
@teocomi No problem, fingers crossed that it performs as intended and proves helpful for you guys 🤞