problem with handwriting dwg templates with editable text

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
MIKE_BRANDT
Posts: 23
Joined: Thu Jun 24, 2021 4:22 am

problem with handwriting dwg templates with editable text

Post by MIKE_BRANDT »

i am making ansi drawing blocks
i am writing the code in note pad

the code is based on
<!-- Автор:-=SpV=-
Верстак: TechDraw
Версия: 2.2
Шрифт: GOSTRUS https://fontlibrary.org/ru/font/gostrus-type-a -->
who wrote code for drawing blocks in Russian

in the code there are 5 groups
one overall group that is translated
4 groups that are inside the first group
• the first group is lines
• the second group is of text that is non editable
• the third group is of text that is editable and 6 pixels text
• the forth group is of text that is editable and 3 pixels text
there is a problem with the editable text
the transpose moves the movable text
but it dose not move the green blocks that are associated with the text
this is a a size a dwg (8.5x11)
the title block is written with origin at 0,0
the transpose moves the block to its position in the a size block
this is so the block can be used with other size dwg templates

i would like to put in an image but it seems to be beyond me right now

it looks like he had the same issue as me with
the translation not moving the green boxes
so he moved the editable text out of the translation group
and directly addressed the position of the editable text

any help would be appreciated

yes it is all lower case
yes there is no punctuation
i use a carage return for a period
dyslexia is my constant companion
the only reason it looks this good is because of spell check


THIS IS THE CODE so far
<svg
xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:freecad="http://www.freecadweb.org/wiki/index.ph ... _Namespace"
width="215.9mm"
height="279.4mm"
viewBox="0 0 215.9 279.4">

<g
transform="translate(44.45, 215.9)">
<g
id="thick-titleblock-structure"
style="fill:none;stroke:#000000;stroke-width:0.6;stroke-linecap:miter;stroke-miterlimit:4">
<rect width="158.750" height="50.800" x="0.000" y="0.000" />

<path d="m 50.800, 15.875 h 107.950" />
<path d="m 50.800, 34.925 h 107.950" />
<path d="m 50.800, 44.450 h 107.950" />

<path d="m 50.800, 0.000 v 50.800" />

<path d="m 60.325, 34.925 v 9.525" />
<path d="m 88.900, 34.925 v 9.525" />
<path d="m 149.225, 34.925 v 9.525" />

<path d="m 76.200, 44.450 v 6.350" />
<path d="m 114.300, 44.450 v 6.350" />
</g>

<g
id="titleblock-text-non-editable"
style="font-style:italic;font-size:2.5px;text-anchor:start;fill:#000000;font-family:'GOSTRUS'"
xml:space="preserve">
<text x=" 51.300" y=" 3.000">LOGO</text>
<text x=" 51.300" y="18.875">TITLE</text>

<text x=" 51.300" y="37.925">SIZE</text>
<text x=" 60.825" y="37.925">CAGE CODE</text>
<text x=" 89.50" y="37.925">DWG NO</text>
<text x="149.725" y="37.925">REV</text>

<text x=" 51.300" y="47.450">SCALE</text>
<text x=" 76.700" y="47.450">WGHT</text>
<text x="114.800" y="47.450">SHEETS</text>
</g>

<g
id="titleblock-text-editable"
style="font-style:italic;font-size:6px;text-anchor:start;fill:#000000;font-family:'GOSTRUS'"
xml:space="preserve">
<text freecad:editable="TITLE 1" x="53.3" y="24.875">TITLE 1<tspan></tspan></text>
<text freecad:editable="TITLE 2" x="53.3" y="31.875">TITLE 2<tspan></tspan></text>
<text freecad:editable="SIZE" x="53.3" y="42.875">B<tspan></tspan></text>
</g>

<g
id="titleblock-text-editable"
style="font-style:italic;font-size:3px;text-anchor:start;fill:#000000;font-family:'GOSTRUS'"
xml:space="preserve">
<text freecad:editable="CAGE CODE" x="61.825" y="42.875">CAGE CODEX<tspan></tspan></text>
<text freecad:editable="DWG NO" x="90.50" y="42.875">DWG NOX<tspan></tspan></text>
<text freecad:editable="REV" x="150.725" y="42.875">REVX<tspan></tspan></text>
</g>

</g>

</svg>
mendy
Posts: 262
Joined: Mon May 21, 2018 2:16 pm

Re: problem with handwriting dwg templates with editable text

Post by mendy »

Probably not much help but you can open and existing template in Inkscape, ungroup the title block, open the xml editor and click on different items and it shows the code.

Another maybe in video some other hints

https://www.youtube.com/watch?v=kcmdJ7xa7gg

Just a thought

For my custom templates I opened existing in Inkscape and modified it for my use.
MIKE_BRANDT
Posts: 23
Joined: Thu Jun 24, 2021 4:22 am

Re: problem with handwriting dwg templates with editable text

Post by MIKE_BRANDT »

i started out with the video that you are talking about
i ran in to problems using inkscape with the same issue of moving text but not moving the green blocks
i worked through the tutorial for templates that are on the freecad website
all of them kept moving the text but leaving the green blocks behind
so i went back to basics for me and wrote a program with minimal commands and simple structure
there seems to be a basic problem when moving editable text that is inside a group with a "transform="translate" command
is there anybody who is familiar with the internal workings of TechDraw templates that i could talk to.
MIKE_BRANDT
Posts: 23
Joined: Thu Jun 24, 2021 4:22 am

Re: problem with handwriting dwg templates with editable text

Post by MIKE_BRANDT »

found a reference to green dots not dots not handling transform clauses

I'll call this closed


Re: techDraw templates and text
• Report this post
• Quote
Postby wandererfan » Sun Feb 17, 2019 6:20 am
dpettegrew wrote: ↑Sat Feb 16, 2019 4:22 pm Is it possible to have text rotated 90 degrees in a FreeCAD template? I am working with the techdraw workbench on FreeCAD 0.18 and have created a template following the available tutorial. I have some text I've rotated 90 degrees in the source .svg file and followed the same steps to make the FreeCAD editable text but the rotated text does not have the green handles on the template in FreeCAD.


Actually, I've never tried. Should be fine for static text. The logic for the green dots/editable text location doesn't handle transform clauses (rotate, translate, etc). Usually when this logic gets confused, the dot is on the page, just nowhere near the text. If you post your template, I'll have a look.
Re: techDraw templates and text
Post Reply