I am new to PyRevit.
I am making a PyRevit extension.
The extension is found by PyRevit, but when I click the pushbutton, I get an alert from pyrevit loader that says “Can not find Target file. Maybe Deleted?”
I have a script.py file in the pushbutton directory (see below).
Why am I getting this error? How can I troubleshoot it and correct it?
Oh, BTW I am using Revit 2024 with the PyRevit WIP from about two days ago.
May 9, 2023, 6:32am
Can you take a screen capture of the error?
Which extensions folder is your pyRevit pointing to?
It should point to the folder containing the .extension folder.
In your case ‘PyRevit Extensions’.
To get this information you can either go to the pyrevit settings in the Revit UI or run the ‘pyrevit env’ command in a command line window.
Wow, thanks so much for your prompt reply. I appreciate it!
Here’s my env. Looks like the extensions are being detected properly, no?
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: “basepublic” | Branch: “master” | Version: “126.96.36.19926+1635-wip” | Path: “C:\Users\pauldavis\AppData\Roaming\pyRevit-Master”
master | Product: “Autodesk Revit 2024” | Engine: IPY277 (277) | Path: “C:\Users\pauldavis\AppData\Roaming\pyRevit-Master”
==> Installed Extensions
Nedra | Type: Unknown | Repo: “” | Installed: “C:\Program Files\PyRevit Extensions\Nedra.extension”
Test | Type: Unknown | Repo: “” | Installed: “C:\Program Files\PyRevit Extensions\Test.extension”
==> Default Extension Search Path
==> Extension Search Paths
C:\Program Files\PyRevit Extensions
==> Extension Sources - Default
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2024 | Version: 188.8.131.522 | Build: 20230411_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024"
==> Running Revit Instances
==> User Environment
Microsoft Windows 10 [Version 10.0.22621]
Executing User: PAULDAVIS1FD7\pauldavis
Active User: PAULDAVIS1FD7\pauldavis
Admin Access: No
Latest Installed .Net Framework: 4.8
No .Net Target Packs are installed.
No .Ne-Core Target Packs are installed.
And I see the tabs etc. in the Revit UI:
May 9, 2023, 7:29am
Correct, the detection seems to work fine.
It usually gives the location of the error in the process of creating the toolbar buttons
Oh, and sorry! Here’s the alert:
May 9, 2023, 7:32am
Do you have bundle.yaml files somewhere in the Test.extension folder or subfolders?
May 9, 2023, 7:33am
if so, try to remove these (you may have mistyped something in and they are not required by default, they are just helping you with organisation, tooltips and context setup)
No bundle.yaml. It’s only nested folders, no files, from PyRevit Extensions down to this:
One more note: Running in Parallels on a Mac. Probably not relevant, but a little data point…
Thanks so much for your great project and your help. I appreciate it.
May 9, 2023, 8:23am
your great project
not my project
Ehsan’s it is. I just help out maintaining, supporting and improving it eventually.
I doubt running in VM or Mac is an issue such as this one.
it’s weird, can you share a zip file of your .extension folder for me to try it out.
You can find the zipped tree and files here:
Upload files for free - Test.extension.zip - ufile.io
Thanks so much!
Could it be caused by the script being in a tree under Program Files? Could that affect permissions or visibility?
@pdneural - its cause your script is a text file rather than a script.py file - if you remove the “.txt” extension from the python file it should work - or better yet - save it as a Python file using Notepad++\ VsCode
Oh, man. That’s a great catch. As you see, in my File Explorer, it shows up as script.py.
I think that inaccurate representation is used by some Windows malware.
In addition to being new to PyRevit, and to Revit, I have not used Windows for a long time.
Thanks so, so much for your attention and persistence.
Great, thanks. I should have said inaccurate
Really appreciate your help.
May 9, 2023, 7:40pm
We all have to start somewhere ;).
I’m already just started a month or so ago on my python/pyrevit journey.
It’s bumpy road from time to time but a very fun one at that