[prj] Blender add-on to create technical drawing

edited June 2022 in General

Hi everyone,
I'm Marco, an italian architect and a free software enthusiast. I embraced open source about ten years ago and, obviously, I'm very interested in what this community is achieving. Thank you so much!

In the last years I tried to apply the DevOps principles and tools to architectural practice: I found that this kind of tools and methodology (git, gitlab, scripting automation...) could really help in creating a positive working environment and increase process and design quality.

A very important part of my job is producing technical documentation: in order to reduce the risk of error and lighten the workload I wrote a Blender add-on to get 2d vectorial linked data-rich drawings (in svg format) from the 3d model (created in Blender).
I know that generating drawing from IFC is a crucial issue and some of you is working very hard to solve it: my add-on is not so ambitious (I needed an immediate solution for my everyday work) but I think it could work pretty well and, maybe, someone could find it useful.
If you want to try it you can download it from https://gitlab.com/marzof/prj .
For now it has been tested on linux machine only and it definitively needs a documentation! I hope to find the time to write it down but, for now, you can follow the "Getting started" guide on the README (and you can absolutely write here, or open an issue, to ask question or report some bug).
Bye,
Marco

JanFpaulleeMassimoDADA_universeDarth_BlenderNigelCoenchunchkbitacovirengfernandoand 4 others.
«134

