New Macros: GenerateViews and GenerateDrawing

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
mpetrasinovic
Posts: 106
Joined: Sat Feb 22, 2020 10:19 am
Location: Belgrade, Serbia
Contact:

New Macros: GenerateViews and GenerateDrawing

Post by mpetrasinovic »

The first macro is for automatic 2D views generation (with 6 normal projections and one isometric), available at:

https://github.com/PR-DC/PRDC_GenerateViews_FC

The second macro is for automatic drawing generation with 3 normal projections and one isometric (on the custom template), available at:

https://github.com/PR-DC/PRDC_GenerateDrawing_FC
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: New Macros: GenerateViews and GenerateDrawing

Post by johnwang »

Nice.

Looking forward for a section view.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
onekk
Veteran
Posts: 6222
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: New Macros: GenerateViews and GenerateDrawing

Post by onekk »

Well done thanks.

It is very interesting.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: New Macros: GenerateViews and GenerateDrawing

Post by johnwang »

Hi,

In Arch WB, I created a stair with the Stair tool. Then Generated the drawing.
The Front view is upside down.
Then I tried to Export page as SVG. When open the SVG with MS Edge, it says: "error on line 18 at column 518: Namespace prefix sodipodi on namedview is not defined"

I am new to TechDraw. Just wondering is there a control to not show the points?

Cheers,

John
dot.jpg
dot.jpg (9.1 KiB) Viewed 1862 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: New Macros: GenerateViews and GenerateDrawing

Post by wandererfan »

johnwang wrote: Sat Jan 08, 2022 11:37 pm I am new to TechDraw. Just wondering is there a control to not show the points?
Right click, "Toggle Frames".
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: New Macros: GenerateViews and GenerateDrawing

Post by johnwang »

wandererfan wrote: Sun Jan 09, 2022 1:31 am Right click, "Toggle Frames".
Perfect. Thank you.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
Polo
Posts: 6
Joined: Fri Nov 10, 2023 5:58 pm

Re: New Macros: GenerateViews and GenerateDrawing

Post by Polo »

Hi, unfortunately it`s not working on my pc.

Following message occurs:

18:39:14 C:/Users/mfhneu/AppData/Roaming/FreeCAD/Macro\test\PRDC_template_A3.svg
18:39:14 Traceback (most recent call last):
File "C:/Users/mfhneu/AppData/Roaming/FreeCAD/Macro/Autobemassung_Test.FCMacro", line 130, in <module>
template.Template = template_file
<class 'RuntimeError'>: Could not read the new template file

Please find also attached the file. (to reduce the file size I had to delete a few elements. But behaviour is same)

I would be very happy if someone knew a solution.

This is my freecad version:

Code: Select all

OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.21.1.33668 +26 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * A2plus 0.4.60n
  * fasteners 0.5.0
Attachments
ArchBehandlungsraum_neu3_Stückliste_reduziert.FCStd
(785.72 KiB) Downloaded 7 times
Post Reply