|
|
@ -366,6 +366,8 @@ class TechDrawExtensions: |
|
|
|
return None |
|
|
|
return None |
|
|
|
|
|
|
|
|
|
|
|
def isPartLink(self, obj): |
|
|
|
def isPartLink(self, obj): |
|
|
|
|
|
|
|
if obj is None: |
|
|
|
|
|
|
|
return False |
|
|
|
if obj.TypeId == 'App::Link': |
|
|
|
if obj.TypeId == 'App::Link': |
|
|
|
return True |
|
|
|
return True |
|
|
|
if obj.TypeId == 'Part::FeaturePython' and hasattr(obj, 'LinkedObject'): # variant link |
|
|
|
if obj.TypeId == 'Part::FeaturePython' and hasattr(obj, 'LinkedObject'): # variant link |
|
|
@ -374,7 +376,7 @@ class TechDrawExtensions: |
|
|
|
|
|
|
|
|
|
|
|
def getPartDisplayName(self, obj): |
|
|
|
def getPartDisplayName(self, obj): |
|
|
|
if self.isPartLink(obj): |
|
|
|
if self.isPartLink(obj): |
|
|
|
linked_obj = obj.LinkedObject |
|
|
|
linked_obj = obj.SourceObject if hasattr(obj, 'SourceObject') else obj.LinkedObject |
|
|
|
if 'Assembly_handbook_PartDisplayName' in linked_obj.PropertiesList: |
|
|
|
if 'Assembly_handbook_PartDisplayName' in linked_obj.PropertiesList: |
|
|
|
return linked_obj.Assembly_handbook_PartDisplayName |
|
|
|
return linked_obj.Assembly_handbook_PartDisplayName |
|
|
|
else: |
|
|
|
else: |
|
|
|