WarningBar not showing

Hi All,

I want to show a WarnignBar in Revit 22 but it’s not showing.

Any ideas?

from pyrevit import revit,forms
doc = __revit__.ActiveUIDocument.Document

with forms.WarningBar(title='Select an object:'):

    element = revit.pick_element()

I tested your code snip in Revit 2022 and it’s working for me. It might be an issue with your pyRevit environment (which is above my head completely). An uninstall/reinstall of pyRevit to the latest version might help, if you haven’t already tried that. Sorry I can’t be more help.

same here.
try the pyrevit env command in command line and paste the results here to see how your install is being handled

this error could be the issue ?

Debug: Getting host product info for: 20220520_1515(x64)
Debug: Getting data source "C:\Users\SaSa\AppData\Roaming\pyRevit\Cache\pyrevit-hosts.json"
Debug: Getting data source "C:\Program Files\pyRevit-Master\bin\pyrevit-hosts.json"
Debug: Data source exists "C:\Program Files\pyRevit-Master\bin\pyrevit-hosts.json"
Debug: Using already loaded data. Identical signatures "1525019312" = "1525019312"
Error: Object reference not set to an instance of an object. (System.NullReferenceException)
   at pyRevitCLI.PyRevitCLIRevitCmds.<>c.<PrintLocalRevits>b__1_0(RevitProcess x)
   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at pyRevitCLI.PyRevitCLIRevitCmds.PrintLocalRevits(Boolean running)
   at pyRevitCLI.PyRevitCLIAppCmds.MakeEnvReport(Boolean json)
   at pyRevitCLI.PyRevitCLI.ProcessArguments()
   at pyRevitCLI.PyRevitCLI.Main(String[] args)

it does not tell me much, is this what you got running pyrevit env command?

I have the same issue. Running Revit 2022 and latest release of pyRevit. Tried reinstalled pyRevit (not clean install though, just installed over).

My pyrevit env output:

==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.12.22247+0031" | Path: "C:\Program Files\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2022" | Engine: IPY277 (277) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
master | Product: "2018.3.3 Security Fix" | Engine: IPY277 (277) | Path: "C:\Program Files\pyRevit-Master" | AllUsers
==> Installed Extensions
==> Default Extension Search Path
C:\Users\<user>\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2022 | Version: 22.1.40.58 | Build: 20230505_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
2018.3.3 Security Fix | Version: 18.3.3.18 | Build: 20190510_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2018\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.
Run with "--debug" option to see debug messages

Part of my pyrevit env --debug output that had an error:

==> Running Revit Instances
Debug: Getting host product info for: 20230505_1515(x64)
Debug: Getting data source "C:\Users\<user>\AppData\Roaming\pyRevit\Cache\pyrevit-hosts.json"
Debug: Getting data source "C:\Program Files\pyRevit-Master\bin\pyrevit-hosts.json"
Debug: Data source exists "C:\Program Files\pyRevit-Master\bin\pyrevit-hosts.json"
Debug: Using already loaded data. Identical signatures "68884782" = "68884782"
Error: Object reference not set to an instance of an object. (System.NullReferenceException)
   at pyRevitCLI.PyRevitCLIRevitCmds.<>c.<PrintLocalRevits>b__1_0(RevitProcess x)
   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at pyRevitCLI.PyRevitCLIRevitCmds.PrintLocalRevits(Boolean running)
   at pyRevitCLI.PyRevitCLIAppCmds.MakeEnvReport(Boolean json)
   at pyRevitCLI.PyRevitCLI.ProcessArguments()
   at pyRevitCLI.PyRevitCLI.Main(String[] args)

can you try installing the latest WIP version
I tried on my side again for the sake of it and it works:

from pyrevit import revit,forms
doc = revit.doc

with forms.WarningBar(title='Select an object:'):
    element = revit.pick_element()
    print(element.Id)
1 Like

Just tried your code snippet and it worked for me. I must have did something wrong before, so never mind I guess. Thanks.