PRJ - add-on for generating technical drawings

I just discovered this useful add-on PRJ for Blender , I share directly the readme.md file from the source page. This is underdevelopment but is already full of features


prj

What is prj

prj is a Blender add-on for generating technical drawings from 3d model.
Its main purpose is to help architects and designer to make building and interior drawings automatically. [anim]

Disclaimer

prj is currently under development and may be subject to changes: using it on production is on your own responsibility.
At the moment prj has been tested on Linux and Windows machines only and is not supposed to work on other OS

About prj

prj generates linked data-rich SVG drawings. In particular:

  • drawings are in SVG format
    Scalable Vector Graphics is a non-binary and non-proprietary format that can be viewed by a simple browser on any device. Interactivity can be implemented on it and its style can be handled by CSS. Editing is easy and graphically powerful using both open source source and proprietary softwares.
  • drawings are linked
    Every 3D object is represented in a single dedicated SVG file and all those files are linked (as <use> element) to the main drawing. That allows to keep files size small and to limit redrawing to changed objects only.
  • drawings are data-rich
    Every object stores informations about it directly inside the SVG. Hence text searches are possible over single and multiple drawings.

prj uses Blender Line Art feature and SVG grease pencil exporter.

Getting started

  1. Donwload the addon from here and install it in Blender
    Remember to install the dependencies to complete the installation (if it doesn’t work you can try to launch Blender as administrator)
  2. Prepare the scene you want to draw and make sure that geometries are correct.
  3. Select the camera for the drawing and set its type as Orthographic.
    In data properties window you can set other options for the camera such as the drawing scale or the file name.
    Clip start position defines cut plane.
  4. In order to set the objects drawing properties (like visibility, tagging or symbol type) check the object properties window.
  5. In the Output properties set the output path. Then, with the camera selected, in data properties window, click on Draw it!
  6. Your drawing is ready!
    Look for the svg file in the output path.
  7. Use an SVG editor to add dimensions, texts, graphics and create compositions and use css to style your drawing.

Greetings.

10 Likes

Are there any good tutorials for setting up the drawing border, dimensions and annotations in Inkscape?

