Retrieving Images from Schedules

Retrieving Images from Schedules

Anonymous
Not applicable
958 Views
3 Replies
Message 1 of 4

Retrieving Images from Schedules

Anonymous
Not applicable

I think I might know the answer to this, but I have been trying to figure out ways to retrieve the image type, element, ID, or any other identifying data of an image located within a schedule. 

 

In the python code below:

cellText = schedule.GetCellText(SectionType.Header, i, j)

'cellText ' would yield the text values in the referenced cell. If it contains an image, it returns null

 

tableData = schedule.GetTableData()
tsd = tableData.GetSectionData(SectionType.Header)

cellType = tsd.GetCellType(i, j)

'cellType ' would return 'Graphic' if there is an image in within the referenced cell. And 'Text' if there is text data.  This seems to be the most information I am able to get regarding images within schedules.

 

transaction.Start()
imgInsert= tsd.InsertImage(i, j, imgId)
transaction.Commit()

'imgInsert' could utilize the api to insert an image in a given cell. But there seems to be no equivalent way to retrieve the data of images already placed in a schedule.

 

Is there any related method to return data (of any sort) of an image in a schedule (or broad suggestions for workarounds)?

 

Thanks all.

0 Likes
Accepted solutions (1)
959 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

This functionality was added in Revit 2015 and is listed in the Schedule API additions:

 

https://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html#3.07

 

The new method:

 

  • ImageType.Create()

 

provides the ability to create a new ImageType element and loads a copy of the image into it.

 

The new members:

 

  • ImageType.Reload()
  • ImageType.ReloadFrom()
  • ImageType.IsLoadedFromFile()
  • ImageType.Path

 

provide the ability to manage the contents of the image, and reload it from its original path location or a new location.

 

The new members

 

  • ViewSchedule.ImageRowHeight
  • ViewSchedule.RestoreImageSize()
  • ViewSchedule.HasImageField()

 

provide the ability to affect the size and display characteristics of schedules that contain images.

 

I would suggest that you snoop your schedule with RevitLookup first and examine the properties and relationships of the image elements with the rest of the system.

 

Here is a note on a cool add-in using it for QR codes:

 

https://thebuildingcoder.typepad.com/blog/2016/02/reorg-fomt-devcon-ted-qr-custom-exporter-quality.h...

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 4

Anonymous
Not applicable
Accepted solution

Thanks for your thorough response! There is some useful information here. But it seems there is no ability within the API to retrieve information (element, id, type, etc) about the image from a given schedule cell from what you're saying (and from hours of snooping & investigating). No graphic equivalent to ViewSchedule.GetCellText() for images within those cells.

 

It looks like I would have to develop a work around to allow users to export the schedule with image information using some sort of image management tool to track the images being used in the schedules. 

 

Thanks!

0 Likes
Message 4 of 4

anton.shaw
Explorer
Explorer

Hey was there any update to this or is it still no possible to access images in schedules via the API? Seems after a bit looking around and tinkering I can't find much. Thanks, Anton

0 Likes