<?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 modify floor thickness? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8108305#M48985</link>
    <description>&lt;P&gt;hi!&amp;nbsp;&lt;SPAN&gt;&amp;nbsp; kmarsh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I think it's a right way.&lt;/P&gt;&lt;P&gt;I try to change the new floor type&amp;nbsp;&lt;SPAN&gt;width,but&amp;nbsp;failure.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;FloorType floorType = floor.FloorType;            
            using (Transaction t = new Transaction(doc, "create floor type"))
            {
                t.Start();                       
                ElementType elementType = floorType.Duplicate("new type");                
                FloorType newfloorType = elementType as FloorType;
                newfloorType.GetCompoundStructure().SetLayerWidth(0, 10);
                t.Commit();                
                                
            }&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This code can create new floor type , but can't change floor&amp;nbsp;thickness.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Why is it so? &amp;nbsp;Is it lose some code?&lt;/P&gt;&lt;P&gt;thank you for answer this question.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jul 2018 03:06:22 GMT</pubDate>
    <dc:creator>chinhung77</dc:creator>
    <dc:date>2018-07-04T03:06:22Z</dc:date>
    <item>
      <title>How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8107091#M48983</link>
      <description>&lt;P&gt;I try to&amp;nbsp;&lt;SPAN&gt;duplicate&amp;nbsp;a floor type,and change parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I can't change&amp;nbsp;thickness,because the parameter is readonly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;User can easily change floor thickness by GUI.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any other&amp;nbsp;method I missed? How to modify floor thickness by RevitAPI?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thank you for answer this question.&lt;/SPAN&gt;&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>Tue, 03 Jul 2018 14:53:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8107091#M48983</guid>
      <dc:creator>chinhung77</dc:creator>
      <dc:date>2018-07-03T14:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8107738#M48984</link>
      <description>&lt;P&gt;You can easily change the floor thickness via the UI but only if you click on "Structure..." in the type properties dialog.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to get the FloorType, then get the type's "GetCompoundStructure()" and from that, GetLayers(), then modify the layer you want to change the thickness of.&amp;nbsp; (note that "width" is thickness when we're talking about floors)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See if that doesn't get you in the direction you wanted to go.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 19:17:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8107738#M48984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-03T19:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8108305#M48985</link>
      <description>&lt;P&gt;hi!&amp;nbsp;&lt;SPAN&gt;&amp;nbsp; kmarsh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I think it's a right way.&lt;/P&gt;&lt;P&gt;I try to change the new floor type&amp;nbsp;&lt;SPAN&gt;width,but&amp;nbsp;failure.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;FloorType floorType = floor.FloorType;            
            using (Transaction t = new Transaction(doc, "create floor type"))
            {
                t.Start();                       
                ElementType elementType = floorType.Duplicate("new type");                
                FloorType newfloorType = elementType as FloorType;
                newfloorType.GetCompoundStructure().SetLayerWidth(0, 10);
                t.Commit();                
                                
            }&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;This code can create new floor type , but can't change floor&amp;nbsp;thickness.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Why is it so? &amp;nbsp;Is it lose some code?&lt;/P&gt;&lt;P&gt;thank you for answer this question.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 03:06:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8108305#M48985</guid>
      <dc:creator>chinhung77</dc:creator>
      <dc:date>2018-07-04T03:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8108347#M48986</link>
      <description>&lt;P&gt;I try to correction the code.&lt;/P&gt;&lt;P&gt;And it's work!&lt;/P&gt;&lt;PRE&gt;FloorType floorType = floor.FloorType;           
            using (Transaction t = new Transaction(doc, "creat floor type"))
            {
                t.Start();
                ElementType elementType = floorType.Duplicate("淨高檢討");
                FloorType newfloorType = elementType as FloorType;
                //newfloorType.GetCompoundStructure().SetLayerWidth(0, 10);
                CompoundStructure compound = newfloorType.GetCompoundStructure();
                compound.SetLayerWidth(0, 10);
                newfloorType.SetCompoundStructure(compound);
                t.Commit();
            }&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 03:51:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/8108347#M48986</guid>
      <dc:creator>chinhung77</dc:creator>
      <dc:date>2018-07-04T03:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/9586050#M48987</link>
      <description>&lt;P&gt;I have four slabs ,&amp;nbsp;I do loop for modifying the thickness of slabs&amp;nbsp;&lt;/P&gt;&lt;P&gt;but Error Message is showed&lt;/P&gt;&lt;P&gt;how can I solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/////////////////////////////my code///////////////////////////////////&lt;/P&gt;&lt;P&gt;foreach (Floor floor in allFloors)&lt;BR /&gt;{&lt;BR /&gt;//Get Element Type&lt;BR /&gt;ElementId eleTypeId = floor.GetTypeId();&lt;BR /&gt;FloorType floorType = floor.FloorType;&lt;/P&gt;&lt;P&gt;PropertySlab slab = propertySlabs.FirstOrDefault(ps =&amp;gt; ps.Name == floor.Id.ToString());&lt;/P&gt;&lt;P&gt;using (Transaction slabTrans = new Transaction(doc, "Slab Transaction"))&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;slabTrans.Start();&lt;/P&gt;&lt;P&gt;ElementType elementType = floorType.Duplicate("new type");&lt;BR /&gt;FloorType newfloorType = elementType as FloorType;&lt;BR /&gt;CompoundStructure compound = newfloorType.GetCompoundStructure();&lt;BR /&gt;compound.SetLayerWidth(0, UnitUtils.Convert(slab.ts, DisplayUnitType.DUT_MILLIMETERS, DisplayUnitType.DUT_DECIMAL_FEET));&lt;/P&gt;&lt;P&gt;newfloorType.SetCompoundStructure(compound);&lt;/P&gt;&lt;P&gt;slabTrans.Commit();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception e)&lt;BR /&gt;{&lt;BR /&gt;TaskDialog.Show("Set Section", "Error : " + Environment.NewLine + e.Message + Environment.NewLine&lt;BR /&gt;+ "Slab Id : " + floor.Id + Environment.NewLine);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/////////////////////////////Error Message///////////////////////////////////////////////////////&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="res16.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/784954i2205FF2621B9106F/image-size/large?v=v2&amp;amp;px=999" role="button" title="res16.png" alt="res16.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 20:19:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/9586050#M48987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-17T20:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/9586278#M48988</link>
      <description>&lt;P&gt;When creating a new floor type or any other type you have to first identify if a type with the same name exists.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to make your floor slab 300mm thick you first check if an existing suitable type with 300mm thickness exists, if it doesn't you make a new type and check the name has not been used. If the type already exists you use it instead of creating new one. Typically for floor types the floor thickness would be included somewhere in the type name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are looping through four floors and each time creating a new type with the name 'new type' but you don't want each of the floor to have it's own type not if they are all the same thickness.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 22:42:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/9586278#M48988</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-06-17T22:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify floor thickness?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/9587181#M48989</link>
      <description>&lt;P&gt;I tried to check on thickness and floor name, but Error Message showed again&lt;/P&gt;&lt;P&gt;what is wrong in this code?&lt;/P&gt;&lt;P&gt;////////my code after check/////////////////////////////&lt;/P&gt;&lt;P&gt;double OldThickness = 0;&lt;BR /&gt;double NewThickness = 0;&lt;/P&gt;&lt;P&gt;foreach (Floor floor in allFloors)&lt;BR /&gt;{&lt;BR /&gt;//Get Element Type&lt;BR /&gt;ElementId eleTypeId = floor.GetTypeId();&lt;BR /&gt;FloorType floortype = doc.GetElement(eleTypeId) as FloorType;&lt;/P&gt;&lt;P&gt;PropertySlab slab = propertySlabs.FirstOrDefault(ps =&amp;gt; ps.Name == floor.Id.ToString());&lt;/P&gt;&lt;P&gt;using (Transaction slabTrans = new Transaction(doc, "Slab Transaction"))&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;slabTrans.Start();&lt;/P&gt;&lt;P&gt;CompoundStructure cs = floortype.GetCompoundStructure();&lt;BR /&gt;IList&amp;lt;CompoundStructureLayer&amp;gt; csl = cs.GetLayers();&lt;/P&gt;&lt;P&gt;foreach (CompoundStructureLayer layer in csl)&lt;BR /&gt;{&lt;BR /&gt;OldThickness = layer.Width = Math.Round(UnitUtils.ConvertFromInternalUnits(layer.Width, DisplayUnitType.DUT_METERS), 5);&lt;BR /&gt;NewThickness = UnitUtils.Convert(slab.ts, DisplayUnitType.DUT_MILLIMETERS, DisplayUnitType.DUT_METERS);&lt;/P&gt;&lt;P&gt;if (OldThickness != NewThickness)&lt;BR /&gt;{&lt;BR /&gt;string name = "slab " + slab.ts + " mm";&lt;BR /&gt;if (name != floortype.Name)&lt;BR /&gt;{&lt;BR /&gt;ElementType elementType = floortype.Duplicate("slab " + slab.ts + " mm");&lt;BR /&gt;FloorType newfloorType = elementType as FloorType;&lt;BR /&gt;CompoundStructure compound = newfloorType.GetCompoundStructure();&lt;BR /&gt;compound.SetLayerWidth(0, UnitUtils.Convert(slab.ts, DisplayUnitType.DUT_MILLIMETERS, DisplayUnitType.DUT_DECIMAL_FEET));&lt;BR /&gt;newfloorType.SetCompoundStructure(compound);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;floor.Name = name;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;slabTrans.Commit();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception e)&lt;BR /&gt;{&lt;BR /&gt;TaskDialog.Show("Set Slab", "Error : " + Environment.NewLine + e.Message + Environment.NewLine&lt;BR /&gt;+ "Slab Id : " + floor.Id + Environment.NewLine);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 12:08:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-modify-floor-thickness/m-p/9587181#M48989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-18T12:08:54Z</dc:date>
    </item>
  </channel>
</rss>

