# Revit 2021 API Docs- ImageImportOptions class depreciated?

**URL:** <https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502>\
**Category:** Uncategorized\
**Created:** [January 20, 2021, 4:43am UTC](https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502 "2021-01-20T04:43:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Wright](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Justin\_Wright](https://forum.dynamobim.com/u/Justin_Wright)\
**Post date:** [January 20, 2021, 4:43am UTC](https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502/1 "2021-01-20T04:43:41Z")

</div>

Hi

I have an old graph I made that selects an image file, creates a drafting view and renames it to match the original file name.

We recently upgraded to Revit 2021 and dynamo 2.5. This graph has stopped working.

I get this error  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/5/95e29b89035b36df4a1c28c217b14f0e05690472.png)

I made a new python script window and used the command suggestion thing. ImageImportOptions() is not showing up.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/4/74d794352c8f264e5a3030ac25a40baa3f28acd4.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/8/7885aac2009bf63074a16168bf11f2ee64673d41.png)

[https://www.revitapidocs.com/](https://www.revitapidocs.com/) does not have code for 2021.  
[Load images to project?](https://forum.dynamobim.com/t/load-images-to-project/28544)

This graph was created from @Konrad_K_Sobon post

> [@Is it possible?](https://forum.dynamobim.com/t/is-it-possible/1736/4):
>
> So, it wasn’t as easy as i thought it would be, but I was still able to do what you were asking for. Here it is: First you need to import an image into a drafting view and to achieve it we need to call the method that I mentioned previously: Document.Import(string, ImageImportOptions, View, Element) Where: String is a file path to the image. ImageImportOptions is a class in Revit API that defines where and how we want to place our image. View is a view that you want to place your import in…

Can someone help me here, please  
Has 2021 API been released, if so where do I find it?.  
has this been depreciated - if so is there a new method?.

[Image File to Drafting View.dyn](https://forum.dynamobim.com/uploads/short-url/1IFoZUqh3eAQ3p6q5CcwCmW2xqK.dyn) (40.3 KB)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 20, 2021, 8:55am UTC](https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502/2 "2021-01-20T08:55:30Z")

</div>

This code was replaced in 2021, to account for some of the user interface changes which were also added. A listing of the changes can be found here:

> **[What's New in the Revit 2021 API](https://thebuildingcoder.typepad.com/blog/2020/04/whats-new-in-the-revit-2021-api.html#4.1.15)**
>
> The Revit 2021 API includes exciting enhancements for add-in developers, including numerous developer wishes and requests that have now been explicitly addressed
> – Information sources
> – What's new in previous versions
> – Detailed TOC of major changes...

---

<div class="post-metadata">

**Author:** ![Justin\_Wright](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Justin\_Wright](https://forum.dynamobim.com/u/Justin_Wright)\
**Post date:** [January 20, 2021, 9:12am UTC](https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502/3 "2021-01-20T09:12:08Z")

</div>

Thanks @jacob.small.  
Is there any documentation on how to use the new methods?.  
I’m not sure how I fix my code from that info.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 20, 2021, 11:43am UTC](https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502/4 "2021-01-20T11:43:52Z")

</div>

> [@Justin\_Wright](#):
>
> Is there any documentation on how to use the new methods?

Not sure, but I haven’t really dug into it. Knowing the methods means you could try learning by experimentation to some extent (that is feed it two overrides which won’t work - say DateTime objects - return the trace back to see what the method requires, and then then give the node that thing).

Have you checked to see if there is a node in archilab package for this? Silly to reinvent the wheel for everything if you can consume something common.

---

<div class="post-metadata">

**Author:** ![Justin\_Wright](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Justin\_Wright](https://forum.dynamobim.com/u/Justin_Wright)\
**Post date:** [January 20, 2021, 8:04pm UTC](https://forum.dynamobim.com/t/revit-2021-api-docs-imageimportoptions-class-depreciated/59502/5 "2021-01-20T20:04:19Z")

</div>

Thank you @jacob.small  
Sure enough, archilab included the nodes required to update my graph.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/a/6a74366425cfecd9f1f591045d7de165bfb0ba7f.png)
