Macro FaceToSketch: Difference between revisions

From FreeCAD Documentation
No edit summary
m ('''Macro_FaceToSketch.FCMacro''')
Line 5: Line 5:


<!--T:2-->
<!--T:2-->
==Description==
This macro breaks down your form with function {{KEY|[[Image:Draft Downgrade.png|16px]] [[Draft Downgrade]]}} and transforms the face selected in a sketch without constraints, and ready to be modified.
This macro breaks down your form with function {{KEY|[[Image:Draft Downgrade.png|16px]] [[Draft Downgrade]]}} and transforms the face selected in a sketch without constraints, and ready to be modified.


==Script==
</translate>
</translate>

'''Macro_FaceToSketch.FCMacro'''


{{Code|code=
{{Code|code=

Revision as of 20:47, 7 August 2018

Other languages:

File:Text-x-python FaceToSketch

Description
Converts a face into a sketch without constraints.

Macro version: 1.0
Last modified: 2013-12-23
Author: Jreinhardt
Author
Jreinhardt
Download
None
Links
Macro Version
1.0
Date last modified
2013-12-23
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Description

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.

Script

Macro_FaceToSketch.FCMacro

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)