I want extract this preselected edge into a sketch, at same position.
If I draw another new sketch, it hard to align the same position with same radium. So I want just extract (export) it.
can extract a edge to a sketch?
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
can extract a edge to a sketch?
- Attachments
-
- 2017-03-10 08-38-27屏幕截图.png (18.65 KiB) Viewed 3827 times
Re: can extract a edge to a sketch?
hi
use this macro Macro_Repro_Wire (select the wire and launch the macro)
and this macro for convert the wire in circle (select the wire and launch the macro)
mario
use this macro Macro_Repro_Wire (select the wire and launch the macro)
and this macro for convert the wire in circle (select the wire and launch the macro)
Code: Select all
import Draft
from FreeCAD import Base
from FreeCAD import Vector
selectionObjects = FreeCADGui.Selection.getSelectionEx() # Select an object or sub object getSelectionEx
for selection in selectionObjects:
for selectedEdge in selection.SubObjects:
if (str(selectedEdge.Curve)[0:6] == "Circle"):
pl = selectedEdge.Placement
pl.Base=FreeCAD.Vector(selectedEdge.Curve.Center)
pl.Rotation.Q = App.Rotation(App.Vector(0,0,1),selectedEdge.Curve.Axis).Q
cercle = Draft.makeCircle(radius=selectedEdge.Curve.Radius, placement=pl, face=False, support=None)
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: can extract a edge to a sketch?
mario52, thanks, it work.
but I got a sketch? or a face? it not a circle anymore. I can not edit as circle. when I edit, I got this edit box.
but I got a sketch? or a face? it not a circle anymore. I can not edit as circle. when I edit, I got this edit box.
- Attachments
-
- 2017-03-10 21-26-43屏幕截图.png (17.73 KiB) Viewed 3800 times
Re: can extract a edge to a sketch?
If you select the planar face next to the selected circle and then create a sketch in Part Design the sketch is attached to that face. You can use external geometry to select the circle. That gives you the center and the radius, which is all you need for a circle.eexpss wrote: If I draw another new sketch, it hard to align the same position with same radium. So I want just extract (export) it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: can extract a edge to a sketch?
Yes, I know this. but I can not snap the circle to the external circle. I just can align the center point of the circle.chrisb wrote:If you select the planar face next to the selected circle and then create a sketch in Part Design the sketch is attached to that face. You can use external geometry to select the circle. That gives you the center and the radius, which is all you need for a circle.eexpss wrote: If I draw another new sketch, it hard to align the same position with same radium. So I want just extract (export) it.
- Attachments
-
- out-1.ogv.gif (268.96 KiB) Viewed 3789 times
Re: can extract a edge to a sketch?
Select both circles and apply the equality constraint "=".
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: can extract a edge to a sketch?
I forgot this. goooood idea. thanks.chrisb wrote:Select both circles and apply the equality constraint "=".
Re: can extract a edge to a sketch?
You're welcome.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.