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: 

Export *Sheets* to PDF

2 REPLIES 2
Reply
Message 1 of 3
noamgat8JLC7
272 Views, 2 Replies

Export *Sheets* to PDF

noamgat8JLC7
Participant
Participant

Hello,

 

The Revit API has an option to export views to PDF:

https://www.revitapidocs.com/2022/93d66d57-c20e-a103-39a1-77bc2ea05183.htm

 

However, we would like to export entire sheets (consisting of many views) with their sheet layout. Is there a way to do this?

0 Likes

Export *Sheets* to PDF

Hello,

 

The Revit API has an option to export views to PDF:

https://www.revitapidocs.com/2022/93d66d57-c20e-a103-39a1-77bc2ea05183.htm

 

However, we would like to export entire sheets (consisting of many views) with their sheet layout. Is there a way to do this?

2 REPLIES 2
Message 2 of 3

moturi.magati.george
Autodesk
Autodesk

Hi @noamgat8JLC7,

 

To export multiple views, you can try to loop through them from the current active document and get their Id's like below:


//Declare empty collection to hold all views
ICollection<ElementId> views = new Collection<ElementId>();
//get the open views in the document
IList<UIView> uiviews = uidoc.GetOpenUIViews();
foreach (UIView V in uiviews)
{
views.Add(V.ViewId);
}
//export the views above into the pdf

 

I am not sure if this is what you are looking for

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes

Hi @noamgat8JLC7,

 

To export multiple views, you can try to loop through them from the current active document and get their Id's like below:


//Declare empty collection to hold all views
ICollection<ElementId> views = new Collection<ElementId>();
//get the open views in the document
IList<UIView> uiviews = uidoc.GetOpenUIViews();
foreach (UIView V in uiviews)
{
views.Add(V.ViewId);
}
//export the views above into the pdf

 

I am not sure if this is what you are looking for

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
Message 3 of 3
GaryOrrMBI
in reply to: noamgat8JLC7

GaryOrrMBI
Collaborator
Collaborator
A sheet is simply one of the many types of views in Revit (DrawingSheet). So, yes, you can pass an entire sheet (consisting of many views and their sheet layout) to the Export to PDF method. You can always test a view for it's ability to be printed (which is really what is happening when exporting to PDF) with the CanBePrinted property.

https://www.revitapidocs.com/2022/76bee86d-3c34-7ee1-4349-cd7abcbf3d78.htm

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes

A sheet is simply one of the many types of views in Revit (DrawingSheet). So, yes, you can pass an entire sheet (consisting of many views and their sheet layout) to the Export to PDF method. You can always test a view for it's ability to be printed (which is really what is happening when exporting to PDF) with the CanBePrinted property.

https://www.revitapidocs.com/2022/76bee86d-3c34-7ee1-4349-cd7abcbf3d78.htm

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)

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

Post to forums  

Autodesk Design & Make Report