[Feature request] TechDraw: Auto complete fields in new draw

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
svbol
Posts: 41
Joined: Mon Dec 09, 2019 8:29 pm

[Feature request] TechDraw: Auto complete fields in new draw

Post by svbol »

I have two questions about TechDraw:

1. What you think - can be need autocomplete this fields in new draw for users?
TD_AutoDate1.png
TD_AutoDate1.png (95.55 KiB) Viewed 1848 times

Result:
TD_AutoDate2.png
TD_AutoDate2.png (96.5 KiB) Viewed 1848 times
Usually I insert needed info in fields for new draw manually after creating.
But FreeCAD can do it automatic! And Scale value can be insert automatic too.

2. For automatic insert FreeCAD must have standard field names.
But templates for TechDraw have different names:

A4_Portrait_ISO7200TD.svg have this ("field" = text in draw):

Code: Select all

        "AUTHOR_NAME" = AUTHOR_NAME
        "DRAWING_TITLE" = DRAWING TITLE
        "FC-SC" = SCALE
        "FC-DATE" = DD/MM/YYYY

But A3_Landscape_EN_m52.svg have this:

Code: Select all

        "AUTHOR_NAME" = AUTHOR NAME
        "TITLE" = TITLE
        "SCALE" = SCALE
        "CREATION_DATE" = CREATION_DATE
        "COMPANY_NAME" = COMPANY NAME
With different names autocomplete can't work.
May be you have list of standard names of fields?
As example:

"FC_CreatedBy"
"FC_Company"
"FC_CreationDate"
"FC_Title"
"FC_Scale" etc...
Last edited by svbol on Fri Jan 10, 2020 4:48 pm, edited 1 time in total.
User avatar
wandererfan
Veteran
Posts: 6171
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by wandererfan »

svbol wrote: Sun Jan 05, 2020 12:23 am 1. What you think - can be need autocomplete this fields in new draw for users?
On the surface, this sounds a lot like issue #3911 / https://www.forum.freecadweb.org/viewto ... 81#p263293.
svbol
Posts: 41
Joined: Mon Dec 09, 2019 8:29 pm

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by svbol »

Yes. FreeCAD have many small tasks for automatization.

As example - I create new templates for TD.
It's not templates from https://forum.freecadweb.org/viewtopic. ... 5&start=40
It based on ISO templates from FreeCAD. I use text editor only, not Inkscape.
My templates are small files and have work green labels.
But I not know - what name must have fields for value...
In future this field must be used for link between FreeCAD and SVG files.

In attach - A4 formats. Can you test it and insert this files in Templates folder in TD?

P.S. I cannot change source of FreeCAD (have not python knowledge).
And not help you in your work with TechDraw...
Attachments
A4_Portrait_GOST_F2a.svg
(3.45 KiB) Downloaded 74 times
A4_Portrait_GOST_F2.svg
(5.31 KiB) Downloaded 53 times
A4_Portrait_GOST_F1.svg
(6.9 KiB) Downloaded 53 times
A4_Landscape_GOST_F1.svg
(6.64 KiB) Downloaded 59 times
Last edited by svbol on Fri Jan 10, 2020 4:48 pm, edited 1 time in total.
mario52
Veteran
Posts: 4670
Joined: Wed May 16, 2012 2:13 pm

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by mario52 »

hi

here example a macro for the drawing Module Macro_CartoucheFC_Full

mario
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.
svbol
Posts: 41
Joined: Mon Dec 09, 2019 8:29 pm

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by svbol »

Ow. it's first being in my head - create macro for all Russian standard GOST templates (A5 to A0).
But FreeCAD use SVG files for template.
And I change ISO template for GOST size and labels.

Thank for link...
User avatar
wandererfan
Veteran
Posts: 6171
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by wandererfan »

svbol wrote: Sun Jan 05, 2020 8:43 pm In attach - A4 formats. Can you test it and insert this files in Templates folder in TD?
The templates look fine to me, but I don't read Russian and I don't know the GOST standard.

There is a directory structure for the Russian templates:

Code: Select all

Templates
    RU_GOST
        Leading
        Leading_text
        Subsequent
Where do your templates fit into that structure?
svbol
Posts: 41
Joined: Mon Dec 09, 2019 8:29 pm

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by svbol »

1. Russian standard - GOST, you can see size and placing in pictures:
http://docs.cntd.ru/document/1200045443
Usually we use Form 1 and Form 2.

Picture in big size - Image

2. I try use templates from this folder in first time.
And receive two problem:
1. Green lables not work - I can't change any text. May be TechDraw WB not supported non-English letters in SVG file (I say about "freecad:editable" fields).
2. Size of many lines have't integer value (as in standard).

I open template in TD/Templates folder (in text editor xed) and change all needed values.
User avatar
wandererfan
Veteran
Posts: 6171
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by wandererfan »

svbol wrote: Fri Jan 10, 2020 5:18 pm I open template in TD/Templates folder (in text editor xed) and change all needed values.
Do your 4 templates replace templates already in RU_GOST? If they replace existing templates, which ones (the names are not the same).

Or are they additional templates? If they are new additions should they go in the RU_GOST directory, or in one of the child directories ( Leading, Leading_text, Subsequent)?
svbol
Posts: 41
Joined: Mon Dec 09, 2019 8:29 pm

Re: [Feature request] TechDraw: Auto complete fields in new draw

Post by svbol »

I think FreeCAD users use 1-2 standards and 2-3 sizes of sheet.
In system folder FreeCAD must have standard templates only.
All other templates must be placed in User folder (for using, change, test or delete).

What user can select new page?
And I see two ways:

1. Using Drawing WB way for open TechDraw templates (picture for example only):
List of templates with alphabetical sorting by size (A0...A5) or standards (clear sheet, ANSI, GOST, ISO, JIS).
In this picture list sorted by size:
Drawning_WB.png
Drawning_WB.png (118.73 KiB) Viewed 1567 times

And sorted by standard:
Drawning_WB1.png
Drawning_WB1.png (126.69 KiB) Viewed 1567 times


List of templates must read all templates from FreeCAD folder and from User folders both:
/usr/share/freecad-daily/Mod/TechDraw/Templates/
/home/user/.FreeCAD/Mod/TechDraw/Templates/

User's template have other icon for difference or other group of templates.


2. Using Macro for creating page for TechDraw without any template (all sizes of all standards) and open user's templates.
Buttons for "Insert Default page", "Insert Standard Page" and "Insert User's Page using Template" can be joined in one menu:
Drawing_WB2.png
Drawing_WB2.png (51.11 KiB) Viewed 1567 times


In any case after creating new page I want see this fields with text:

Code: Select all

   Scale (every page can have own scale)
   Page (number of current page)
   Pages (all pages in this file without hidden pages)
And other fields...


P.S. May be you not need insert my templates in next build before this change...
Post Reply