<?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: How to set smooth line with anti - aliasing for Current View ? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/10041966#M41404</link>
    <description>&lt;P&gt;I'm having this same issue.&amp;nbsp;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/549406"&gt;@Moustafa_K&lt;/a&gt;&amp;nbsp;You said that "you have to set a line style to enable them" but you can cleary see in the sample code that Silhouettes are being set to false:&lt;/P&gt;&lt;PRE&gt;displayModel.EnableSilhouettes = false;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Why would the line style need to be set?&lt;/P&gt;&lt;P&gt;In Revit Lookup, the line style returns a value of "&amp;lt; null &amp;gt;".&amp;nbsp; Setting null returns a different error that states that it can't be set to null.&amp;nbsp; Using ElementId.InvalidElement doesn't work either.&amp;nbsp; Has anyone figured out a workaround?&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 15:09:46 GMT</pubDate>
    <dc:creator>michael-coffey</dc:creator>
    <dc:date>2021-01-29T15:09:46Z</dc:date>
    <item>
      <title>How to set smooth line with anti - aliasing for Current View ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/8878564#M41402</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set the&amp;nbsp;smooth line with anti - aliasing&amp;nbsp; for the active view by following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                                viewForPreview.AreAnnotationCategoriesHidden = true;
                                viewForPreview.AreImportCategoriesHidden = true;
                                viewForPreview.DetailLevel = ViewDetailLevel.Fine;
                                viewForPreview.DisplayStyle = DisplayStyle.Realistic;

                                ViewDisplayModel displayModel = viewForPreview.GetViewDisplayModel();
                                displayModel.EnableSilhouettes = false;  
                                displayModel.SmoothEdges = true;
                                displayModel.ShowHiddenLines = ShowHiddenLinesValues.ByDiscipline;
                                viewForPreview.SetViewDisplayModel(displayModel);&lt;/PRE&gt;&lt;P&gt;But when I run the code, there was an error : " the silhouette line style id is not a valid line style to apply to the view" :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 401px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/652027i60976D6552CB9CC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you have any experience with this problem, please help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ninh Truong&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 07:40:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/8878564#M41402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-28T07:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to set smooth line with anti - aliasing for Current View ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/9093374#M41403</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;you need to first set the linestyle of the Silhouette Edges, so that enabling the Silhouette have a proper line style to display&lt;/P&gt;&lt;PRE&gt;var lstyles = new FilteredElementCollector(doc).OfClass(typeof(GraphicsStyle));
var lstyl = lstyles.Where(o =&amp;gt; o.Name.Contains(mylinestylename)).FirstOrDefault();&lt;BR /&gt;displayModel.SilhouetteEdgesGStyleId = lstyl;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 20:06:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/9093374#M41403</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2019-10-17T20:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set smooth line with anti - aliasing for Current View ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/10041966#M41404</link>
      <description>&lt;P&gt;I'm having this same issue.&amp;nbsp;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/549406"&gt;@Moustafa_K&lt;/a&gt;&amp;nbsp;You said that "you have to set a line style to enable them" but you can cleary see in the sample code that Silhouettes are being set to false:&lt;/P&gt;&lt;PRE&gt;displayModel.EnableSilhouettes = false;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Why would the line style need to be set?&lt;/P&gt;&lt;P&gt;In Revit Lookup, the line style returns a value of "&amp;lt; null &amp;gt;".&amp;nbsp; Setting null returns a different error that states that it can't be set to null.&amp;nbsp; Using ElementId.InvalidElement doesn't work either.&amp;nbsp; Has anyone figured out a workaround?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 15:09:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-set-smooth-line-with-anti-aliasing-for-current-view/m-p/10041966#M41404</guid>
      <dc:creator>michael-coffey</dc:creator>
      <dc:date>2021-01-29T15:09:46Z</dc:date>
    </item>
  </channel>
</rss>

