Macro FaceToSketch: Difference between revisions
Renatorivo (talk | contribs) (Marked this version for translation) |
m ({{Code|code=) |
||
Line 1: | Line 1: | ||
<translate> |
<translate> |
||
<!--T:1--> |
<!--T:1--> |
||
{{Macro|Icon=Text-x-python|Name=FaceToSketch|Description=Converts a face into a sketch without constraints.|Author=Jreinhardt}} |
{{Macro|Icon=Text-x-python|Name=FaceToSketch|Description=Converts a face into a sketch without constraints.|Author=Jreinhardt|Version=1.0}} |
||
<!--T:2--> |
<!--T:2--> |
||
Line 8: | Line 8: | ||
</translate> |
</translate> |
||
{{Code|code= |
|||
<syntaxhighlight> |
|||
import Draft |
import Draft |
||
Line 19: | Line 20: | ||
for wire in wires: |
for wire in wires: |
||
FreeCAD.ActiveDocument.removeObject(wire.Name) |
FreeCAD.ActiveDocument.removeObject(wire.Name) |
||
}} |
|||
</syntaxhighlight> |
|||
{{clear}} |
{{clear}} |
||
<languages/> |
<languages/> |
Revision as of 11:14, 23 September 2016
File:Text-x-python FaceToSketch |
Description |
---|
Converts a face into a sketch without constraints. Macro version: 1.0 Author: Jreinhardt |
Author |
Jreinhardt |
Download |
None |
Links |
Macros recipes How to install macros How to customize toolbars |
Macro Version |
1.0 |
Date last modified |
None |
FreeCAD Version(s) |
None |
Default shortcut |
None |
See also |
None |
This macro breaks down your form with function Draft Downgrade and transforms the face selected in a sketch without constraints, and ready to be modified.
import Draft
wires,_faces = Draft.downgrade(FreeCADGui.Selection.getSelection(),delete=True)
sketch = Draft.makeSketch(wires[0:1])
for wire in wires[1:]:
Draft.makeSketch([wire],addTo=sketch)
for wire in wires:
FreeCAD.ActiveDocument.removeObject(wire.Name)