Added a work-around for running CQ scripts from the FreeCAD macro editor.

This commit is contained in:
Jeremy Mack Wright 2018-12-27 17:17:38 -05:00
parent 1533eb25e4
commit dfba0f3d5e

View File

@ -46,6 +46,10 @@ def show(cqObject, rgba=(204, 204, 204, 0.0)):
ad = FreeCAD.activeDocument()
if ad == None:
FreeCAD.newDocument("untitled" + str(random()))
ad = FreeCAD.activeDocument()
# If we've got a blank shape name, we have to create a random ID
if not cqObject.val().label:
#Generate a random name for this shape in case we are doing multiple shapes