<?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 reduce Elements dimension in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11952037#M12132</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have columns in my project, and after a period of time, I realized that I should reduce the length, width, and height of each column by about 1 cm. How can I visually achieve this in Revit using Python?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 15:36:14 GMT</pubDate>
    <dc:creator>husam_al-jawhar</dc:creator>
    <dc:date>2023-05-09T15:36:14Z</dc:date>
    <item>
      <title>reduce Elements dimension</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11952037#M12132</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have columns in my project, and after a period of time, I realized that I should reduce the length, width, and height of each column by about 1 cm. How can I visually achieve this in Revit using Python?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 15:36:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11952037#M12132</guid>
      <dc:creator>husam_al-jawhar</dc:creator>
      <dc:date>2023-05-09T15:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: reduce Elements dimension</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11952254#M12133</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I'm not sure about changing the height of the columns, as it is usually linked to the elevation of the level above and it's easier to move level manually. But as for length and width, you have to do it by changing the parameter values. Follow the steps below:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1. Define a system element category through Revit Lookup. Most likely it will be either OST_StructuralColumns for structural columns or OST_Columns for architectural ones.&lt;BR /&gt;2. Make a selection of elements of a given category using FilteredElementCollector.&lt;BR /&gt;3. Check in Revit which parameters control the length and width of the column. First of all, you need to understand if they are type or instance parameters. If type, then add the WhereElementIsElementType() method to the collector. If instance, then WhereElementIsNotElementType().&lt;BR /&gt;4. Open a transaction and start to loop through all the columns selected in the collector.&lt;BR /&gt;5. For each column:&lt;BR /&gt;5.1 Get the parameter objects as well as their numeric values. To do this, look up the parameter names and get them via the LookupParameter() method (in the case of system parameters, you can also get them using the BuiltInParameter enumeration using the get_Parameter method).&lt;BR /&gt;5.2 Subtract 10 mm from each value, converting millimeters to feet.&lt;BR /&gt;5.3 Assign new values to the parameters&lt;BR /&gt;6. Close the transaction&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example of one possible implementation of your code is shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Use these imports if you run your code in Revit Python Shell
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit import DB
from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory

doc = __revit__.ActiveUIDocument.Document

# If using Dynamo, delete the code above and turn the comments below into code.
# import clr

# clr.AddReference('RevitServices')
# from RevitServices.Persistence import DocumentManager

# clr.AddReference('RevitAPI')
# from Autodesk.Revit import DB
# from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory

# doc = DocumentManager.Instance.CurrentDBDocument

column_types = FilteredElementCollector(doc) \
    .OfCategory(BuiltInCategory.OST_Columns) \
    .WhereElementIsElementType()

with DB.Transaction(doc, 'Changing Type Parameter Values') as t:
    t.Start()
    for column_type in column_types:
        depth_par = column_type.LookupParameter("Depth")
        width_par = column_type.LookupParameter("Width")
        depth_value = depth_par.AsDouble() - (10 / 304.8)
        width_value = width_par.AsDouble() - (10 / 304.8)
        depth_par.Set(depth_value)
        width_par.Set(width_value)
    t.Commit()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 17:24:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11952254#M12133</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-05-09T17:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: reduce Elements dimension</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11956591#M12134</link>
      <description>Hi Maxim,&lt;BR /&gt;Many thanks for your answer. I will try it and inform you of the results.&lt;BR /&gt;Cheers,&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2023 09:53:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/reduce-elements-dimension/m-p/11956591#M12134</guid>
      <dc:creator>husam_al-jawhar</dc:creator>
      <dc:date>2023-05-11T09:53:45Z</dc:date>
    </item>
  </channel>
</rss>

