<?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: Create new View3D that just displays wall layers of &amp;quot;Structure&amp;quot; function in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12354093#M8943</link>
    <description>&lt;P&gt;It may be slow due to wall joins i.e. the new walls are going to try and interact with the adjacent existing walls to those copied from. Generally (always) that kind of workflow is not a good idea (duplicating elements in same location to change presentation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you considered copying walls to new project and linking them back in, perhaps the other option is by utilising design options.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Nov 2023 16:42:26 GMT</pubDate>
    <dc:creator>RPTHOMAS108</dc:creator>
    <dc:date>2023-11-04T16:42:26Z</dc:date>
    <item>
      <title>Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12344156#M8942</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of Walls and I want to create a new View3D with the same walls but containing only the "Structure" function layers. I've implemented the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've realized that I need to duplicate the WallTypes and copy a new wall with just the filtered layers in the same location, because otherwise the original Walls &amp;amp; WallTypes will be modified. The code below works, but it's extremely slow for big models. Is there any way to optimize the process?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;...
/* Create new View3D and make it active */
...

ICollection&amp;lt;ElementId&amp;gt; visibleIds = new List&amp;lt;ElementId&amp;gt;();                    

foreach(Wall wall in wallList)
{
	// Get WallType and CompoundStructure
	WallType wallType = wall.WallType;
	CompoundStructure compoundStructure = wallType.GetCompoundStructure();

	// Copy wall in the same position
	ICollection&amp;lt;ElementId&amp;gt; newWallId = ElementTransformUtils.CopyElement(ViewModel.CurrentDocument, wall.Id, new XYZ(0, 0, 0));

	// Duplicate WallType
	Wall newWall = ViewModel.CurrentDocument.GetElement(newWallId.ElementAt(0)) as Wall;
	WallType newWallType = newWall.WallType.Duplicate(newWall.WallType.Name + GenerateRandomSuffix()) as WallType;
	CompoundStructure newCompoundStructure = newWallType.GetCompoundStructure();
	IList&amp;lt;CompoundStructureLayer&amp;gt; newWallLayers = newCompoundStructure.GetLayers();
	
	// Filter just Structure layers and assign to new WallType
	IList&amp;lt;CompoundStructureLayer&amp;gt; filteredLayers =
		(from o in newWallLayers where o.Function.ToString() == "Structure" select o).ToList();
	newCompoundStructure.SetLayers(filteredLayers);
	newWallType.SetCompoundStructure(newCompoundStructure);
	newWall.WallType = newWallType;

	// Add walls to visible elements list
	visibleIds.Add(newWallId.ElementAt(0));
}

...
/* Hide all elements in View3D and just make "visibleIds" visible */
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 19:36:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12344156#M8942</guid>
      <dc:creator>evidalpe</dc:creator>
      <dc:date>2023-11-04T19:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12354093#M8943</link>
      <description>&lt;P&gt;It may be slow due to wall joins i.e. the new walls are going to try and interact with the adjacent existing walls to those copied from. Generally (always) that kind of workflow is not a good idea (duplicating elements in same location to change presentation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you considered copying walls to new project and linking them back in, perhaps the other option is by utilising design options.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 16:42:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12354093#M8943</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2023-11-04T16:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12357335#M8944</link>
      <description>&lt;P&gt;The "part" functionality is the way to approach this. See&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Displaying-only-wall-core-boundary-Structure.html" target="_blank"&gt;https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Displaying-only-wall-core-boundary-Structure.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 15:52:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12357335#M8944</guid>
      <dc:creator>harrymattison</dc:creator>
      <dc:date>2023-11-06T15:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12417913#M8945</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1110216"&gt;@harrymattison&lt;/a&gt;&amp;nbsp;that's a great idea for visualization, I'll have a look and see if I can implement that in my add-in.&lt;/P&gt;&lt;P&gt;But at the end, if I want to have both the original and the new wall types available at the same time, I'd need to find another way.&amp;nbsp;@&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859" target="_self"&gt;&lt;SPAN class=""&gt;RPTHOMAS108&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;is right, due to wall joins the process is slow, so there's not an easy way to do this.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 11:40:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12417913#M8945</guid>
      <dc:creator>evidalpe</dc:creator>
      <dc:date>2023-12-04T11:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12418421#M8946</link>
      <description>&lt;P&gt;Not sure why you want to duplicate wall types and have both original and new wall types in your project. Is your end goal something different than what I show here?&amp;nbsp;&lt;A href="https://boostyourbim.wordpress.com/2023/12/04/create-a-3d-view-showing-only-revit-wall-structural-layers/" target="_blank"&gt;https://boostyourbim.wordpress.com/2023/12/04/create-a-3d-view-showing-only-revit-wall-structural-layers/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 15:08:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12418421#M8946</guid>
      <dc:creator>harrymattison</dc:creator>
      <dc:date>2023-12-04T15:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12418869#M8947</link>
      <description>&lt;P&gt;Dear Harry,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your very nice solution!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="comment-content"&gt;
&lt;P&gt;I summarised the functionality that you implement and thought my list of steps might be of interest to other as well, so here goes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create a new 3D isometric view&lt;/LI&gt;
&lt;LI&gt;Set parts visibility PartsVisibility.ShowPartsOnly&lt;/LI&gt;
&lt;LI&gt;Create parts from all walls&lt;/LI&gt;
&lt;LI&gt;For each part, retrieve its built-in parameter DPART_LAYER_INDEX&lt;/LI&gt;
&lt;LI&gt;Convert from string to wall compound structure layer index&lt;/LI&gt;
&lt;LI&gt;Hide part if its compound structure layer function differs from MaterialFunctionAssignment.Structure&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 Dec 2023 18:05:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12418869#M8947</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-12-04T18:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421374#M8948</link>
      <description>&lt;P&gt;Yeah, I do need to have both available somehow, it's a difficult use case. So somehow the first response fits better for my needs.&lt;BR /&gt;&lt;BR /&gt;In any case, it makes much more sense to accept your response as the valid one, you've done a great work. And congrats on the super blog too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Just one thing before accepting the response, I think the transaction must be committed&lt;/P&gt;&lt;PRE&gt;t.Commit();&lt;/PRE&gt;&lt;P&gt;after the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PartUtils.CreateParts&lt;/PRE&gt;&lt;P&gt;call. Otherwise the collector&lt;/P&gt;&lt;PRE&gt;FilteredElementCollector(doc, view.Id).OfClass(&lt;SPAN&gt;typeof&lt;/SPAN&gt;(Part))&lt;/PRE&gt;&lt;P&gt;will be empty, since the Parts won't be available yet.&lt;BR /&gt;&lt;BR /&gt;Could you have a look to that? I've tried with several examples and that's the only way I made it work.&lt;BR /&gt;Then of course you have to create another transaction for&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;view.HideElements(toHide);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 17:22:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421374#M8948</guid>
      <dc:creator>evidalpe</dc:creator>
      <dc:date>2023-12-05T17:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421442#M8949</link>
      <description>Thanks. Glad this was helpful. Yesterday it seemed to work fine without&lt;BR /&gt;committing that transaction after creating the parts, but when I look at it&lt;BR /&gt;today, we do need to add doc.Regenerate() there. This is often&lt;BR /&gt;sufficient to get the document to update without committing the transaction.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Dec 2023 17:49:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421442#M8949</guid>
      <dc:creator>harrymattison</dc:creator>
      <dc:date>2023-12-05T17:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421515#M8950</link>
      <description>&lt;P&gt;... cf.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;need to regenerate:&amp;nbsp;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.33" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.33&lt;/A&gt;&amp;nbsp;and&lt;/LI&gt;
&lt;LI&gt;handling transactions and transaction groups:&amp;nbsp;&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;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you and cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 18:19:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421515#M8950</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-12-05T18:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create new View3D that just displays wall layers of "Structure" function</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421946#M8951</link>
      <description>&lt;P&gt;Cool, I saw you already updated it in your blog. Response accepted!&lt;BR /&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;for all the work you do too, always a reference for Revit API devs &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 22:07:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-new-view3d-that-just-displays-wall-layers-of-quot/m-p/12421946#M8951</guid>
      <dc:creator>evidalpe</dc:creator>
      <dc:date>2023-12-05T22:07:58Z</dc:date>
    </item>
  </channel>
</rss>

