Placing a View Reference

Placing a View Reference

Joris.vd.Meulen
Collaborator Collaborator
854 Views
4 Replies
Message 1 of 5

Placing a View Reference

Joris.vd.Meulen
Collaborator
Collaborator

I'd like to place several View References (View > Sheet Composition > View Reference)

 

Snooping a view reference gives me the feeling I'm not able to do so.

also reading about the difference between familysymbol and elementtype points me to the same conclusion.

https://forums.autodesk.com/t5/revit-api-forum/difference-between-familysymbol-and-elementtype/td-p/...

 

View Reference is a system family, thus has no FamilySymbol. 

Therefor NewFamilyInstance(XYZ, FamilySymbol, View) won't work.

 

But am I wrong?

 

 

love python coding
855 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

Dear Joris, 

 

I asked ChatGPT for you, see below. The answer makes sense and looks perfectly valid. Can you please verify and confirm? If this works, I am out of a job soon 🙂

 

Thank you!

 

Cheers

 

Jeremy

 

jeremy.tammik@autodesk.com: Is it possible to place a view reference programmatically using the Revit API?

 

ChatGPT: Yes, it is possible to place a view reference programmatically using the Revit API.

 

jeremy.tammik@autodesk.com: What API calls does that require?

 

ChatGPT: Placing a view reference programmatically using the Revit API requires creating a new instance of a Viewport type, setting its location and size, and linking it to the target view. The following API calls can be used:

  

  • Viewport.Create() to create a new instance of Viewport.
  • ElementTransformUtils.MoveElement() to set the location of the Viewport.
  • Viewport.get_Parameter() and Parameter.Set() to set the size of the Viewport.
  • Viewport.ViewId property to link the Viewport to the target view.

    

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

Joris.vd.Meulen
Collaborator
Collaborator

@jeremy_tammik 

 

Good news, you're not out of a job soon! 

 

ChatGPT suggests to create a viewport. A viewport is something we place on a sheet. A View Reference is in instance of a system family which we place on a view (floorplan, section, etc). 

 

(placing a view on a sheet is something I do can create (without the help of chatgpt lol!) )

 

JorisvdMeulen_0-1675170420777.png

 

 

love python coding
0 Likes
Message 4 of 5

jeremy_tammik
Alumni
Alumni

Thank you for checking. I would have been surprised. Funny how it spouts such credible unreliable stuff. Very human 🙂 

  

Ok, so, as a next step up, I asked the development team for you.

  

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

Sean_Page
Collaborator
Collaborator

As far as I know, this is not possible, nor can you modify the Reference after it is placed because the parameter is Read Only. So, it isn't even like you could copy and paste then update. 

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect