Hello,
Part of my plugin process is to load a pre-defined Revit family I prepared that my plugin uses.
2 options I was thinking of:
1. To copy this family from my file server once the plugin is begin installed and then to load it to the Revit project once plugin is executed. In this case - where do you think it is better to save this rfa file in my users' station? This family will have to be loaded to each new project in Revit so it will have to be saved in a safe place.
2. Load this rfa directly from my file server to the Revit project once plugin is executed. Is this even possible?
Do you think of any other way to tackle this?
Thank you!
Hi mizrachi_amir2,
I made a small extension method to select two points and simulate a rubber band. The family I use is added to my resources and I copy it to a safe folder to make sure there are no write issues. If the family exists in the project, it does nothing. If it doesn't exist, it is copied and loaded, then I delete it. Maybe this approach can be useful for you.
https://github.com/SpeedCAD/SCADtools.Revit.UI.RubberBand
Hi @Speed_CAD,
So you're copying the rfa file from your resources to the user's temp folder, then load it to the Revit project and finally delete it from temp folder. Is that correct?
Also, how would you solve it for different Revit version?
If I need my rfa for Revit 2021 and up I need to save 5 copies of it in resources (one per each Revit version)? and then in my plugin to load each one for the corresponding Revit version?
[EDIT]:
I used the preprocessor directives #if/#elif/#endif and it's working good, was wondering if there's a more elegant way for that.
@mizrachi_amir2 ha escrito:Hi @Speed_CAD,
So you're copying the rfa file from your resources to the user's temp folder, then load it to the Revit project and finally delete it from temp folder. Is that correct?
Yes, that's what I do
@mizrachi_amir2 ha escrito:Also, how would you solve it for different Revit version?
If I need my rfa for Revit 2021 and up I need to save 5 copies of it in resources (one per each Revit version)? and then in my plugin to load each one for the corresponding Revit version?[EDIT]:
I used the preprocessor directives #if/#elif/#endif and it's working good, was wondering if there's a more elegant way for that.
In that case, I would use the family for Revit 2021 over all other versions.
In that case, user will experience a pop up window of the family being upgraded from 2021 to a newer version.
I don't think this is a good user experience.
Using prefebs for different version is safer.
In the versions not English, keying anything by keyboard would cause crash after upgrading a model.
Can't find what you're looking for? Ask the community or share your knowledge.