Export view list to sat files

Hi,

is it possible to export a list of 3d views to sat files ?
so far the SAT export nodes that i find can only handle geometry as input. I want to feed views.

Is it possible?

Thanks. JN

Not that I know of.

What’s the end goal after sat files? Could another format do the trick? Navis works maybe?

And why views instead of geometry? Could all elements in active view and element geometry do the trick?

1 Like

IFC would also be allright. Or STEP. Or IGS.

Why views? Because it would give super control over what I am exporting. I can filter elements, combine elements, etcetera. Also really need batch functionality, so not from active view. Must be able to export 200+ views at once.

I am currently looking at this thread, but have not yet managed to reproduce the IFC batch export.

Would you elaborate on this Navis Works format? Never used it so far. Can it convert to step or ifc?

You could clean the code up as it’s just a template but this should work:

Also for your reference: http://www.revitapidocs.com/2017/e5cd0800-8544-c2d1-d21a-19ae33e9168c.htm

#Contact - tom.povey@ghd.com

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

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

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

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



ad = Autodesk.DesignScript.Geometry
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

output_folder = IN[0]
name = IN[1]

if isinstance(IN[2], list):
    Element_ids = UnwrapElement(IN[2])
else:
    Element_ids = [UnwrapElement(IN[2])]

IDs = [e.Id for e in Element_ids]

view_Ids = List[ElementId](IDs)



SAT_Export = doc.Export(output_folder, name, view_Ids, SATExportOptions())



OUT = SAT_Export

2 Likes

@Tom_James Great! Thanks a lot :smiley:

It worked at first try (with 1 view), but on second try (with list of views) I get this error:

What does this mean? I’m not good yet at Python…

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. _
Traceback (most recent call last):
_ File “”, line 48, in

TypeError: expected str, got list

You need to iterate over a list. Look into for statements.

1 Like

No worries!
Yeah sorry I didn’t account for that, API docs states for the name:

“Either the name of a single file or a prefix for a set of files. If empty, automatic naming will be used.”

So if you want to export it as the same as the view name remove the name variable from SAT_Export or replace it with something like "Prefix - ".

If not then you’ll have to iterate through the names input and the view_Ids input, the view_Ids input is a Generic Collection which is a little more complicated, i think it’s something like MoveNext but I’m not sure. I’ll have a look into it as I’m interested myself.

1 Like

Thanks a lot @Tom_James. The prefix function works good for me. Very satisfied :slight_smile:

I might also in the near future give the IFC Batch Export node / code a try. Would be nice to have multiple options.

Let me know if you have updates on your code. Anyway, thanks a lot !