<?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: AVF colored surfaces require a surface? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/8738479#M58057</link>
    <description>&lt;P&gt;Revisiting this a bit.&amp;nbsp; Following the approach suggested by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Are there any best practices for creating the geometry (surface)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Is clean up required to ensure the surface doesn't persist in the Revit Database?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;We presently handle this by creating an extrusion using Geometry.CreateExtrustionGeometry(), which produces a Solid.&amp;nbsp; Then grab a PlanarFace, off the Solid, to supply to AVF for rendering the ColoredSurfaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is all done, inside of a Transaction, which gets committed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better way?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2019 22:03:59 GMT</pubDate>
    <dc:creator>MattKincaid</dc:creator>
    <dc:date>2019-04-17T22:03:59Z</dc:date>
    <item>
      <title>AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/7123755#M58054</link>
      <description>&lt;P&gt;It seems that in order to use colored surfaces feature of the AVF its a requirement that you supply arguments on the call to SpatialFieldManager.AddSpatialFieldPrimitive() (i.e associated geometry must be supplied).&amp;nbsp; As a test, I modified the SpatialFieldGradient sample code from the SDK to use the zero argument overload for sfm.AddSpatialFieldPrimitive and the colored surfaces no longer worked (markers with text still looked to function properly).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is my understanding correct?&amp;nbsp; Or is there some way to create colored surfaces without associated geometry?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 21:13:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/7123755#M58054</guid>
      <dc:creator>MattKincaid</dc:creator>
      <dc:date>2017-06-01T21:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/7124467#M58055</link>
      <description>&lt;P&gt;You ask two questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are three answers:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, Yes and No.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You understanding is correct.&lt;/LI&gt;
&lt;LI&gt;You must supply geometry (a surface).&lt;/LI&gt;
&lt;LI&gt;The geometry does not necessarily have to belong to a persistent database resident element; you can also supply a transient pure geometry object.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Several of The Building Coder AVF samples do so:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/avf" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/avf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My latest AVF sample, RvtFader, does not:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/RvtFader" target="_blank"&gt;https://github.com/jeremytammik/RvtFader&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sample, however, does create its own transient geometry:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2015/07/intersect-solid-filter-avf-and-directshape-for-debugging.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2015/07/intersect-solid-filter-avf-and-directshape-for-debugging.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 06:36:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/7124467#M58055</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-06-02T06:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/7130231#M58056</link>
      <description>&lt;P&gt;Many thanks Jeremy.&amp;nbsp; That is precisely what I needed.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 20:53:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/7130231#M58056</guid>
      <dc:creator>MattKincaid</dc:creator>
      <dc:date>2017-06-05T20:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/8738479#M58057</link>
      <description>&lt;P&gt;Revisiting this a bit.&amp;nbsp; Following the approach suggested by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Are there any best practices for creating the geometry (surface)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Is clean up required to ensure the surface doesn't persist in the Revit Database?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;We presently handle this by creating an extrusion using Geometry.CreateExtrustionGeometry(), which produces a Solid.&amp;nbsp; Then grab a PlanarFace, off the Solid, to supply to AVF for rendering the ColoredSurfaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is all done, inside of a Transaction, which gets committed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better way?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 22:03:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/8738479#M58057</guid>
      <dc:creator>MattKincaid</dc:creator>
      <dc:date>2019-04-17T22:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/8739350#M58058</link>
      <description>&lt;P&gt;Your approach sounds quite sound.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you commit the transaction, then yes, you do need to clean up the database afterwards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try to not commit it? Either just roll it back, or do nothing with it, and the normal Dispose functionality will clean it up for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest this approach, if it does what you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Within a `using` statement scope:&lt;/LI&gt;
&lt;LI&gt;Start a transaction&lt;/LI&gt;
&lt;LI&gt;Create the geometry&lt;/LI&gt;
&lt;LI&gt;Regenerate the model&lt;/LI&gt;
&lt;LI&gt;Grab the surface you need&lt;/LI&gt;
&lt;LI&gt;Do your AVF thingy&lt;/LI&gt;
&lt;LI&gt;Close the `using` scope&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will leave no trace.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question is, will it work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, you could try enclosing the whole thing in a transaction group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That gives you one more level of cleaning up. You can then commit the transaction, and even commit several transactions, within the transaction group, and still throw them all away leaving no trace by rolling back the entire group instead of calling `Assimilate`.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out the topic group on handling transactions and transaction groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.53" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.53&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 07:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/8739350#M58058</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-04-18T07:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/9561677#M58059</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering if you have any examples that involve multiple faces that are automatically extracted from elements like ceilings or floors? The examples I encountered are by select face which is only suitable for direct selection. Any advise would point me to a direction.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 22:26:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/9561677#M58059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-04T22:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: AVF colored surfaces require a surface?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/9562068#M58060</link>
      <description>Numerous samples show how to select multiple faces. You can either programmatically filter them out of the element geometry object or select multiple facets manually using PickOnjects.</description>
      <pubDate>Fri, 05 Jun 2020 06:33:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/avf-colored-surfaces-require-a-surface/m-p/9562068#M58060</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-06-05T06:33:07Z</dc:date>
    </item>
  </channel>
</rss>

