TransformWithBoundary - getting Paper Space coordinates of elements in a 3D Iso View

TransformWithBoundary - getting Paper Space coordinates of elements in a 3D Iso View

travis.rothbloomMY5UY
Participant Participant
500 Views
4 Replies
Message 1 of 5

TransformWithBoundary - getting Paper Space coordinates of elements in a 3D Iso View

travis.rothbloomMY5UY
Participant
Participant

I had a need to get the Paper Space 2D sheet coordinates of elements in a 3D Iso View. I eventually was able to do what I needed using the 3D view's CropBox's Transform's Inverse, but in the process, I  did find this TransformWithBoundary class. The model I was working with though is Revit 2022 and this class seemed like it was a placeholder until the 2023 API; the View class didn't even have the GetModelToProjectionTransforms method until 2023.

 

My question now is, will the transform returned by this class be the same as the CropBox's Transform's Inverse, and that the only thing in addition was the ability to use a custom shape Outline? Did this class actually have any functionality before Revit 2023, and is there further functionality planned for it going forward?

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

jeremy_tammik
Alumni
Alumni

Thank you for your observations. I asked the development team for you. 

  

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

jeremy_tammik
Alumni
Alumni

First devteam response: In a 3D view, tentatively, I tentatively answer yes. There may be more coming (tentatively).

  

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

jeremy_tammik
Alumni
Alumni
Accepted solution

They add: It's been long enough that I can't remember the details of the TransformWithBoundary class without putting in a few hours of research. However, there is an SDK Sample for TransformWithBoundary here which may help you understand how the class can be used:
  
https://github.com/jeremytammik/RevitSdkSamples/blob/master/SDK/Samples/SheetToView3D/CS/SheetToView...
  
The sample is starting in 2d sheet space and working backwards to 3d model space, so you'll need to do the inverse for your workflow.

  

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

travis.rothbloomMY5UY
Participant
Participant
Thanks, that sample makes sense and with the other transforms in that scrip, seems to imply that my previous assumption of using the 3D Iso View's cropbox's transform's inverse may be the transform returned by TransformWithBoundary.GetModelToProjectionTransform(). I was just looking for confirmation of this so that I could implement it in earlier versions of Revit, as even though this class was previously added to the API, it didn't seem to have any way of accessing it nor did it have any functionality until the 2023 API.
0 Likes