Skip to content

Commit

Permalink
added feature #1341 (#1342)
Browse files Browse the repository at this point in the history
* fixed host adder and added 2020.2.3

* added 2020.1.1 to hosts

* added feature #1341

* fixed indent

Co-authored-by: Ehsan Iran-Nejad <eirannejad@gmail.com>
  • Loading branch information
dosymep and eirannejad authored Oct 25, 2021
1 parent d8f6985 commit 2967881
Showing 1 changed file with 13 additions and 3 deletions.
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

0 comments on commit 2967881

Please sign in to comment.