TechDraw templates scale

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
User avatar
salp
Posts: 168
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

TechDraw templates scale

Postby salp » Fri Oct 20, 2017 10:07 pm

Today the Drawing workbench disappeared, I know that this is a profile issue but I thought lets give TechDraw a try.

I noticed that when I create a new page the locations of the editable text is not in the correct place , I also loaded the ANSI templates that Mario52 created and they have the same issue (see images below). If you use the Drawing Dimension tool it shown the points and lines to select out of the viewing window like they are scaled way too big, once you select the points and close the dialog box the dimension is placed in the correct position.

I looked in the TechDraw preferences but I dont see any obvious settings to adjust, I also opened the svg files with Inkscape and the XY locations of the editable text seem correct.

Am I missing a setting somewhere.

TechDraw_ISO_Template.png
TechDraw_ISO_Template.png (190.91 KiB) Viewed 2009 times
TechDraw_ANSI_Template.png
TechDraw_ANSI_Template.png (275.94 KiB) Viewed 2009 times

OS: Linux Mint 18 Sarah
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12433 (Git)
Build type: None
Branch: master
Hash: 489c8c9aefbd38cd51751de9b25113b9d2032e80
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
User avatar
salp
Posts: 168
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: TechDraw templates scale

Postby salp » Fri Oct 20, 2017 10:13 pm

I deleted the user.cfg and system.cfg files and the drawing templates are now showing up correctly. I am still curious about what makes the svg templates behave strangely.

PS:
I placed the ANSI templates in the user ./home/polifemos/.FreeCAD/Mod/Drawing/Templates directory and changed the TechDraw default path, is that the correct way to add templates?

Thanks
OS: Linux Mint 18 Sarah
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12433 (Git)
Build type: None
Branch: master
Hash: 489c8c9aefbd38cd51751de9b25113b9d2032e80
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
User avatar
salp
Posts: 168
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: TechDraw templates scale

Postby salp » Fri Oct 20, 2017 10:18 pm

I forgot to mention the issue only happens when using the templates from the Drawing module or the templates downloaded from the WIKI, the templates from the TechDraw module work correctly.

I guess I'll go back and read some more :oops:
User avatar
salp
Posts: 168
Joined: Thu Nov 21, 2013 11:58 pm
Location: Putnam, NY

Re: TechDraw templates scale

Postby salp » Fri Oct 20, 2017 10:23 pm

I'm embarrased :oops: :D

Right on the TechDraw WIKI
TechDraw drawings and Python API are not interchangeable with the Drawing module. It is possible to convert Drawing Pages to TechDraw Pages using Python (moveViews.py). It is possible to have both TechDraw and Drawing Pages in the same FreeCAD document.
mario52
Posts: 2582
Joined: Wed May 16, 2012 2:13 pm

Re: TechDraw templates scale

Postby mario52 » Sat Oct 21, 2017 10:41 am

hi salp
yes is not well positioned but the position in the template is good (Misc_templates_Full)
(English page)
TemplateTD00.png
TemplateTD00.png (35.5 KiB) Viewed 1946 times

ps: the French page is +/- good !? (can deepen the creation of the page)
TemplateTD01.png
TemplateTD01.png (19.79 KiB) Viewed 1946 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
wandererfan
Posts: 2696
Joined: Tue Nov 06, 2012 5:42 pm

Re: TechDraw templates scale

Postby wandererfan » Sun Oct 22, 2017 5:25 pm

salp wrote:
Fri Oct 20, 2017 10:23 pm
I'm embarrased :oops: :D
;) chin up, happens to me all the time.

TechDraw can not handle editable field definitions that are affected by an SVG transform clause (like this one):

Code: Select all

<g transform="translate(87,-65)">
To accurately position the green dots, TD needs to know the actual X,Y position of the editable field on the page.

