Added a work-around for running CQ scripts from the FreeCAD macro editor.
This commit is contained in:
parent
1533eb25e4
commit
dfba0f3d5e
|
@ -46,6 +46,10 @@ def show(cqObject, rgba=(204, 204, 204, 0.0)):
|
||||||
|
|
||||||
ad = FreeCAD.activeDocument()
|
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 we've got a blank shape name, we have to create a random ID
|
||||||
if not cqObject.val().label:
|
if not cqObject.val().label:
|
||||||
#Generate a random name for this shape in case we are doing multiple shapes
|
#Generate a random name for this shape in case we are doing multiple shapes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user