Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
cadcam
Posts: 273
Joined: Thu Apr 02, 2020 10:39 am

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by cadcam »

Not been able to try, so this may already be enabled.

Is it possible to select geometry and then choose a vertex or point as the copy reference point,
then on paste keep the selected point/vertex under mouse and allow it to snap to
existing geometry


Regards
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

cadcam wrote: Wed Feb 02, 2022 4:35 pm Not been able to try, so this may already be enabled.

Is it possible to select geometry and then choose a vertex or point as the copy reference point,
then on paste keep the selected point/vertex under mouse and allow it to snap to
existing geometry


Regards
Currently it just paste the geometry where it was when copied.

As soon as group dragging is solved then I'll upgrade that functionality as discussed in my previous post. This way it will be able to drop the pasted geometries anywhere.
toni_lv
Posts: 11
Joined: Tue Nov 03, 2020 8:10 pm
Location: Spain

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by toni_lv »

Great feature very useful when working with splines or similar shapes that are repetitive to create over and over. If in a future works across sketches it would a huge improve in Sketcher Workbench.
Congratulations for your great features in Sketcher. In my opinion this is one of the parts of FreeCAD that needs more improvements.
kisolre
Veteran
Posts: 4163
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by kisolre »

Should the sketcher be able to accept standard Copy/Paste/... messages with that? Now the only way to know there is something pastable in the clipboard is if you copied it there. No copy/paste icon indication, menu items, ...

Code: Select all

<GeometryList count="4">
    <Geometry  type="Part::GeomLineSegment">
        <GeoExtensions count="1">
            <GeoExtension type="Sketcher::SketchGeometryExtension" internalGeometryType="0" geometryModeFlags="00000000000000000000000000000000" geometryLayer="0"/>
        </GeoExtensions>
        <LineSegment StartX="-35.49" StartY="32.4121" StartZ="0" EndX="-14.1332" EndY="32.4121" EndZ="0"/>
    </Geometry>
    <Geometry  type="Part::GeomLineSegment">
        <GeoExtensions count="1">
            <GeoExtension type="Sketcher::SketchGeometryExtension" internalGeometryType="0" geometryModeFlags="00000000000000000000000000000000" geometryLayer="0"/>
        </GeoExtensions>
        <LineSegment StartX="-14.1332" StartY="32.4121" StartZ="0" EndX="-14.1332" EndY="4.8995" EndZ="0"/>
    </Geometry>
    <Geometry  type="Part::GeomLineSegment">
        <GeoExtensions count="1">
            <GeoExtension type="Sketcher::SketchGeometryExtension" internalGeometryType="0" geometryModeFlags="00000000000000000000000000000000" geometryLayer="0"/>
        </GeoExtensions>
        <LineSegment StartX="-14.1332" StartY="4.8995" StartZ="0" EndX="-35.49" EndY="4.8995" EndZ="0"/>
    </Geometry>
    <Geometry  type="Part::GeomLineSegment">
        <GeoExtensions count="1">
            <GeoExtension type="Sketcher::SketchGeometryExtension" internalGeometryType="0" geometryModeFlags="00000000000000000000000000000000" geometryLayer="0"/>
        </GeoExtensions>
        <LineSegment StartX="-35.49" StartY="4.8995" StartZ="0" EndX="-35.49" EndY="32.4121" EndZ="0"/>
    </Geometry>
</GeometryList>
<ConstraintList count="8">
    <Constrain Name="" Type="1" Value="0" First="0" FirstPos="2" Second="1" SecondPos="1" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="1" Value="0" First="1" FirstPos="2" Second="2" SecondPos="1" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="1" Value="0" First="2" FirstPos="2" Second="3" SecondPos="1" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="1" Value="0" First="3" FirstPos="2" Second="0" SecondPos="1" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="2" Value="0" First="0" FirstPos="0" Second="-2000" SecondPos="0" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="2" Value="0" First="2" FirstPos="0" Second="-2000" SecondPos="0" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="3" Value="0" First="1" FirstPos="0" Second="-2000" SecondPos="0" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
    <Constrain Name="" Type="3" Value="0" First="3" FirstPos="0" Second="-2000" SecondPos="0" Third="-2000" ThirdPos="0" LabelDistance="10" LabelPosition="0" IsDriving="1" IsInVirtualSpace="0" IsActive="1" />
</ConstraintList>
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

toni_lv wrote: Wed Feb 02, 2022 9:40 pm Great feature very useful when working with splines or similar shapes that are repetitive to create over and over. If in a future works across sketches it would a huge improve in Sketcher Workbench.
Congratulations for your great features in Sketcher. In my opinion this is one of the parts of FreeCAD that needs more improvements.
It does work accross sketches and accross Freecad instances!
kisolre wrote: Thu Feb 03, 2022 1:34 pm Should the sketcher be able to accept standard Copy/Paste/... messages with that? Now the only way to know there is something pastable in the clipboard is if you copied it there. No copy/paste icon indication, menu items, ...
Yes the function will catch all the text that is in the clipboard. But if it does not recognize the correct syntax then nothing happens.
And indeed there is no indicator that there is something pastable in the clipboard. But is that really a problem?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by adrianinsaval »

I see no need for a clipboard indicator, and don't recall any software that has that either
kisolre
Veteran
Posts: 4163
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by kisolre »

adrianinsaval wrote: Thu Feb 03, 2022 2:18 pm But is that really a problem?
adrianinsaval wrote: Thu Feb 03, 2022 2:18 pm and don't recall any software that has that either
Copy some sketch items (Ctrl-C). While in sketch editing mode Paste icon in toolbar is not active. Close sketch. Open macro editor in FreeCAD. Paste icon activates and text can be pasted with any of the standard methods. Isn't that why those are standardized?
I dont know how this actually works but probably when something is selected that could be copied the clipboard mechanism is informed about that and copy/cut shortcuts are activated. Then when control is entered (3D view, text field, ...) if there is something in the clipboard and it supports pasting it is informed about clipboard content and if pasting is possible paste mechanisms are activated...
At least that is how I understand that mechanism works. Enlighten me if I am wrong.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by adrianinsaval »

I see now, yes it would be better if the paste command becomes active
derMart
Posts: 27
Joined: Tue Dec 28, 2021 10:50 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by derMart »

This is a *VERY* useful feature. What is the status? Could you please link the pull request here?

EDIT: Found the pull request, here it is: https://github.com/FreeCAD/FreeCAD/pull/5480
Post Reply