[Improvement] Autofill name and date in template
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Improvement] Autofill name and date in template
In Catia the Drawing workbench auto-fills certain text fields in the Page Templates that come with the software. TechDraw could do the same.
The usage would be something like a button in the TechDraw toolbar to open a dialog with the fields that can be written in the page template. It could also have a button in this dialog to automatically fill at least Author Name (the username which the operating system would report), Date (taken from some Qt function), and Title (file name or part name). Another option is to right click the field in the page itself (highlighted in green) which would open a menu to choose Author name, Date, Page Number, etc.
I think in order to implement this well, each SVG Template should use a standardized name for the fields, for example, FC_AUTHOR, FC_DATE, FC_DRAWING_NAME, FC_SCALE, etc. The current Templates (A0 to A4) already include some of these fields, but I'm not sure if they have been standardized yet.
Catia can save arbitrary variables with text or numerical values; the values can be used to compute distances for use in sketches or elsewhere, and the text can be used in the text fields in the Drawing pages. Maybe in FreeCAD the same could be done by storing information in a Spreadsheet (Spreadsheet_Workbench); TechDraw could then read the variables and auto-fill the Templates as long as they have standard names.
The usage would be something like a button in the TechDraw toolbar to open a dialog with the fields that can be written in the page template. It could also have a button in this dialog to automatically fill at least Author Name (the username which the operating system would report), Date (taken from some Qt function), and Title (file name or part name). Another option is to right click the field in the page itself (highlighted in green) which would open a menu to choose Author name, Date, Page Number, etc.
I think in order to implement this well, each SVG Template should use a standardized name for the fields, for example, FC_AUTHOR, FC_DATE, FC_DRAWING_NAME, FC_SCALE, etc. The current Templates (A0 to A4) already include some of these fields, but I'm not sure if they have been standardized yet.
Catia can save arbitrary variables with text or numerical values; the values can be used to compute distances for use in sketches or elsewhere, and the text can be used in the text fields in the Drawing pages. Maybe in FreeCAD the same could be done by storing information in a Spreadsheet (Spreadsheet_Workbench); TechDraw could then read the variables and auto-fill the Templates as long as they have standard names.
Last edited by vocx on Sat Oct 20, 2018 7:30 am, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: [Improvement] Autofill name and date in template
You should use the Author name from FreeCAD's preferences.vocx wrote: ↑Sat Oct 20, 2018 4:15 am The usage would be something like a button in the TechDraw toolbar to open a dialog with the fields that can be written in the page template. It could also have a button in this dialog to automatically fill at least Author Name (the user name which the operating system would report),
I don't like too much automatism, but for your personal use you can write a macro.vocx wrote: ↑Sat Oct 20, 2018 4:15 am Catia can save arbitrary variables with text or numerical values; the values can be used to compute distances for use in sketches or elsewhere, and the text can be used in the text fields in the Drawing pages. Maybe in FreeCAD the same could be done by storing information in a Spreadsheet (Spreadsheet_Workbench); TechDraw could then read the variables and auto-fill the Templates as long as they have standard names.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Improvement] Autofill name and date in template
creo have something similar but get all info some properties.vocx wrote: ↑Sat Oct 20, 2018 4:15 am I think in order to implement this well, each SVG Template should use a standardized name for the fields, for example, FC_AUTHOR, FC_DATE, FC_DRAWING_NAME, FC_SCALE, etc. The current Templates (A0 to A4) already include some of these fields, but I'm not sure if they have been standardized yet.
Would be a great addition!! maybe FC should find a( or more) method to find common model properties so it would be usble for all workbenches!!
Re: [Improvement] Autofill name and date in template
Sure, I think that'd work. Author, Company or Organization, and Date would be the three most important values to keep updated, I think.
I think it's personal preference. I think many people would benefit from having the date automatically updated in the TechDraw Page with a simple click of a button. Writing a personal macro would be unnecessary if it can be included in the workbench itself. As with many tools that are part of FreeCAD you may decide to not use autofill at all; it'd be entirely optional.I don't like too much automatism, but for your personal use you can write a macro.
Last edited by vocx on Tue Oct 23, 2018 5:01 pm, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: [Improvement] Autofill name and date in template
A Preference object associated with a model. Or as I suggested, a Spreadsheet that has key-value pairs with different information. Then the specific workbenches would read the information off this spreadsheet.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: [Improvement] Autofill name and date in template
I didn't mean that using the date would be too much automatism, but connecting it with a spreadsheet should be done by a personal macro.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- carbonblueGTS
- Posts: 6
- Joined: Fri Jan 18, 2019 8:20 pm
- Location: Fort Worth, Texas
Re: [Improvement] Autofill name and date in template
How would you go about doing that? I have a spreadsheet with all the information. I was following this template: https://www.freecadweb.org/wiki/Manual: ... readsheets but for it to work, I have to be able to enter an expression. Editable fields don't allow for expressions, so I'm stuck. Thoughts?
Re: [Improvement] Autofill name and date in template
From the page you linked:carbonblueGTS wrote: ↑Sun Jan 20, 2019 5:33 am Editable fields don't allow for expressions, so I'm stuck. Thoughts?
Although these results are expressed with their units, the values can be manipulated as any number, try for example entering in cell C1: =B1*2.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- wandererfan
- Veteran
- Posts: 6317
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: [Improvement] Autofill name and date in template
Could somebody make a Feature Request for this so it doesn't get overlooked in v0.19 development?
Author and Company are available in Preferences>General>Document. Date is easy, but it shouldn't update automatically, just when the Page is changed? Page number could be the sequence number of the Page in the Document, but I'm not sure that is necessarily the desired Page number.
Not sure how we can enforce using the correct names for Template fields. I guess if you don't use the right names in your custom template then you don't get to use the auto-entry feature.
Author and Company are available in Preferences>General>Document. Date is easy, but it shouldn't update automatically, just when the Page is changed? Page number could be the sequence number of the Page in the Document, but I'm not sure that is necessarily the desired Page number.
Not sure how we can enforce using the correct names for Template fields. I guess if you don't use the right names in your custom template then you don't get to use the auto-entry feature.
- carbonblueGTS
- Posts: 6
- Joined: Fri Jan 18, 2019 8:20 pm
- Location: Fort Worth, Texas
Re: [Improvement] Autofill name and date in template
I think I was unclear in what I was asking, my fault. If I have a value in a spreadsheet, I can currently reference that value in a sketch by clicking the "Expression" button and linking a cell from the spreadsheet like this:chrisb wrote: ↑Sun Jan 20, 2019 6:10 amFrom the page you linked:carbonblueGTS wrote: ↑Sun Jan 20, 2019 5:33 am Editable fields don't allow for expressions, so I'm stuck. Thoughts?Although these results are expressed with their units, the values can be manipulated as any number, try for example entering in cell C1: =B1*2.
However, if I want a Techdraw template to auto-fill the fields based on the values in a spreadsheet, I can't do it because there's no "Expression" button:
Is there a work-around for this?