BatchExport DWF. Linked Files

Hi everyone,

I am already using steam node node "Tool.ExportDWF"l to batch export my sheets in DWF from my model.
It works perfectly and make me save a lot of time

My idea : picking up sheeets in my linked files with “Get.Documents” and “Element.GetFromLinkedFile” and then Input this list result in tha Tool.ExportDWF.

Result of this operation is False.

My question is : does this node could work also with linked files ? If so, is it necessary to make some modification in the node ?

Looks like you’re not getting any sheets from your link…

Until “Tool Export DWF”, all the nodes collect perfectly sheets in linked files and put it in a list
But then the script of the “Tool Export DWF” node seems not to understand this list of sheets.
Maybe the node isn’t able to understand this list because its content come from a linked file…

No solution until today :slight_smile:

I’m just saying your preview shows null.
What version of Dynamo are you using? There’s a newer version of Tool.ExportDWF. Try installing the package update.

Hi @CICAD Xavier,

I have a solution for your request.
If you refer to these topics : Exporting CAD or PDF without opening REVIT and Export Sheets from Linked Models, you can use an “opendocument” node to collect your sheets.
And with a python script you will be able to export your dwf :

#Inspired by Node Export to FBX
#From mostafa el ayoubi, 2016 elayoub.mostafa@gmail.com

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = IN[4]

t = Transaction(doc,'export')
t.Start()

def tolist(input):
	if isinstance(input,list):
		return input
	else:
		return [input]

folder = IN[0]
prefix = IN[1]
views = tolist(IN[2])
result = []
vset = ViewSet()

for v in views:

    vset.Insert(UnwrapElement(v))
options = DWFExportOptions()
options.MergedViews = IN[3]
result.append(doc.Export(folder,prefix,vset,options))

t.Commit()
OUT = 'Success' 

If you create a custom node like in the picture above and use lacing, you can also input multiple revit files.

1 Like

Amazing Alban !

Only, on your screen shot you’re feeding your custom node in the wrong order (Directory path in filename input, Sheets in directory path input, Document in Views input…)

I’ve also tried your graph and it also works with multiple files as input. Important to notice that you need to lace Longest your custom node !

BatchExportDWFfromLinkedMultipleInputs

FIY Alban creates a package called Genius Loci dealing about batch exporting NWC,DWF, IFC, CAD and PDF without opening revit files. This package combined with @Data-Shapes package provide you a wide range of possibilities for batch exporting anything you want from your revit with a minimum of effort.

Congrats guys !

2 Likes

I was successful with the short version of “Export from directory” from GeniusLoci Package, but when i try the one with Export setup option node. I got an error. it only work with one link doc. export%20doc%20link

Hi @seth09,

To work with multiple documents Revit, the nodes Export DWG / Export DWF / Export NWC / Print PDF from directory must be set with lacing longest.

The input for “Exportsetup” is the name of the ExportDWGsettings like in the picture below :

Keep me informed if you have other problems.

It was successful, when i use your “ExportSetup” method for input. It was the lacing order in my output ExportSetup.

Thanks.

Other Question. Is there away to retrieve the exact export “Sheet/view” from link doc? Refer image. If I can retrieve the “AutoCADBase Export” “all views and sheet in the Set” as view/Sheet list

Hi @seth09,

You can use “Element Types”,“All Elements of Type in Document” from Rhythm and “ViewSheetSet.Views” from Clocwork or use a python script to get your sheets from View Sheet Set.

#Copyright(c) 2015, Konrad Sobon
# @arch_laboratory, http://archi-lab.net

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = IN[0]

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
import System

vs = FilteredElementCollector(doc).OfClass(ViewSheetSet)

OUT = [i.Name for i in vs],[i for i in vs]

Thank you very much. Okay hopefully it is related. I keep having link models warning because it have more then 20 miles. Is there a way to unload link model in the link document file?

You are now far from the original subject !

Yes you can but be careful, the python script below unload all the links.

#From Ben_Osborne
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.Attributes import*

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

dataEnteringNode = IN

doc = IN[0]

revitlinktypes=list()
linkcollector=FilteredElementCollector(doc).OfClass(RevitLinkInstance)
revitlinktypes=[]
TransactionManager.Instance.ForceCloseTransaction()
for rli in linkcollector:
	rlt=doc.GetElement(rli.GetTypeId())
	revitlinktypes.append(rlt)
	rlt.Unload(None)
	
OUT= 0

You will also need to save the document like in the picture.
Unload%20links%20in%20document

Much appropriated and sorry for go off subject. Now back on subject. my View.SheetSet.Views node have an error because the “Turn into list” node is saying dynamo version in compatible. Is there a new Turn into List or way to modify the “View.SheetSet.Views” node?

You can update Clockwork or you can copy the python script from the node “View.SheetSet.Views”.
The input for the python script will be a list.
Maybe you will need a “List.Create” node or a List.GetItemAtIndex node before the python script.

Thanks for your help with this topic.