Code: Select all
No more downgrade possible
Code: Select all
Unable to upgrade these objects.
Code: Select all
wireList=[W,W1]
wd=Draft.downgrade(wireList)
Code: Select all
No more downgrade possible
Code: Select all
Unable to upgrade these objects.
Code: Select all
wireList=[W,W1]
wd=Draft.downgrade(wireList)
Upgrade and downgrade accept a parameter to control exactly what type of operations are done, see Draft_Upgrade#Scripting, Draft_Downgrade#Scripting.freecc wrote: ↑Sun Apr 15, 2018 9:02 am ...
The wires show in the document and I can use both commands in the GUI with the buttons for downgrade and upgrade. It creates two faces and in the other case one wire disappears. This is not what I want but one step at a time. Why doesn't it work in python?
...
Code: Select all
addList, deleteList = Draft.upgrade(objects, delete=False, force=None)
# If force is given, it is the internal function to call to force a certain way of upgrading. It can be: "makeCompound", "closeGroupWires", "makeSolid", "closeWire", "turnToParts", "makeFusion", "makeShell", "makeFaces", "draftify", "joinFaces", "makeSketchFace", "makeWires", or "turnToLine".
Code: Select all
addList, deleteList = Draft.downgrade(objects, delete=False, force=None)
# If force is given, it is the internal function to call to force a certain way of downgrading. It can be: "explode", "shapify", "subtr", "splitFaces", "cut2", "getWire", or "splitWires".
Code: Select all
c = Part.makeCircle(radius, p, tg)
f = Part.Face(Part.Wire(c))
section = target.section(f)
Part.show(section)
doc.recompute() # not sure if it's needed
obj, foo = Draft.downgrade(section, delete=True)
Code: Select all
Draft.downgrade(App.ActiveDocument.getObject('MyShape'))
Code: Select all
c = Part.makeCircle(radius, p, tg)
f = Part.Face(Part.Wire(c))
section = target.section(f) # section is a shape
section_obj = Part.show(section) # section_obj is a document object built from the shape
doc.recompute() # not sure if it's needed
obj, foo = Draft.downgrade(section_obj, delete=True)
objects: Part::Feature or list
A single object to downgrade or a list
containing various such objects.