Custom template not usable as page

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!
francoislark
Posts: 15
Joined: Thu Jun 02, 2016 4:18 pm

Custom template not usable as page

Postby francoislark » Mon Jun 06, 2016 12:03 am

I created a custom template following the tutorial Drawing_Template_HowTo with Inkscape.
Adding this template in Freecad Templates directory didn't make it available in the drop-down list of the Drawing Workshop.
I could open the template with the button "open a svg file" but found no way to make it appear as a page in the tree, and I couldn't use it to create drawing views nor projections of my model.

I tried to use the US_Legal_ds_Landscape.svg file which I found on the FreeCAD website, and it didn't work either.
Is there a way to import US formats in the Drawing Workshop?
User avatar
bejant
Posts: 5950
Joined: Thu Jul 11, 2013 3:06 pm

Re: Custom template not usable as page

Postby bejant » Mon Jun 06, 2016 1:32 pm

francoislark wrote:I created a custom template following the tutorial Drawing_Template_HowTo with Inkscape.
Hi francoislark, is this the tutorial you used?
http://www.freecadweb.org/wiki/index.ph ... late_HowTo

General info:
http://www.freecadweb.org/wiki/index.ph ... _templates
francoislark wrote:Adding this template in Freecad Templates directory didn't make it available in the drop-down list of the Drawing Workshop.
francoislark wrote:I tried to use the US_Legal_ds_Landscape.svg file which I found on the FreeCAD website, and it didn't work either.
Is there a way to import US formats in the Drawing Workshop?
Yes, maybe these links will help you:
viewtopic.php?t=11628
https://github.com/quick61/FreeCAD-Draw ... s/issues/2
User avatar
wandererfan
Posts: 3144
Joined: Tue Nov 06, 2012 5:42 pm

Re: Custom template not usable as page

Postby wandererfan » Mon Jun 06, 2016 1:47 pm

francoislark wrote:Adding this template in Freecad Templates directory didn't make it available in the drop-down list of the Drawing Workshop.
Drawing Module only lists templates with a filename that matches this regular expression: "(A|B|C|D|E)(\\d)_(Landscape|Portrait)(_.*\\.|\\.)svg$", so "US_Legal_ds_Landscape.svg" would never appear in the list. You could maybe try "B4_Landscape_US_Legal.svg" to fiddle the system?

wf
francoislark
Posts: 15
Joined: Thu Jun 02, 2016 4:18 pm

Re: Custom template not usable as page

Postby francoislark » Mon Jun 06, 2016 2:45 pm

@wanderfan

With the new name B4_Landscape_US_Legal.svg the template appear in the list and is selectable.
I can edit the editable texts.

Thank you.

I didn't explore the other hints yet.
francoislark
Posts: 15
Joined: Thu Jun 02, 2016 4:18 pm

Re: Custom template not usable as page

Postby francoislark » Mon Jun 06, 2016 3:37 pm

@bejant

Yes, these were the tutorial and general info I used.

I found the links you gave very informative.

I was able to create my drawing with dimensions following the video https://www.youtube.com/watch?v=nxNT0KychcY in a B4 legal US format.
The only thing I miss, is how to create a dimension for an angle.

Thank you for your help!
tantle1961
Posts: 48
Joined: Tue Dec 27, 2016 4:13 am
Location: Washington State

Re: Custom template not usable as page

Postby tantle1961 » Tue Feb 28, 2017 3:57 pm

I was playing around with custom templates and found this thread. I was able to create my own SVG file.
Can my drawings be used with my custom templates? When I add an object, it always goes to the default A3 page.

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attachments
TA3_Template.svg
(26.92 KiB) Downloaded 65 times
Bathtub_Drawing.FCStd
(122.04 KiB) Downloaded 10 times
mario52
Posts: 2683
Joined: Wed May 16, 2012 2:13 pm

Re: Custom template not usable as page

Postby mario52 » Wed Mar 01, 2017 10:04 am

hi
rename your template A3_Landscape_TA3.svg and move it in C:\Program Files\FreeCAD 0.16\data\Mod\Drawing\Templates

in FreeCAD select your file in "Insert new drawing" Image
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Dialog creation. My macros on Gist.github.
tantle1961
Posts: 48
Joined: Tue Dec 27, 2016 4:13 am
Location: Washington State

Re: Custom template not usable as page

Postby tantle1961 » Fri Mar 03, 2017 11:34 pm

Very nice! Thank you very much.
tantle1961
Posts: 48
Joined: Tue Dec 27, 2016 4:13 am
Location: Washington State

Re: Custom template not usable as page

Postby tantle1961 » Sat Mar 04, 2017 5:57 am

I used your suggestion a couple of times and it worked like a charm... then I got this error ... or did I do something wrong?

1) Created the SVG file and named it as suggested. This worked
SVG file.jpg
SVG file name in Windows explorer
SVG file.jpg (19.52 KiB) Viewed 1107 times
2) I selected a drawing template from my new menu. This worked
SVG file.jpg
SVG file name in Windows explorer
SVG file.jpg (19.52 KiB) Viewed 1107 times
3) Then, another drawing... same as before but got this error. Notice the "TA32" in the file name. The file is "TA3.SVG". Is this a bug or did I do something to trigger it? This is a repeat from an earlier attempt. The first one was TA31 but I failed to get screenshot of it.
TA32 error.jpg
FreeCAD error message
TA32 error.jpg (23.43 KiB) Viewed 1107 times
OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Attachments
TA3 menu.jpg
FreeCAD menu selection
TA3 menu.jpg (14.1 KiB) Viewed 1107 times
triplus
Posts: 8786
Joined: Mon Dec 12, 2011 4:45 pm

Re: Custom template not usable as page

Postby triplus » Sat Mar 04, 2017 1:03 pm

Hi @tantle1961.

It looks like a different error but note that inserting more than 1 drawing template of the same type will result in issues after. When you reopen the file and recompute operation occurs. This is one of the known issues in FreeCAD 0.16. In addition you used custom drawing template therefore if you use FreeCAD on 2 computers the file won't work correctly on another if you don't provide the custom template there. Some of this was fixed in FreeCAD 0.17 and TechDraw (new drawing related workbench in FreeCAD 0.17) does this differently.

P.S. My recommendation would be use one drawing template of the same type per file and when you are done export to SVG and/or print to PDF.