easyw / kicadStepUpMod

kicadStepUp: ECAD to MCAD FreeCAD WorkBench
492 stars 63 forks source link

exporting arrays cause to object has no attribute 'ShapeColor' #190

Closed shprotru closed 1 year ago

shprotru commented 1 year ago

Related problem here. here is the sample: ITR9608-F.FCStd.zip try to select body, legarray and press export button at StepUp workbench.

however everything working fine while I am export the model manually in step format, I see in KiCad a colors that I set in FreeCAD.

failure log:

22:40:49  Running the Python command 'ksuToolsExportModel' failed:
Traceback (most recent call last):
  File "/home/eax/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/kicadStepUpMod/./kicadStepUpCMD.py", line 1286, in Activated
    routineScaleVRML()
  File "/home/eax/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 7445, in routineScaleVRML
    lbl=go_export(fullFilePathName)
  File "/home/eax/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 2706, in go_export
    export(objs, fPathName, 0.3937, lbl)
  File "/home/eax/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/kicadStepUpMod/./kicadStepUptools.py", line 2320, in export
    color.append(FreeCADGui.ActiveDocument.getObject(obj.Name).ShapeColor)

'Gui.ViewProviderLink' object has no attribute 'ShapeColor'

before export I set color attributes for array object.

easyw commented 1 year ago

@shprotru simply make a union of your parts... it will solve the issue ITR9608-F-union.zip

shprotru commented 1 year ago

@easyw wow, It works! I am very new to FreeCAD, can I able to ask you to add hint for kicadStepUpMod if it's see an array on export, like: "see array usage, select parts to unite, go to "Part" worbench and do a "Union" operation to unite parts"?

easyw commented 1 year ago

please have a look at https://github.com/easyw/kicadStepUpMod/blob/master/demo/kicadStepUp-cheat-sheet.pdf you can find it at Demo Menu under kSU FreeCAD WB