0

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.

Yongjoon Kim
  • 107
  • 1
  • 8
  • Sounds like an internal bug. Does it happen on any image or that specific one? – Ehsan Iran-Nejad Apr 24 '21 at 16:24
  • Thanks so much for the response @EhsanIran-Nejad I figured that using a PNG image solves the issue. But I still haven't figured out why this issue happens on JPEG images. I tested multiple JPEG images and unfortunately the issue keeps happening. – Yongjoon Kim Apr 25 '21 at 18:50

0 Answers0