<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export 2d sheets as images with high quality in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9990798#M29276</link>
    <description>&lt;P&gt;I'm trying to export Sheets, not views. So if I change the sclae in the view the viewport will be disalocated in the sheet.&lt;/P&gt;
&lt;P&gt;I need to export the Sheets with thin lines, any ideas?&lt;/P&gt;</description>
    <pubDate>Sun, 10 Jan 2021 09:30:12 GMT</pubDate>
    <dc:creator>Mustafa.Salaheldin</dc:creator>
    <dc:date>2021-01-10T09:30:12Z</dc:date>
    <item>
      <title>Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9974679#M29266</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m trying to export Revit sheets to images with high quality. I use a code you have already shared before:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;/// &amp;lt;summary&amp;gt;
/// New code as described in Revit API discussion 
/// forum thread on how to export an image from a 
/// specific view using Revit API C#,
/// http://forums.autodesk.com/t5/revit-api/how-to-export-an-image-from-a-specific-view-using-revit-api-c/m-p/6424418
/// &amp;lt;/summary&amp;gt;
static Result ExportToImage3( Document doc )
{
  Result r = Result.Failed;
 
  using( Transaction tx = new Transaction( doc ) )
  {
    tx.Start( "Export Image" );
 
    string desktop_path = Environment.GetFolderPath( 
      Environment.SpecialFolder.Desktop );
 
    View view = doc.ActiveView;
 
    string filepath = Path.Combine( desktop_path, 
      view.Name );
 
    ImageExportOptions img = new ImageExportOptions();
 
    img.ZoomType = ZoomFitType.FitToPage;
    img.PixelSize = 32;
    img.ImageResolution = ImageResolution.DPI_600;
    img.FitDirection = FitDirectionType.Horizontal;
    img.ExportRange = ExportRange.CurrentView;
    img.HLRandWFViewsFileType = ImageFileType.PNG;
    img.FilePath = filepath;
    img.ShadowViewsFileType = ImageFileType.PNG;
 
    doc.ExportImage( img );
 
    tx.RollBack();
 
    filepath = Path.ChangeExtension( 
      filepath, "png" );
 
    Process.Start( filepath );
 
    r = Result.Succeeded;
  }
  return r;
}&lt;/LI-CODE&gt;
&lt;P&gt;I tried to increase the pixel size to its limits (15000) &amp;nbsp;however though when I zoom in the exported image it is not with good quality and some details are not fine.&lt;/P&gt;
&lt;P&gt;Some lines are thick and I tried to manage this from object style by setting Cut and Projection size to 1 but though the lines come thick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2021 12:53:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9974679#M29266</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2021-01-03T12:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975236#M29267</link>
      <description>&lt;P&gt;Hi Mustafa,&lt;/P&gt;&lt;P&gt;Interesting!&lt;/P&gt;&lt;P&gt;I export images to 512 pixels and it works perfectly, but I did not go further (15000 pixels) using the code. Did you try "by hand" to check whether it works or not? (on my machine it works with 15 000 pixels "by hand")&lt;/P&gt;&lt;P&gt;Another question from looking at the code: what's the use of the Transaction? I think I have none when I export images.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2021 21:07:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975236#M29267</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2021-01-03T21:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975286#M29268</link>
      <description>&lt;P&gt;Pixels are evil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can't you avoid them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can print to PDF instead, generating a vector format, and then convert that to pixels if needed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2021 21:58:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975286#M29268</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2021-01-03T21:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975624#M29269</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;, I also tried vector printing to PDF, but for some reason some of the lines are printed thick though I adjusted the Object Styles and removed any view templates/filters. Any idea?&lt;/P&gt;
&lt;P&gt;Also printing to PDF then converting to image will take a lot of time (this procedure will be applied to thousands of drawings). Can I export somehow to something like SVG or AI?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 03:43:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975624#M29269</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2021-01-04T03:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975635#M29270</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4496032"&gt;@BenoitE&amp;amp;A&lt;/a&gt;&amp;nbsp;, if I tried to print manually I get the same results.&lt;/P&gt;
&lt;P&gt;For the transaction, I think you need it if you want to export the image to a view (a view contains a snapshot of an other view).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 03:48:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975635#M29270</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2021-01-04T03:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975703#M29271</link>
      <description>&lt;P&gt;No idea about the thick lines. That is something you might want to research on manually in the end user interface to find a solution before trying to address it programmatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding other output formats, maybe you can find some use of the 2D custom export functionality to achieve SVG or something?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 05:13:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975703#M29271</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2021-01-04T05:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975728#M29272</link>
      <description>&lt;P&gt;I've been digging more and I found this &lt;A title="Sending a Room Boundary to an SVG Node Web Server" href="https://thebuildingcoder.typepad.com/blog/2015/04/sending-a-room-boundary-to-an-svg-node-web-server.html" target="_blank" rel="noopener"&gt;link&lt;/A&gt; from "the building coder". So I think the solution will be to try to build a custom exporter to create SVG from the 2d geometries then rasterize it.&lt;/P&gt;
&lt;P&gt;Any other ideas &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 05:40:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9975728#M29272</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2021-01-04T05:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9976243#M29273</link>
      <description>&lt;P&gt;What is the actual view scale of the view being printed. Line thickness gets scaled according to this value so that may be the main reason for thick lines on such a small image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't mind annotation objects also changing in your end view then you could temporarily adjust the scale to 1:1 etc.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 11:52:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9976243#M29273</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-01-04T11:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9989317#M29274</link>
      <description>&lt;P&gt;Scale is 1:150 and thick lines are of the model elements not the annotations.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 09:47:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9989317#M29274</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2021-01-09T09:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9989471#M29275</link>
      <description>&lt;P&gt;Without the annotation objects visible here are two images of the same view (not from exports), the top is set to 1:1000 and the bottom 1:200. The line weights are scaled in relation to paper space units so if you set to 1:1 etc then your lines end up thinner (which may carry through to images exported if you can temporarily set this before export).&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1:1000" style="width: 796px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/864343i5C22690CEF9799B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture210109a.PNG" alt="1:1000" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;1:1000&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1:200" style="width: 761px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/864344i144473EC801BF081/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture210109.PNG" alt="1:200" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;1:200&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 12:25:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9989471#M29275</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-01-09T12:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9990798#M29276</link>
      <description>&lt;P&gt;I'm trying to export Sheets, not views. So if I change the sclae in the view the viewport will be disalocated in the sheet.&lt;/P&gt;
&lt;P&gt;I need to export the Sheets with thin lines, any ideas?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 09:30:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9990798#M29276</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2021-01-10T09:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export 2d sheets as images with high quality</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9990934#M29277</link>
      <description>&lt;P&gt;There is the ThinLinesOptions class which has the static property AreThinLineEnabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From testing this isn't going to make much of a difference for such small images however, even at 512 image size you'd likely not see the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It may be better to export at larger size and reduce the image size using &lt;A href="https://www.c-sharpcorner.com/article/resize-image-in-c-sharp/" target="_blank" rel="noopener"&gt;system.graphics namespace&lt;/A&gt; or similar then you'll probably get the same kind of optimised reduction that takes place with icons in file explorer.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 11:33:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-2d-sheets-as-images-with-high-quality/m-p/9990934#M29277</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-01-10T11:33:53Z</dc:date>
    </item>
  </channel>
</rss>

