Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added feature #1341 #1342

Merged
merged 11 commits into from
Oct 25, 2021
16 changes: 13 additions & 3 deletions pyrevitlib/pyrevit/extensions/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@ def get_target_assembly(self, required=False):
assm_file = self.assembly.lower()
if not assm_file.endswith(framework.ASSEMBLY_FILE_TYPE):
assm_file += '.' + framework.ASSEMBLY_FILE_TYPE
target_asm = self.find_bundle_module(assm_file)
if not target_asm and required:
mlogger.error("%s can not find target assembly.", self)

# try get assembly with revit version (RevitPlugin_2020.dll)
new_assm_file = self.get_assm_file(assm_file)
target_asm = self.find_bundle_module(new_assm_file)
if not target_asm:
# get default assembly version (RevitPlugin.dll)
target_asm = self.find_bundle_module(assm_file)
if not target_asm and required:
mlogger.error("%s can not find target assembly.", self)

return target_asm or ''

def get_assm_file(self, assm_file):
return os.path.splitext(assm_file)[0] + '_' + HOST_APP.version + \
'.' + framework.ASSEMBLY_FILE_TYPE

class LinkButton(NoScriptButton):
type_id = exts.LINK_BUTTON_POSTFIX
Expand Down