I'm trying to create a raster image instance in my model using the new ImageType API in Revit 2021. However, it keeps giving me an error.
My code snippet:
from rpw import DB
image_options = DB.ImageTypeOptions("C:\\temp\\response.jpg", False, DB.ImageTypeSource.Import)
image_options.Resolution = 72
image = DB.ImageType.Create(doc, image_options)
Error that I got:
Exception: Failed to create ImageType due to internal error.
Can anyone help me understand what is the problem? Thanks.