No Image exported when using ExportRange.SetOfViews

No Image exported when using ExportRange.SetOfViews

Anonymous
Not applicable
983 Views
4 Replies
Message 1 of 5

No Image exported when using ExportRange.SetOfViews

Anonymous
Not applicable

Hi team,

 

I am using the doc.ExportImage(imageExportOptions) method to export an image. 

 

The issue is when imageExportOptions.ExportRange is set to SetOfViews, it doesn't export any image at all. I have already added the view i would like to use by doing:

imageExportOptions.SetViewsAndSheets(new List<ElementId> { theView.Id })

No error is thrown, except when I tried to retrieve the exported image, it says they could not find the file

 

However, if I set imageExportOptions.ExportRange to CurrentView or VisibleRegionOfCurrentView, it works perfectly. 

 

So the question is, why does using SetOfViews not work? Thanks in advance.

0 Likes
Accepted solutions (1)
984 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Joel,

 

You are producing questions at a rather rapid rate...

 

Here is a recent discussion and sample code snippet here in the forum making successful use of the SetOfViews option:

 

https://thebuildingcoder.typepad.com/blog/2020/06/creating-material-texture-and-retaining-pixels.htm...

 

Please always search for existing answers before raising a new issue.

 

Thank you!

 

Best regards,

 

Jeremy

 



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

0 Likes
Message 3 of 5

Anonymous
Not applicable

Uhm that's something like what I did. I don't see any answers regarding the file could not be found...

0 Likes
Message 4 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

Search the system better. By the way, it may have a different filename extension than you expect. I heard of some mixup between jpg and png or something like that. Maybe best monitor your Windows file system, or search globally for the filename stem only.

 



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

0 Likes
Message 5 of 5

Anonymous
Not applicable

Alright got it, thanks!

 

For anyone wondering, when I use SetOfViews the system added the view name to the file path. 

0 Likes