Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Placing a View Reference

4 REPLIES 4
Reply
Message 1 of 5
Joris.vd.Meulen
241 Views, 4 Replies

Placing a View Reference

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
4 REPLIES 4
Message 2 of 5

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

@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
Message 4 of 5

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
Message 5 of 5
Sean_Page
in reply to: Joris.vd.Meulen

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. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community