Nice3point / RevitToolkit

Toolkit for Revit plugin development
MIT License
64 stars 10 forks source link

Dependency isolation #5

Closed ThanhPhanz closed 3 weeks ago

ThanhPhanz commented 3 weeks ago

I realized that when I inherit my command from ExternalCommand, it can no longer get value from static variables or settings. I think it's because the add-in was loaded from another assembly. Is there any other way to approach this problem?

Nice3point commented 3 weeks ago

@ThanhPhanz You can use static variables, but they must all be used within the same context, i.e. all commands must inherit from ExternalCommand and the application from ExternalApplication. If you initialize the settings in IExternalApplication it won't work, ricaun showed this here https://www.youtube.com/watch?v=cpy4J_6-8WY

ThanhPhanz commented 3 weeks ago

It works. Thank you