When trying to create such a BOM by using the Assembly 4 Create Part List function I receive an error message that always says:
"local variable 'PAD' referenced before assignment"
Trying to add part info by using the Assembly 4 Edit Part Information functionality will throw the same error.
To find out more about the issue I have tried to create part info and generate a BOM by using small test assemblies and single parts but I always fail and receive the above mentioned error alert.
My research online and in the forum brought no useful findings on the concern.
The problem is related to the FreeCAD\Mod\Assembly4\InfoKeys.py:
Code: Select all
### you have DOC
### research
for i in range(len(PART.Group)):
if PART.Group[i].TypeId == 'PartDesign::Body' :
BODY=PART.Group[i]
### you have BODY
for i in range(len(BODY.Group)):
if BODY.Group[i].TypeId == 'PartDesign::Pad' :
PAD=BODY.Group[i]
### you have PAD
try :
SKETCH=PAD.Profile[0]
### you have SKETCH
except NameError :
print('there is no Sketch on a Pad of : ',PART.FullName )
### start all autoinfofield
LabelDoc(self,PART,DOC)
LabelPart(self,PART)
PadLength(self,PART,PAD)
ShapeLength(self,PART,SKETCH)
Code: Select all
BODY.Group[i].TypeId == 'PartDesign::Pad'
is TRUE. Later the variable is used even if not initialized.
Can someone help? Thank you!