Automatically baking shaded grasshopper to pdf

Hello,

I am trying to figure out how to automatically save a pdf from a grasshopper generated assembly with the press of a button. I found a script doing something quite similar from the following thread:

This works quite well (I still need to do some maths making sure that the assembly always scales right and is centred) but when I run it, it bakes/prints the wireframe to pdf. I don’t want the wireframe but a shaded, rendered or arctic view. I’ve searched through the code, but this script far exceeds my skills in programming so I couldn’t find what to add/adjust to solve this.

I’ve attached the grasshopper script, as well as what I want vs what it returns.

I hope some of you are able to help me solve this.

Thanks in advance!

Rollsystem.gh (100.1 KB)
What_I_Get.pdf (2.0 KB)
What_I_Want.pdf (865.6 KB)

It seems that this is too much to ask, so let me explain what I really need:

I am working on a script that automatically reads an Excel sheet that my company has, to make a model of a assembly (similar to the gh file I attached in the main post) and display it with measurements and material count.

My boss wants me to add a system in this to print this display on A4 so it can be sent to the workplace for production/assembly. It needs to be idiot-proof because the person who prepares those drawings isn’t skilled with Rhino/Grasshopper. To make it look professional, the assembly needs to be displayed on the same spot on every order, where the assembly is scaled accordingly.

In short: I need a system that takes the size of my gh-model, makes a print template of it, and automatically saves as pdf to be printed.

I have most of this in place thanks to Dharman, but it’s not yet user friendly enough (needing to press 3 buttons to print and 1 to reset everything) and it prints a wireframe which is very unclear for the type of products we make.

I hope that some of you might know a solution for one of these problems. If you know a quick way to print to pdf without having to set the print location everytime, that might also be helpful.

Thanks!

For what is worth I use RhinoCommon to export to pdf (line drawing), I generate all the drawing in a single PDF.
To draw bitmap
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_FileIO_FilePdf_DrawBitmap.htm
So you’ll have to find a way to place your object, set them to the good scale,
capture this image
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Display_RhinoView_CaptureToBitmap_4.htm

here my script, I use also a lot Elefront.
04_to_pdf.gh (125.3 KB)

Some more explanation here

Working also on an other project I ended using Tex in order to have a nice document with image not embedded inside, then I “bake” this Tex to PDF.

1 Like

I think you sent me in the right direction, I’m starting to get nice results (Still a bunch of errors, C# isn’t my strong suit, but I think it’s going somewhere). Thank you!

By the way, the table you made looks awesome!

1 Like

Hi Laurent,

I am interested in a methodology to create pdfs from GH. I tried to download your script, but a lot of components were missing. I had installedl Elefront 5.1.2 (I am using rhino 7) and I believe this version is incomptible with previous ones… Any chance for an updated version or a screenshot of the components so I can try to recreate? I am still figuring out the code, so the correct set up will help.

Thanks!

Here is a version without Elefront. As it uses references of object I put also a 3dm file.
testToPdf.3dm (1.2 MB)
test_to_pdf.gh (24.4 KB)

2 Likes

Thank you!

Hi Laurent Delrieu,

Could you please record a video tutorial?I have downloaded your files, but unfortunately they don’t seem to work on my workline.

I just want to be able to select various rectangles and print them into pdf by shaded pattern.

Here is my file, could you please do me a favour to check it how to use your file ?

Thanks
Test.3dm (9.2 MB)

Hello
unfortunately, I can’t help there. My tool was used to automate some documentation with geometry that are well formatted (name and or metadata). I shared C# in order for people to create the tool that fits their way of working, so you need to know coding.

Looking at your file I have no idea how Grasshopper is better than Rhinoceros tool like Layout.

Thanks for your reply.

Maybe I should start a new topic in order to find another experts to assist, after all I don’t know how to type code, even a simle word. :rofl: :rofl: :rofl:

Good, idea as it seems you have a specific need. I think you need to put more information on the workflow you want.

This wasn’t clear for me, even with the rhino file.