PDF export Nodes are not working of Archilab and Genius loci

I am working on PDF Exporting active view .As shown below.But node doeesnt export PDF.

The archilab Local Printers Names does not appear to be working (I tried in R24). You can get a list with the following in a python node

import System
OUT = System.Drawing.Printing.PrinterSettings.InstalledPrinters

I also found that archilab Print Range node was also outputting null and that only using the string "Select" would allow me to print (you could try "Current" or "Visible")

Thank you for reply @Mike.Buttery I tried to but it not worked will you please send full python script?

It is the full script - see below for using with Python Script From String


After trying your solution I found above issue.Is there anything I am missing?

Add these two lines at the top of the script - which version of Revit are you using?

import clr
clr.AddReference('System')

I am using Revit 2021

Dynamo in Revit 2021 uses .NET 4 and does not appear to be able use System.Drawing

Try this in a python node to get names of local printers
It calls a cmd process in the background and uses the result to get the info

import subprocess

CREATE_NO_WINDOW = 0x08000000
comm = ["wmic", "printer", "list", "instance"]
p = subprocess.Popen(
    comm,
    stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT,
    creationflags=CREATE_NO_WINDOW,
)
p.wait()
OUT = [l.strip() for l in p.stdout.readlines()[1:]]

Thank You @Mike.Buttery your solution for Printer name is wornking now but still I get above issue that it would not be able to print.

Place a list flatten node after List.RestOfItems

As per your suggestion I tried but still its not working properly.

Have you tried deleting the file 123.pdf and running the script?

Now tried after deleting 123 pdf but it would not work.

Hi,

Here is an example with the Genius Loci node :

2 Likes