Macro: Version 3: helper tools to improve TechDraw documents

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Macro: Version 3: helper tools to improve TechDraw documents

Post by edi »

Attached a macro containing some helper tools to improve TechDraw documents.
TechDrawTools.FCMacro
(15.23 KiB) Downloaded 403 times
TechDrawTools01.png
TechDrawTools01.png (97.56 KiB) Viewed 5178 times
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.
TechDrawTools.FCMacro
(15.23 KiB) Downloaded 403 times
- 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.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Macro: helper tools to improve TechDraw documents

Post by aapo »

edi wrote: Mon Feb 01, 2021 2:37 pm Attached a macro containing some 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".
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Macro: helper tools to improve TechDraw documents

Post by chrisb »

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.
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Macro: helper tools to improve TechDraw documents

Post by heda »

nice, at minimum deserves pole position in the new (needed) category TechDraw on Macros_recipes.
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: Macro: Version 2.0: helper tools to improve TechDraw documents

Post by edi »

Thanks to everybody giving comments and suggestions.
Attached find Version 2 including new helpers and previous helpers improved.
TechDrawTools02.FCMacro
(17.32 KiB) Downloaded 134 times
TechDrawTools.png
TechDrawTools.png (108.84 KiB) Viewed 5179 times
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.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Macro: Version 2: helper tools to improve TechDraw documents

Post by chrisb »

:+1:
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mendy
Posts: 262
Joined: Mon May 21, 2018 2:16 pm

Re: Macro: Version 2: helper tools to improve TechDraw documents

Post by mendy »

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.
Attachments
panel.jpg
panel.jpg (20 KiB) Viewed 5172 times
Icon Example.jpg
Icon Example.jpg (29.4 KiB) Viewed 5172 times
TechDraw_Tools.svg
(24.74 KiB) Downloaded 97 times
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Macro: Version 2: helper tools to improve TechDraw documents

Post by chrisb »

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
Bildschirmfoto 2021-02-14 um 19.40.49.png (10.12 KiB) Viewed 5150 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
edi
Posts: 481
Joined: Fri Jan 17, 2020 1:32 pm

Re: Macro: Version 3: helper tools to improve TechDraw documents

Post by edi »

Attached the Version 3 of the TechDrawTools-Macro.
TechDrawTools03.FCMacro
(31.84 KiB) Downloaded 172 times
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.
TechDraw05.png
TechDraw05.png (94.31 KiB) Viewed 4919 times
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
TechDraw02.png
TechDraw02.png (32.93 KiB) Viewed 4919 times
5. Coordinate dimensions:
Create horizontal/vertical coordinate dimensions, see picture:
- adjust the wished cascade spacing value
- select three or more vertexes
- click the button
TechDraw01.png
TechDraw01.png (27.22 KiB) Viewed 4919 times
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
TechDraw04.png
TechDraw04.png (40.44 KiB) Viewed 4919 times
Please give me further desires and comments.
The macro can be extended adding more helpers following your suggestion.
ngocminhdao88
Posts: 73
Joined: Wed Nov 11, 2020 10:43 am

Re: Macro: Version 3: helper tools to improve TechDraw documents

Post by ngocminhdao88 »

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.

Image
(Source: solidsolutions)

Ps: i don't see an option to delete cosmetic objects. Using del key removes the whole view / page.
Post Reply