@ -807,20 +807,23 @@ class TechDrawExtensions:
pass
pass
if main_part is not None :
if main_part is not None :
current_material = ' Unknown '
self . initPartMetadata ( main_part )
if ' Assembly_handbook_Material ' in main_part . PropertiesList :
current_material = main_part . Assembly_handbook_Material
else :
main_part . addProperty ( " App::PropertyEnumeration " , " Assembly_handbook_Material " , " Assembly_handbook " )
material_list = [ ' Unknown ' ] + Material . GetMaterialIDs ( )
main_part . Assembly_handbook_Material = material_list
main_part . Assembly_handbook_Material = material_list . index ( current_material ) if current_material in material_list else 0
if ' Assembly_handbook_Weight ' not in main_part . PropertiesList :
main_part . addProperty ( " App::PropertyFloat " , " Assembly_handbook_Weight " , " Assembly_handbook " , ' Part weight in grams. Set a negative number if weight is unknown. ' )
main_part . Assembly_handbook_Weight = - 1
QTimer . singleShot ( 0 , doInit )
QTimer . singleShot ( 0 , doInit )
def initPartMetadata ( self , part ) :
current_material = ' Unknown '
if ' Assembly_handbook_Material ' in part . PropertiesList :
current_material = part . Assembly_handbook_Material
else :
part . addProperty ( " App::PropertyEnumeration " , " Assembly_handbook_Material " , " Assembly_handbook " )
material_list = [ ' Unknown ' ] + Material . GetMaterialIDs ( )
part . Assembly_handbook_Material = material_list
part . Assembly_handbook_Material = material_list . index ( current_material ) if current_material in material_list else 0
if ' Assembly_handbook_Weight ' not in part . PropertiesList :
part . addProperty ( " App::PropertyFloat " , " Assembly_handbook_Weight " , " Assembly_handbook " , ' Part weight in grams. Set a negative number if weight is unknown. ' )
part . Assembly_handbook_Weight = - 1
def onPageLoaded ( self , page ) :
def onPageLoaded ( self , page ) :
self . refreshOverlays ( page )
self . refreshOverlays ( page )