Comments

  • edited May 2022

    This is awesome, but man, i wish you would consolidate efforts with https://github.com/IfcOpenShell/IfcOpenShell/issues/1153
    Side note, I feel OSarch's role should be to incentivize developers to work together, and provide less redundant solutions. I think this is where the funding should be directed to, as brainstormed here.

    NigelduncanJanF
  • edited May 2022

    You're totally right and I definitively agree with you.
    As I said I made this add-ons to address the immediate need of a tool that lighten my everyday work (I started writing it before the funding raising started). If I had the required skills I surely would help but I'm still a self employed architect, not a developer, and couldn't promise a consistent effort...
    Anyway, I don't want to distract anyone from the big goal of an IFC generated drawing tool (which I'm looking forward to use) so keep up the good work: if I can, I absolutely will contribute!

  • Very nice work @strumet !
    I was wondering about what do you mean with "applying DevOps principles and tools to architectural practice" ?
    Btw i'm from Italy too :-)

  • Hi Massimo and thanks for your appreciation!
    Applying DevOps to architecture is something - I think - could help to improve the quality of work in architectural practices: in general it's about creating a tracked, non-destructive, distributed and discrete process to manage the design and the interactions between people.
    We used git (a version control system) to track the progress of the project and to handle alternative versions. A gitlab instance (a devops platform installed on a private server) has been used as centralized repository where everyone could take part of the process (discussion about the design, decision making, collaborative writing, etc... ). When possible I wrote down some script to automate repetitive or mechanical tasks in order to reduce the risk of error and dedicate more time to creativity and other important activities. Every tasks has been broken into small jobs, every file into smaller files. The 3d model was the only SSoT (Single Source of Truth)...
    ...It's not easy to explain but if you want I'm at your disposal.

    Nigelavnd
  • edited May 2022

    Very interesting! So git is used for .dxf, .dwg, etc.. files and not only for text files, right?
    If so, git would be used like a CDE right?

  • Sure! Git can track versions of every kind of file. Obviously you can't diff two binary files (this is one of the reasons I chose SVG as drawing format) but you can definitively move from a version to another of a dwg or a blend file.
    I never used a CDE but I think that you can get something very similar (and maybe better) by combining a vcs (like git), a devops platform (like gitlab) and tools like BlenderBIM (for authoring IFC) and IFC.js (as viewer).

  • Very cool!

  • @strumet Thank you for sharing, I have tried to install on win10 but when I click on 'install dependencies' I got... Command '['D:\Program Files\Blender Foundation\Blender 3.1\3.1\python\bin\python.EXE', '-m', 'pip', 'install', 'svgwrite']' returned non-zero exit status 1.
    I am wondering what I need to do better next time :)
    any help will be appreciated

  • Hi Nigel,
    thanks for your report. I just started to test the add-on on windows (until now I just used it on linux machines) and I already found some error to fix (but there is a quick workaround you can apply to use it anyway).
    But the error you encountered is different from what I found: it seems a problem with the installations of the dependencies. To fix it I need some more time but, in the meantime, maybe you could try to install the 2 dependencies. These are:

    If you can install them by pip on python then you should be able to use the add-on (but, as I said, you need to apply a little fix in the code).
    Let me know what you get and I'll try to help you.
    (Maybe it's better to move this conversation to a dedicated space like the issues of the project: https://gitlab.com/marzof/prj/-/issues/ . Could you send me there a screenshot of the command line error? Thanks)

    Nigel
  • Hi @Nigel ,
    I made some test on Windows and fixed the errors I mentioned in my previous post.
    For the moment you should succeed in installing the dependencies if you launch blender as administrator: let me know if it works.
    I also found that the dependencies installation error should not happen if Blender is installed from the zipped portable version (not the installer) in a simple folder (not a system folder).
    If you want to try it you can download the latest release from https://gitlab.com/marzof/prj/-/releases

  • @strumet said:
    Hi @Nigel ,
    I made some test on Windows and fixed the errors I mentioned in my previous post.
    For the moment you should succeed in installing the dependencies if you launch blender as administrator: let me know if it works.
    I also found that the dependencies installation error should not happen if Blender is installed from the zipped portable version (not the installer) in a simple

    folder (not a system folder).

    If you want to try it you can download the latest release from https://gitlab.com/marzof/prj/-/releases

    Thank you, I'm working away from home for a few days but I will try it when I get home again

    strumet
  • Hi everyone,
    I just wanted to inform you that the development of prj add-on is going on.
    Now it works both on Linux and on Windows machines. Furthermore, it is now capable to export DXF and DWG files, other than SVG drawings.
    You can download it by clicking on the Add-on link of the release page and install it as usual.
    If you need some advise on using it, let me know (or open an issue on the add-on page): I'll be glad to help!

    NigelCoen
  • Hello @strumet
    I am trying to install it on Blender in Windows 11 and first it says the module has been installed but when i click it to activate it it gives me this error :
    Traceback (most recent call last):
    File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\addon_utils.py", line 351, in enable
    mod = import(module_name)
    File "C:\Users\const\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\prj-main__init__.py", line 34, in
    from prj.main import reset_scene, main
    ModuleNotFoundError: No module named 'prj'

  • edited June 2022

    Oh sorry i was using the wrong zip file. Now I got it installed including the dependencies!
    However i am not able to generate anything. Is it possible to have a simple test scene that works?

    strumet
  • @strumet said:
    Hi everyone,
    I just wanted to inform you that the development of prj add-on is going on.

    Hi @strumet it sould be so great to make a little page on the wiki for prj.

    Help push that message here:


    https://fosstodon.org/@osarch/108430195794840545

    So far I have just added it to https://wiki.osarch.org/index.php?title=Category:Blender_Add-on but it would be better if it had a page like https://wiki.osarch.org/index.php?title=CAD_Sketcher Let me know if you (or anyone) are up for that and need a hand.

    strumetengfernando
  • Thanks @duncan,
    at the moment you can find a simple (but substantial) presentation of the add-on on the README of the repo. Let me know whether it fits your idea of page for the wiki or you was thinking of something different

  • edited June 2022

    @strumet thanks for the question! Since I've answer this question a few time I decided to answer it on the wiki!
    Here's an explanation, please let med know what you think of the explanation on that page at What is a software page on our wiki?

    @bitacovir I would love your comments as well - or just edit the explanation - it's mostly us two who make new software pages.

    bitacovir
  • Novice Warning
    Hi @strumet I have tried to install the latest version for a test drive, I did run Blender as an Admin. but seem to be missing something?
    any help will be appreciated

  • Hi @Nigel,
    everything seems ok: if the button "Install dependencies" is greyed out it means that they are already installed (I should remove the warning message in case like this).
    Try using the add-on and let me know if it works

    Nigel
  • @strumet
    Is it possible to record a short step by step tutorial for generating a drawing from scratch? Like for example one sphere and a cube .
    I followed the settings with different options, setting the camera, but the svg that i generate is blank.

  • Hi @Constantinesis,
    Which software are you using to see the svg file?

  • Let me also know if you can correctly read the files in the generated folder (the one named after the camera)

  • edited June 2022

    @strumet said:
    Hi @Constantinesis,
    Which software are you using to see the svg file?

    I opened them in Adobe Illustrator. I saw some layers but all is white and there's nothing to select either.
    Ok I will check the other files . By the way the svg itself is not 0kb just that I didn't see any lines
    Another question is how do you define the hatch of the closed meshes that are cut by clipping plane?

  • edited June 2022

    Ok, thanks.
    The reason for the "void" drawing is that AI doesn't seem too much compliant with the SVG specifications. In this case I think that AI isn't capable of reading the "use" tag that links all the external SVGs. I don't know if there is some setting in AI that fix this problem: some workaround for AI users is possible but it needs to be implemented in the add-on code... I'll think about it.
    For the meantime I suggest you to use Inkscape: there you can embed all the external svg (select all and then launch the command Edit > Clone > Unlink clone recursively) and save it for being read by AI.

    bitacovir
  • @Constantinesis
    The hatch for the cut surface is a simple fill. You can change it by css (even using patterns): https://css-tricks.com/almanac/properties/f/fill/

    Constantinesis
  • Hi @duncan,
    I added a dedicated prj page to the wiki and to the software and blender add-on categories: https://wiki.osarch.org/index.php?title=Prj
    Let me know if it's ok.
    About the explanation you wrote in What is a software page on our wiki? I think it's ok.
    Maybe, in the section Usage of that page, it should be written how to create a new page (it's not so straightforward, it took me a while to do it) and explained better how to use categories to insert new contents to a thematic list.

  • I've given you upload rights @strumet so now you can upload an icon and a screenshot. I went through the page and did some copy-editing to give it the same style as the other pages. Looks good! If you want to use the wiki to start some docs you're very welcome.

  • @duncan Thank so much for your revision! You're a great editor!
    Now the page is much better.
    As soon as I create an icon for prj and find out what kind of screenshot could be meaningful I'll complete the page
    It seems that the link to the Blender_Add-on category doesn't work (it's actually missing). Do you know how to fix it?

  • edited June 2022

    @strumet said:
    @Constantinesis
    The hatch for the cut surface is a simple fill. You can change it by css (even using patterns): https://css-tricks.com/almanac/properties/f/fill/

    Thanks! It works ! You were right, checked the css and its fine, Then actually i installed ODA for dxf and it works so it was AI issue with svg,
    Does the CSS styling work only with svg right?
    One more thing that Blender needs now is some kind of built-in svg or dxf viewer or mode to integrate better. Or maybe some kind of collaboration with MeasureItArch plugin creator which offers viewport visibility It also has dxf export but I find yours much straightforward and easy to use for quick setups.

    Actually if i think about it, Blender has already all the features to visualize section cuts and floorplans in viewport but it just needs some kind of template or Mode or automation script to handle these in correlation with the modelling and exporting.

  • Thanks! It works ! You were right, checked the css and its fine, Then actually i installed ODA for dxf and it works so it was AI issue with svg,

    I'm happy it works!

    Does the CSS styling work only with svg right?

    Yes, it works with svg only (other than html, obviously).

    One more thing that Blender needs now is some kind of built-in svg or dxf viewer or mode to integrate better. Or maybe some kind of collaboration with MeasureItArch plugin creator which offers viewport visibility It also has dxf export but I find yours much straightforward and easy to use for quick setups.
    Actually if i think about it, Blender has already all the features to visualize section cuts and floorplans in viewport but it just needs some kind of template or Mode or automation script to handle these in correlation with the modelling and exporting.

    Your suggestions are interesting: prj is just born and, at the moment, I don't know which direction it will take in the future. I generally tend to think that every software has to do its own duty: Blender is a wonderful Swiss army knife for handling three-dimensional entities but 2D graphics is such a vast field that I think its better doing it with a dedicated software (and Inkscape is perfect for it).
    Anyway I can't be sure that I won't change my mind in the future: before releasing prj I didn't think to add a DXF/DWG exporter to it (it wasn't its main purpose). But after talking with the some users I realized that it would be a useful feature not difficult to implement

Sign In or Register to comment.