Code: Select all

	<g
		id="titleblock-text-editable"
		style="font-size:5px;text-anchor:start;fill:#000000;font-family:osifont"
		xml:space="preserve">
		<text freecad:editable="AUTHOR_NAME" x="108" y="171"><tspan>AUTHOR NAME</tspan></text>
		<text freecad:editable="DRAWING_TITLE" x="168" y="171"><tspan>DRAWING TITLE</tspan></text>
		<text freecad:editable="SI-1" x="108" y="182"><tspan></tspan></text>
		<text freecad:editable="FreeCAD_DRAWING" x="108" y="189"><tspan>FreeCAD DRAWING</tspan></text>
		<text freecad:editable="SI-3" x="108" y="196"><tspan></tspan></text>
		<text freecad:editable="FC-SI" x="233" y="171"><tspan>A4</tspan></text>
		<text freecad:editable="FC-SH" x="251" y="171"><tspan>X / Y</tspan></text>
		<text freecad:editable="FC-SC" x="271" y="171"><tspan>SCALE</tspan></text>
    	<text freecad:editable="PN" x="231" y="181"><tspan>PN</tspan></text>
		<text freecad:editable="DN" x="231" y="189"><tspan>DN</tspan></text>
		<text freecad:editable="FC-DATE" x="231" y="197"><tspan>DD/MM/YYYY</tspan></text>
		<text freecad:editable="FC-REV" x="269" y="197"><tspan>REV A</tspan></text>
	</g>
Many (most?) Drawing module templates have the freecad::editable definitions within the scope of a transform clause, so the green dots come out in the wrong place. To convert a Drawing template for TD, just move the freecad::editable definitions outside the transform scope and adjust the X,Y's.

Lines, literal text, graphics etc within the template definition can use transform.

wf
User avatar
yorik
Site Admin
Posts: 11249
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: TechDraw templates scale

Postby yorik » Mon Oct 23, 2017 7:15 pm

It is annoying that in inkcape, when for example you move a text, instead of changing the X and Y values of the <text> element,it adds it to a new group with a transform.. I wish they had an option to prevent that, or a way to remove unnecessary groups like that
User avatar
cappy0815
Posts: 352
Joined: Tue Oct 07, 2014 5:27 am
Contact:

Re: TechDraw templates scale

Postby cappy0815 » Thu Jan 25, 2018 6:29 am

Hey guys,

I have the same problem, but I am not sure if I understood the solution in this thread.

What do I have to do?

This is my system:

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10802 (Git)
Build type: Release
Branch: master
Hash: 10ce910c03347a90712327a7cc7be2bcdee13afc
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
This is my problem:
Bild 1.png
Bild 1.png (28.96 KiB) Viewed 1649 times
And this is a part of the XML-Code:

Code: Select all

<g
 
    id="titleblock-text-editable"
   style="font-size:5px;font-family:osifont;text-anchor:start;fill:#000000"
   xml:space="preserve"
   transform="matrix(2.8346456,0,0,2.8346456,-81.520816,-241.50846)">
 
   <text
     freecad:editable="Dokumententitel"
     x="220.72714"
     y="244.2408"
     id="text52"><tspan
     x="220.72714"
     y="244.2408"
     id="tspan50">Dokumententitel</tspan></text>
<text
     freecad:editable="Untertitel1"
     x="221.14009"
     y="247.44516"
     id="text56"
     style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.11666679px;font-family:osifont;-inkscape-font-specification:'osifont, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start"><tspan
       id="tspan54" x="221.14009" y="247.44516"
       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.11666679px;font-family:osifont;-inkscape-font-specification:'osifont, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start">Untertitel 1</tspan></text>
I used inkscape to edit the svg and had a close look to the XML-Editor.
After that I tried to "adjust" the green dots on editing the SVG as XML in text-editor.

Can somebody find my mistake?

Regards
Michael
chrisb
Posts: 16249
Joined: Tue Mar 17, 2015 9:14 am

Re: TechDraw templates scale

Postby chrisb » Thu Jan 25, 2018 7:31 am

cappy0815 wrote:
Thu Jan 25, 2018 6:29 am
What do I have to do?

This is my system:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10802 (Git)
Please update your version to be prepared for an answer of a TechDraw-insider. You are 2000 commits behind and I bet a lot of them concern TechDraw.
User avatar
cappy0815
Posts: 352
Joined: Tue Oct 07, 2014 5:27 am
Contact:

Re: TechDraw templates scale

Postby cappy0815 » Thu Jan 25, 2018 2:03 pm

... did

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13086 (Git)
Build type: Release
Branch: master
Hash: f64760b8a3dabf9d218418f6a3980d900b39d703
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
... but as expected, it's the same.

Michael