Create elements from geometry in dynamo and export image (python)

Hi folks,

I have created a series of geometry (with colors) in Dynamo. My goal is to save pictures of these.

Since it is not possible, based on my knowledge, to export a series of dynamo backgrounds automatically, I was trying to loop through the geometry designs from a python script.
For each design I try to:

  1. Convert geometry to element in Revit
  2. Override color in view (not standard)
  3. Save images
  4. Delete the geometry (and start again)

For step 1, I tried to export sat and re-import them, but I didn’t manage to color them (through OverrideGraphicSettings(), ogs.SetSurfaceForegroundPatternColor() ogs.SetSurfaceForegroundPatternVisible() ) because the sat file has no Surface to color. Then I thought about using Family, but I cannot find anything in Revit API to CREATE a family from geometry.

For step 2, as mentioned before, I use view.SetElementOverrides() because i need to put color in a different 3D view (not current view). I believe this can work.

For step 3 I use doc.ExportImage(). This can work as well.

Nothing to say about step 4.

In order for this plan to work, I need to solve step 1. Do you have any suggestions on solving step 1?
I would also appreciate your opinion on making this entire workflow more efficient.
Please note, OOTB node are not an option for me because this is a small part of a bigger workflow developed in python.

Thanks in advance!

I would recommend you look into capturefinery which does much of this. If your shapes are flat you could also export to SVG as another method.