Export an Image with specific elements and their location in the image ?

Export an Image with specific elements and their location in the image ?

TomB.ADV
Advocate Advocate
671 Views
6 Replies
Message 1 of 7

Export an Image with specific elements and their location in the image ?

TomB.ADV
Advocate
Advocate

I was browsing the forum to find a way to export an Image using the Revit API and found the below post:
https://forums.autodesk.com/t5/revit-api-forum/how-to-capture-image-for-specific-element-using-revit...

My question is, will it be possible to also get the pixel location of each element in the exported picture?

 

It doesn't have to be very accurate and the process of extracting the pixel location of the element in the

image can be some sort of calculation, I just don't see how this can be achieved, any ideas ?

 

0 Likes
672 Views
6 Replies
Replies (6)
Message 2 of 7

caroline.gitonga
Autodesk
Autodesk

Hi @TomB.ADV,

This related query https://stackoverflow.com/questions/62004785/how-to-get-revit-export-image-coordinates-or-reference-... will give you a slight elaboration of how to go about  determining the exported image pixel coordinates. Kindly, may you have a look

Carol Gitonga, Developer Advocacy and Support, ADN Open
0 Likes
Message 3 of 7

TomB.ADV
Advocate
Advocate

@caroline.gitonga Thanks for your reply, seems like the general idea is possible it's just that I was looking for

the exact method to convert between the Revit internal (x,y,z) coordination system to the exported image (x,y)

coordination system.

 

I'm having a difficulty to figure out the relations between the Image pixel array to the Revit 3D grid points...

0 Likes
Message 4 of 7

jeremy_tammik
Alumni
Alumni

One thing to take into account is the view plane of the image export. Inside Revit, you would need to translate the 3D X, Y, Z coordinates to the 2D view plane coordinates. The latter will map easily to the 2D pixel coordinates in the exported image. The first thing that comes to mind to me personally is my 2D round trip room editor. It maps coordinates from a plan view in Revit to an interactive display in the browser and enables you to translate and rotate furniture elements in the browser window, reflecting those modifications back into the Revit BIM in real-time using webhooks:

  

https://github.com/jeremytammik/RoomEditorApp

  

A bit of an overkill for your needs, but all the transformations required are defined and implemented in there, and the associated blog posts fully explain every step. As said, this is for a plan view, so, in this case, the 3D XYZ mapping to the 2D view plane is not required.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 7

TomB.ADV
Advocate
Advocate

Many thanks @jeremy_tammik for the detailed explanation, can I ask you to give me a hint about in which class

I can find the relevant methods/functions ?

 

I most definitely don't need most of the repo, could save me some time figuring out the whole system...

0 Likes
Message 6 of 7

jeremy_tammik
Alumni
Alumni

Are you working in a plan view?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 7 of 7

TomB.ADV
Advocate
Advocate

Yes, I do

0 Likes