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: 

Revit 2022 PDF Export Fails with Paper Format set as Default with Other Parameters

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Sean_Page
955 Views, 7 Replies

Revit 2022 PDF Export Fails with Paper Format set as Default with Other Parameters

Working through the new PDF Export and how to automation the process. I have found that if you use Paper Format  as Default and if you have any other layout / format options set it will not Export, nor will it throw an exception. It just doesn't work. It would be nice to allow it to ignore other parameters much like many other settings do or at least throw and exception so you know why.

PDFExportOptions options = new PDFExportOptions
	{
		ColorDepth = ColorDepthType.Color,
		Combine = false,
		ExportQuality = PDFExportQualityType.DPI600,
		HideCropBoundaries = true,
		PaperFormat = ExportPaperFormat.Default,
		HideReferencePlane = true,
		HideScopeBoxes = true,
		HideUnreferencedViewTags = true,
		MaskCoincidentLines = true,
		//If any of the commented lines are active the Export will not work.
		//PaperPlacement = PaperPlacementType.LowerLeft,
		StopOnError = true,
		//ZoomType = ZoomType.Zoom,
		//ZoomPercentage = 100,
		ViewLinksInBlue = false
	};
7 REPLIES 7
Message 2 of 8
jeremy_tammik
in reply to: Sean_Page

That sounds like a perfectly valid expectation.

 

Do you think your description is sufficient to share with the development team as a reproducible case?

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

If so, I'll go ahead and log a ticket with them for this.

 

 

 

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 3 of 8
Sean_Page
in reply to: jeremy_tammik

Thanks @jeremy_tammik! I would think that is enough for them, but if not I can provide a test case as well.

Message 4 of 8
jeremy_tammik
in reply to: Sean_Page

Dear Sean,

 

Thank you again for your report and sorry to hear about this.

 

I logged the issue REVIT-176004 [PDF Export fails with Paper Format set as Default with other parameters] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

.

Best regards,

 

Jeremy

 

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 5 of 8
jeremy_tammik
in reply to: Sean_Page

Dear Sean,

 

Please ignore this initial answer, it is wrong:

 

<ignore>

 

The development team analysed the issue REVIT-176004 [PDF Export fails with Paper Format set as Default with other parameters] and respond:

 

I tried the options which the customer provided in the API export call.

 

It succeeded on exporting pdf files:

 

 

 

  PDFExportOptions options = new PDFExportOptions
  {
    ColorDepth = ColorDepthType.Color,
    Combine = false,
    ExportQuality = PDFExportQualityType.DPI600,
    HideCropBoundaries = true,
    PaperFormat = ExportPaperFormat.Default,
    HideReferencePlane = true,
    HideScopeBoxes = true,
    HideUnreferencedViewTags = true,
    MaskCoincidentLines = true,
    //If any of the commented lines are active the Export will not work.
    //PaperPlacement = PaperPlacementType.LowerLeft,
    StopOnError = true,
    //ZoomType = ZoomType.Zoom,
    //ZoomPercentage = 100,
    ViewLinksInBlue = false
  };
  
  IList<ElementId> views = new List<ElementId>();
  views.Add(Document.ActiveView.Id);
  Document.Export("E:\\workspace\\Sample", views, options);

 

 

 

Note that in the options, the customer set `Combine` to `false`, which means the PDF files will be exported named according to the standard naming rules, even if the `FileName` is set in the options.

 

There is a chance that the customer is not aware of this and just cannot find the PDF file, because they are only looking for `FileName`.

 

I hope this resolves and explains the issue.

 

Can you confirm that it works after all, please?

 

Thank you!

 

End of wrong initial answer.

 

</ignore>

 

 

Update:

 

One hour later, the development team changed their answer and say:

 

I can reproduce this on the internal development version. This should indeed throw an exception.

 

Sorry for the premature initial answer!

 

We'll see whether they say anything more anon, just wanted to let you know asap that the initial answer was wrong. 

 

Thank you for your understanding and patience.

 

Best regards,

 

Jeremy

  

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 6 of 8
jeremy_tammik
in reply to: Sean_Page

Dear Sean,

 

The development team determined the cause for the behaviour you observe and raised a new issue REVIT-176060 [PDF Export fails with Paper Format set as Default with other parameters] to rectify this in a future version of Revit. Please make a note of this number for future reference. They explain:

 

By design, if PaperFormat is default, then PaperPlacement should always be Center. However, there is no restriction ensuring this on the API side. We should either silently set PaperPlacement to Center during export, or throw  an exception notifying the add-in about this.

 

Thank you for your understanding and patience.

 

Best regards,

 

Jeremy

 

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 7 of 8
Sean_Page
in reply to: jeremy_tammik

Thanks @jeremy_tammik for your help and the team's fast response. I will work around this for now, but I am loving the upgrades to Revit 2022 thus far. The Ceiling and Floor sketch is awesome as well!

 

As always, appreciate all of your support!

Message 8 of 8
jeremy_tammik
in reply to: Sean_Page

Thank you very much for your constructive input, kind appreciation and glad to hear you are happy with Revit 2022 and its API.

 

I love the development team's fast response as well. It's a shame that some of the old long-standing issues have been dragging along for years. Happily, newer issues often seem to be handled very fast indeed, nowadays. 

  

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open

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