Macro: Version 3: helper tools to improve TechDraw documents
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Macro: Version 3: helper tools to improve TechDraw documents
Attached a macro containing some helper tools to improve TechDraw documents.
- Open a Techdraw document.
- Start the macro once.
- The command-panel will stay open until you quit.
- Preselect your linestyle/linewidth/linecolor using the radio-buttons in the underpart of the panel.
- Use the 5 helpers in any order, as often as you need.
- When ever creating new lines, all helpers use the preselected line attributes. - Quit the macro if you are finished.
How do the 5 helpers work:
1. Draw circle centerlines:
Draw a centerline cross at a circle or arc.
- Select many circles and/or arcs.
- Click the panel button.
2. Draw hole circle centerlines:
Draw centerlines of a hole circle, as shown in the above example.
- Select the circles of a hole circle.
- Select one circle or arc beeing concentric to the hole circle to find its center.
- Click the panel button.
3. Draw cosmetic thread:
Draw a 3/4 arc symbolising a thread seen from above.
- Select many circles.
- Click the panel button.
4. Vertex at intersection:
Create vertexes at the intersection(s) of two lines and/or arcs.
- select two lines/circles/arcs.
- Click the panel button.
5. Change the linestyle:
Change the linestyle/linewidth/linecolor to the preselected attributes.
- Preselect your new linestyle/linewidth/linecolor using the radio-buttons in the underpart of the panel.
- Select many lines/circles/arcs.
- Click the panel button.
Please give me further desires and comments.
The macro can be extended adding more helpers following your suggestion.
General use:- Open a Techdraw document.
- Start the macro once.
- The command-panel will stay open until you quit.
- Preselect your linestyle/linewidth/linecolor using the radio-buttons in the underpart of the panel.
- Use the 5 helpers in any order, as often as you need.
- When ever creating new lines, all helpers use the preselected line attributes. - Quit the macro if you are finished.
How do the 5 helpers work:
1. Draw circle centerlines:
Draw a centerline cross at a circle or arc.
- Select many circles and/or arcs.
- Click the panel button.
2. Draw hole circle centerlines:
Draw centerlines of a hole circle, as shown in the above example.
- Select the circles of a hole circle.
- Select one circle or arc beeing concentric to the hole circle to find its center.
- Click the panel button.
3. Draw cosmetic thread:
Draw a 3/4 arc symbolising a thread seen from above.
- Select many circles.
- Click the panel button.
4. Vertex at intersection:
Create vertexes at the intersection(s) of two lines and/or arcs.
- select two lines/circles/arcs.
- Click the panel button.
5. Change the linestyle:
Change the linestyle/linewidth/linecolor to the preselected attributes.
- Preselect your new linestyle/linewidth/linecolor using the radio-buttons in the underpart of the panel.
- Select many lines/circles/arcs.
- Click the panel button.
Please give me further desires and comments.
The macro can be extended adding more helpers following your suggestion.
Last edited by edi on Tue Mar 02, 2021 8:50 am, edited 3 times in total.
Re: Macro: helper tools to improve TechDraw documents
That's a cool macro, thanks for sharing!
One improvement that would come to mind is that finding the holecircle (I believe it's called "bolt circle" in English, btw) center could be automatic. I mean asking for the user to place the center is redundant information, because for three or more holes you can calculate it from the hole center positions, and for two holes you can place it at dead center (although, technically, there'd be infinite possible solutions for 2 holes). Also, there is a typo in one of the Command buttons: "Draw cosmetic t(h)read".
Re: Macro: helper tools to improve TechDraw documents
Thanks for the macro and for the way to communicate with the community!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Macro: helper tools to improve TechDraw documents
nice, at minimum deserves pole position in the new (needed) category TechDraw on Macros_recipes.
Re: Macro: Version 2.0: helper tools to improve TechDraw documents
Thanks to everybody giving comments and suggestions.
Attached find Version 2 including new helpers and previous helpers improved. Improved Helpers:
1. Bolt circle:
Former hole circle, got a new user interface as suggested by aapo
- select at least 3 circles
- click the button
2. Change line style:
- can now be operated using centerlines and/or cosmetic lines
New Helpers:
1. Center line:
Working similar to "official" command, but finds centerline if official command does not find.
Draw a centerline between two (not parallel) selected lines. Creates a cosmetic line.
- select two lines
- click the button
2. Cosmetic thread side view:
Draw a symbolic cosmetic thread (two lines) as side view
- select two parallel lines
- click the button
3. Insert '⌀' sign:
Insert a '⌀' sign ahead of the value of selected measures
- select some measures
- click the button
Please give me further desires and comments.
The macro can be easy extended adding more helpers following your suggestion.
Attached find Version 2 including new helpers and previous helpers improved. Improved Helpers:
1. Bolt circle:
Former hole circle, got a new user interface as suggested by aapo
- select at least 3 circles
- click the button
2. Change line style:
- can now be operated using centerlines and/or cosmetic lines
New Helpers:
1. Center line:
Working similar to "official" command, but finds centerline if official command does not find.
Draw a centerline between two (not parallel) selected lines. Creates a cosmetic line.
- select two lines
- click the button
2. Cosmetic thread side view:
Draw a symbolic cosmetic thread (two lines) as side view
- select two parallel lines
- click the button
3. Insert '⌀' sign:
Insert a '⌀' sign ahead of the value of selected measures
- select some measures
- click the button
Please give me further desires and comments.
The macro can be easy extended adding more helpers following your suggestion.
Last edited by edi on Sun Feb 14, 2021 12:40 pm, edited 2 times in total.
Re: Macro: Version 2: helper tools to improve TechDraw documents
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Macro: Version 2: helper tools to improve TechDraw documents
First off thank you for both your original macro and the version 2 macro. Excellent job.
OS: Ubuntu 20.04.2 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 2b881cccad603718b5b314f4414cf608ed841505
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
Did notice that panel for macro is able to move around but the resize handles have no effect. Maybe my settings for text size cause a problem.
See attached image.
Also is there an icon for the macro?
Not artistic but came up with possibly a starting point.
OS: Ubuntu 20.04.2 LTS (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 2b881cccad603718b5b314f4414cf608ed841505
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
Did notice that panel for macro is able to move around but the resize handles have no effect. Maybe my settings for text size cause a problem.
See attached image.
Also is there an icon for the macro?
Not artistic but came up with possibly a starting point.
- Attachments
-
- panel.jpg (20 KiB) Viewed 5202 times
-
- Icon Example.jpg (29.4 KiB) Viewed 5202 times
-
- TechDraw_Tools.svg
- (24.74 KiB) Downloaded 98 times
Re: Macro: Version 2: helper tools to improve TechDraw documents
How about this icon showing the cosmetic lines purpose? It scale quite good down to the small icons.
- Attachments
-
- TechDraw_Tools_cb.svg
- (8.79 KiB) Downloaded 102 times
-
- Bildschirmfoto 2021-02-14 um 19.40.49.png (10.12 KiB) Viewed 5180 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Macro: Version 3: helper tools to improve TechDraw documents
Attached the Version 3 of the TechDrawTools-Macro.
New dynamic GUI layout, having two tabs. It should be displayed correct at any display resolution.
Extended by 14 new features to create and manipulate dimensions. Commands decreasing the number of mouse clicks:
1. Increase/Decrease decimal places:
Increases or decreases the number of decimal places in the shown measure value.
- select one or more measure values
- click the button
2. Lock/Unlock a view:
Unlocked views become locked and converse.
- select a side view or section view
- click the button
3. Position a section view:
Position a section view exact above/below or aside its main view
- select a section view
- click the button
Create new and order existing dimensions:
4. Chain dimensions:
Create horizontal/vertical chain dimensions, see picture:
- select three or more vertexes
- click the button 5. Coordinate dimensions:
Create horizontal/vertical coordinate dimensions, see picture:
- adjust the wished cascade spacing value
- select three or more vertexes
- click the button 6. Create chamfer dimension:
Creates a horizontal/vertical dimension at a chamfer, including angle.
- select two vertexes defining a chamfer
- click the button
7. Position horizontal/vertical chain dimensions:
Position many dimensions at the same x-/y-coordinate. The first selected dimension is taken as base.
- select two or more horizontal/vertical existing dimensions
- click the button
8. Cascade horizontal/vertical dimensions:
Cascade the positions of many dimensions. The first selected dimension defines the cascade base. The selected "Cascade spacing" is used, see picture.
- adjust the wished cascade spacing value
- select two or more horizontal/vertical existing dimensions
- click the button Please give me further desires and comments.
The macro can be extended adding more helpers following your suggestion.
Benefits:New dynamic GUI layout, having two tabs. It should be displayed correct at any display resolution.
Extended by 14 new features to create and manipulate dimensions. Commands decreasing the number of mouse clicks:
1. Increase/Decrease decimal places:
Increases or decreases the number of decimal places in the shown measure value.
- select one or more measure values
- click the button
2. Lock/Unlock a view:
Unlocked views become locked and converse.
- select a side view or section view
- click the button
3. Position a section view:
Position a section view exact above/below or aside its main view
- select a section view
- click the button
Create new and order existing dimensions:
4. Chain dimensions:
Create horizontal/vertical chain dimensions, see picture:
- select three or more vertexes
- click the button 5. Coordinate dimensions:
Create horizontal/vertical coordinate dimensions, see picture:
- adjust the wished cascade spacing value
- select three or more vertexes
- click the button 6. Create chamfer dimension:
Creates a horizontal/vertical dimension at a chamfer, including angle.
- select two vertexes defining a chamfer
- click the button
7. Position horizontal/vertical chain dimensions:
Position many dimensions at the same x-/y-coordinate. The first selected dimension is taken as base.
- select two or more horizontal/vertical existing dimensions
- click the button
8. Cascade horizontal/vertical dimensions:
Cascade the positions of many dimensions. The first selected dimension defines the cascade base. The selected "Cascade spacing" is used, see picture.
- adjust the wished cascade spacing value
- select two or more horizontal/vertical existing dimensions
- click the button Please give me further desires and comments.
The macro can be extended adding more helpers following your suggestion.
-
- Posts: 73
- Joined: Wed Nov 11, 2020 10:43 am
Re: Macro: Version 3: helper tools to improve TechDraw documents
Hi edi,
your macro works really well. Is this possible to use your tool to create a hole table? Exporting these information to a file or python console is also fine.
(Source: solidsolutions)
Ps: i don't see an option to delete cosmetic objects. Using del key removes the whole view / page.
your macro works really well. Is this possible to use your tool to create a hole table? Exporting these information to a file or python console is also fine.
(Source: solidsolutions)
Ps: i don't see an option to delete cosmetic objects. Using del key removes the whole view / page.