Possible to insert image into revit without writing to file?

Possible to insert image into revit without writing to file?

Isaac_StoneDRKGM
Community Visitor Community Visitor
241 Views
1 Reply
Message 1 of 2

Possible to insert image into revit without writing to file?

Isaac_StoneDRKGM
Community Visitor
Community Visitor

I have a process which creates images (.bmp). These are existing in memory. I am wondering if it is possible to take the System.IO.Stream to load the bitmap, rather than writing to a file and then reading it back again?

I understand that in order to get them into revit I need to call `ImageInstance.Create`

The ImageInstance needs an ImageType.Id, so to get that I need to call `ImageType.Create`

This method needs an ImageTypeOptions, so I call the `ImageTypeOptions` constructor.

This constructor takes a string, which is a path to the image. So before I can import the image to revit, I need to write it to the filesystem.

My question is, is there a way to get the image into revit without writing it to the filesystem first?
I do not see any obvious way, looking at the API docs, but perhaps I am missing something? Perhaps using ExternalResourceReference?

Thanks.

0 Likes
242 Views
1 Reply
Reply (1)
Message 2 of 2

Moustafa_K
Collaborator
Collaborator

as far as i know there is no possible way to place an image from a stream or bytes array.

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes