pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.33k stars 338 forks source link

[Question] How does pyRevit determine REFEDASSMS? #1051

Closed htlcnn closed 4 years ago

htlcnn commented 4 years ago

Hi @eirannejad May I ask how pyRevit sets the environment variable PYREVIT_REFEDASSMS? If I use IronPython 2.7.3 core, it load IronPython*.dll from GAC_MSIL instead of pyRevit engines if I use other cores. I think this might be related to IronPython Compile test button, which succeeded with 2.7.3 core but failed for other cores. Thanks.

eirannejad commented 4 years ago

If it loads the DLLs from GAC_MSIL, it is because they have been installed there by another application (most probably Dynamo). I usually suggest removing all the independent IronPython installations

This is where pyRevit sets the generated assemblies on this env var

eirannejad commented 4 years ago

Closing this since it is a question but keep the conversation going. I still see the messages

htlcnn commented 4 years ago

@eirannejad I'm confused and don't know how IronPython works to load compiled dll files. All began with using Test IronPython Compile command.

pyRevit's behaviours were not stable. With 2.7.9 core on any Revit version, pyRevit could not use compiled dll files. Sometimes it succeeded with 2.7.3 & Revit 2018 only.

On one of my PC it succeeded with both Revit 2020 & Revit 2018, all running 2.7.3 core. On the other PC, most of the time Revit 2020 failed to load 2.7.3 with exception No module named _wpf.

That led me to the issue https://github.com/eirannejad/pyRevit/issues/1053. I just wanted to find a stable way to run pyRevit for all Revit versions and be able to use compiled dll files.

Thanks for your time!

eirannejad commented 4 years ago

Okay let me take a look at this tomorrow. Do you use any WPF stuff in your compiled scripts?

htlcnn commented 4 years ago

No, I used your ipycompiletest.py to test. clr.AddReference("ipycompiletest.dll") was ok, but import ipycompiletest showed exception: No module named ipycompiletest