Hi Ben,
Inkscape has a recently added feature to draw dimensions to the drawing: https://wiki.inkscape.org/wiki/Release_notes/1.0#Measure_Segments_LPE
With some css tweaks you can change the arrow and style the dimension to fit you needs (like I did here: https://twitter.com/i/status/1529134419772071938).
In order to add annotations and other graphics Inkscape has so many tools: you can easily find a lot of tutorials on internet

3 Likes

I can’t install dependencies I also tried in root mode but I don’t have the option to install dependencies.
Can they be installed manually?
image

That’s strange! What’s your OS?
Of course you can install them manually by pip: they are svgwrite and pillow

I’ve installed the dependencies but not works, I think my OS has some issues since the upgrade to Ubuntu 20.04LTS, in fact after upgrade come out various issues with Apparmor.

And I get this error:

bpy.context.space_data.system_bookmarks_active = 3
Modules Installed (prj-main) from '/home/us128128/Scaricati/prj-main.zip' into '/home/us128128/.config/blender/2.93/scripts/addons'
Traceback (most recent call last):
  File "/home/us128128/Software/blender-2.93.10/2.93/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "/home/us128128/.config/blender/2.93/scripts/addons/prj-main/__init__.py", line 33, in <module>
    from prj.main import reset_scene, main
ModuleNotFoundError: No module named 'prj'

The problem seems related to the name of the folder where the add-on is installed: “prj-main” is not the correct one.
It seems that the add-on has been downloaded from the button at the top of the web page
Screenshot from 2022-05-25 18-07-23

You could just rename the folder in “prj” but I suggest you to download the most recent version from the releases page or use the direct link reported in the Getting started guide
Let me know if it works

1 Like

Now seem working with the renaming of dir, but inside the release file zipped have a different name with version numbering, so I have to rename even this.

But I think the exported file need a better naming like the blender file name with camera. or maybe the collection.
An other thing the SVG is a bit strange because I can’t open it with QCAD or FreeCAD, and from Inkscape I can’t have a working DXF when I try to export into DXF.
But anyway is good tool to have with Blender :slight_smile:

1 Like

Thanks @pafurijaz for your report! :grinning: It’s very useful!

Now seem working with the renaming of dir, but inside the release file zipped have a different name with version numbering, so I have to rename even this.

The zipped file name contains the version number but the folder inside is correctly named as “prj” (during the installation process blender ignore the zipped file name: it’s its content that matter)

But I think the exported file need a better naming like the blender file name with camera. or maybe the collection.

It’s a good advice, thanks: at the moment the svg file is named after the camera or you can set the name in the “Drawing name” field. Your suggestion is interesting: let me think about it

An other thing the SVG is a bit strange because I can’t open it with QCAD or FreeCAD, and from Inkscape I can’t have a working DXF when I try to export into DXF.

I didn’t try to open the svg in other softwares than Inkscape and some browser (Firefox and Brave). I definitively should make some test on Illustrator, QCAD, Freecad, ect… but I think that the problem is caused by the svg linked structure: the final drawing is a collection of links (as tag) to other drawings (for every object in the scene a different svg is generated) and this linking could create some problem to softwares like the ones you mentioned.
I think that it’s for the same reasons that the Inkscape DXF exportation doesn’t work correctly: this is why I wrote this script to convert svg to dwg (but my main goal is to completely get rid of CAD softwares…)

But anyway is good tool to have with Blender :slight_smile:

Thank you so much! Your help is very precious :hugs:

1 Like

the name is that when I download the release source zipped

Yes I’ve tried to re-save in SVG from Inkscape but nothing is changed, the issue persist, I will investigate better.
Greetings

Sorry: I didn’t point out that the link to the add-on in the releases page is the “Add-on” one (I imagine you clicked on the “Source code (zip)” one, instead).
Screenshot from 2022-05-26 09-04-47

About the choice of using the SVG format with a linked structure it’s worth saying that prj aims to produce drawings that store data: every object in the drawing can, therefore, return informations about it (product id, size, weight, physical properties, cost, typology, family belonging, etc… like in BIM) and allow user to get, for example, bill of quantities or interactive drawing you can query…
File formats like dxf or dwg can’t do this (no need to say that I think it’s better to avoid proprietary formats).
The underlying idea of prj is to avoid other steps than modeling (storing all data, using in Blender) and representing (composing, adding annotations and dimensions, styling it with css, using Inkscape).

Anyway, if you need to edit the SVG in another software, you have to embed all the linked parts of the drawing. To do that select all the objects (on all layers) and click on “Edit > Clone > Unlink Clones recursively”. All the external drawings will be embedded and, after saving the file, you should be able to open it on other applications.
I hope I have been helpful

Yes, I have downloaded the source version.

Regarding the need for DXF is mainly to add dimensions to drawings, an indispensable thing, however it is still essential to use the DXF format, I don’t use DWG but to communicate with other design applications and for production with CNC machines is the use of the DXF format is still essential.

But your script still looks great, and if you can add dimensions capability in the future, perhaps using the Measure it add-on in some way, it will be a great thing.

Thanks

1 Like

Thank @pafurijaz,
at the moment I suggest to add dimensions with Inkscape with the Measure segments LPE tools: I used for a lot of architectural drawings and I could say that it works pretty well (even if, compared to CAD softwares, it lacks some features: in that case I needed to do some tweak with the css).
I never worked with CNC machines: do you know if SVG files aren’t compatible with this kind of works?

Thanks, will try this tools, again about DXF file format is at today the exchange format to everyone, I understand your idea, but in architectural and CAD drawings field, is also the common one, for laser cutting machine is still used widely by every company in the world. I think there are few machine can read also SVG, maybe with dedicated software I’ve seen something around the web, but I think they convert path to DXF.

1 Like

I would love to see a tutorial on how to create an Inkscape drawing border, views, dimensions and annotations using SVGs generated from the Blender prj addon.

Hi Ben,
I should definitely make some documentation and tutorial. At the moment I’m a little busy so I can’t do it but I’ll tell you here when I do something.

For now I can suggest to import the drawing made with prj in a new svg file (in Inkscape click on File > Import > … > Include SVG image as editable object(s) in the current file) in order to keep the linked system working (this way you can redraw the scene and your edits will not affected).

About drawing border and graphics, if you prefer not to draw them yourself, you can download those I made from https://gitlab.com/marzof/prj/-/tree/main/assets (you can find them in the assets folder of the add-on too). Then you can import the ones you need in a new drawing as well.

For the dimensions you can use the LPE Measure segments as you can see here…

1 Like

Thank you ever so much, that is really helpful!

1 Like

https://twitter.com/i/status/1533710082109849600

3 Likes

This is cool feature, I will test now with simple scene.
Thanks.

1 Like

Every thing works fine, but I’ve an issue in fact when I change the scale from 1:100 (default) to 1:1 everything is stuck until the crash.

But without touching scale works very well, Now we have a great tool for exporting Grease Pencil Line art into CAD Drawing.

Great job!

I’ve a request the ability to export also the #lineart already computed without regenerating everything all times, because I make drawing also in this way, this can also reduce the time because you can export a partial parts of the scene, maybe with the ability to select scenes or objects or LineArt.
Maybe this change cause you a problem because you have to move your form from the camera table to the output render.

1 Like