Allow adding a material to the stock object.
Select the stock object and use the Arch Material button to add and assign the material to the stock. The only thing affected is the path-sanity report
This commit is contained in:
@@ -571,7 +571,11 @@ class CommandPathSanity:
|
||||
data['xLen'] = FreeCAD.Units.Quantity(bb.XLength, FreeCAD.Units.Length).UserString
|
||||
data['yLen'] = FreeCAD.Units.Quantity(bb.YLength, FreeCAD.Units.Length).UserString
|
||||
data['zLen'] = FreeCAD.Units.Quantity(bb.ZLength, FreeCAD.Units.Length).UserString
|
||||
data['material'] = "Not Specified" # fix this
|
||||
|
||||
data['material'] = "Not Specified"
|
||||
if hasattr(obj.Stock, 'Material'):
|
||||
if obj.Stock.Material is not None:
|
||||
data['material'] = obj.Stock.Material.Material['Name']
|
||||
|
||||
if data['material'] == "Not Specified":
|
||||
self.squawk("PathSanity", "Consider Specifying the Stock Material", squawkType="TIP")
|
||||
@@ -579,6 +583,7 @@ class CommandPathSanity:
|
||||
data['stockImage'] = self.__makePicture(obj.Stock, "stockImage")
|
||||
except Exception as e:
|
||||
data['errors'] = e
|
||||
print(e)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ class StockFromBase(Stock):
|
||||
obj.addProperty("App::PropertyDistance", "ExtYpos", "Stock", QtCore.QT_TRANSLATE_NOOP("PathStock", "Extra allowance from part bound box in positive Y direction"))
|
||||
obj.addProperty("App::PropertyDistance", "ExtZneg", "Stock", QtCore.QT_TRANSLATE_NOOP("PathStock", "Extra allowance from part bound box in negative Z direction"))
|
||||
obj.addProperty("App::PropertyDistance", "ExtZpos", "Stock", QtCore.QT_TRANSLATE_NOOP("PathStock", "Extra allowance from part bound box in positive Z direction"))
|
||||
obj.addProperty("App::PropertyLink","Material","Component", QtCore.QT_TRANSLATE_NOOP("App::Property","A material for this object"))
|
||||
|
||||
obj.Base = base
|
||||
obj.ExtXneg= 1.0
|
||||
|
||||
Reference in New Issue
Block a user