diff --git a/APSToolkitPython/Tutorials/04.01. Explore Revit Data With APSToolkit.ipynb b/APSToolkitPython/Tutorials/04.01. Explore Revit Data With APSToolkit.ipynb index bc8bc96..419f8f3 100644 --- a/APSToolkitPython/Tutorials/04.01. Explore Revit Data With APSToolkit.ipynb +++ b/APSToolkitPython/Tutorials/04.01. Explore Revit Data With APSToolkit.ipynb @@ -14,7 +14,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Requirement already satisfied: aps-toolkit in c:\\users\\vho2\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (0.1.8)\n", + "Requirement already satisfied: aps-toolkit in c:\\users\\vho2\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (0.2.1)\n", "Requirement already satisfied: requests in c:\\users\\vho2\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from aps-toolkit) (2.31.0)\n", "Requirement already satisfied: pandas in c:\\users\\vho2\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from aps-toolkit) (2.2.0)\n", "Requirement already satisfied: numpy<2,>=1.23.2 in c:\\users\\vho2\\appdata\\local\\programs\\python\\python311\\lib\\site-packages (from pandas->aps-toolkit) (1.23.5)\n", @@ -590,13 +590,86 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2024-03-02T14:12:33.147249Z", "start_time": "2024-03-02T14:12:32.965972Z" } }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
dbIdexternal_id...Thermal Resistance (R)Heat Transfer Coefficient (U)
039026d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b...00
\n", + "

1 rows × 77 columns

\n", + "
" + ], + "text/plain": [ + " dbId external_id ... Thermal Resistance (R) Heat Transfer Coefficient (U)\n", + "0 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b ... 0 0\n", + "\n", + "[1 rows x 77 columns]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = prop_reader.get_data_by_category(\"Windows\")\n", + "pd.set_option('display.max_columns', 5)\n", + "pd.set_option('display.width', 1000)\n", + "df.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### I want get sub families element by revit category" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, "outputs": [ { "data": { @@ -622,20 +695,8 @@ " dbId\n", " external_id\n", " ElementId\n", - " name\n", - " Category\n", - " CategoryId\n", - " Level\n", - " Wall Thickness\n", - " Frame Extension\n", - " Head Height\n", + " Name\n", " ...\n", - " Distance\n", - " Opening Width\n", - " Opening Height\n", - " Trim Material\n", - " Picture Frame\n", - " Sill\n", " Trim Width\n", " Trim Thickness_Picture Frame\n", " Trim Thickness_with Sill\n", @@ -649,23 +710,11 @@ " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b\n", " 299579\n", " Window-Casement-Double [299579]\n", - " Revit Windows\n", - " -2000014\n", - " Level 1\n", - " 152.4\n", - " 6.35\n", - " 2579.053247\n", " ...\n", " NaN\n", " NaN\n", " NaN\n", " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " 1\n", @@ -673,19 +722,7 @@ " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa\n", " 299690\n", " Muntin Pattern_2x2 [299690]\n", - " Revit Generic Models\n", - " -2000151\n", - " Level 1\n", - " NaN\n", - " NaN\n", - " NaN\n", " ...\n", - " 19.05\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", " NaN\n", " NaN\n", " NaN\n", @@ -697,19 +734,7 @@ " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab\n", " 299691\n", " Muntin Pattern_2x2 [299691]\n", - " Revit Generic Models\n", - " -2000151\n", - " Level 1\n", - " NaN\n", - " NaN\n", - " NaN\n", " ...\n", - " 19.05\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", " NaN\n", " NaN\n", " NaN\n", @@ -721,19 +746,7 @@ " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac\n", " 299692\n", " Trim-Window-Exterior-Flat [299692]\n", - " Revit Generic Models\n", - " -2000151\n", - " Level 1\n", - " NaN\n", - " NaN\n", - " NaN\n", " ...\n", - " NaN\n", - " 1219.2\n", - " 1524.0\n", - " Clad - White\n", - " 0.0\n", - " 1.0\n", " 57.15\n", " 31.75\n", " 19.05\n", @@ -745,19 +758,7 @@ " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad\n", " 299693\n", " Trim-Window-Interior-Flat [299693]\n", - " Revit Generic Models\n", - " -2000151\n", - " Level 1\n", - " NaN\n", - " NaN\n", - " NaN\n", " ...\n", - " NaN\n", - " 1219.2\n", - " 1524.0\n", - " Wood - Stained\n", - " 1.0\n", - " 0.0\n", " 57.15\n", " 31.75\n", " 19.05\n", @@ -769,109 +770,29 @@ "" ], "text/plain": [ - " dbId external_id ElementId \\\n", - "0 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b 299579 \n", - "1 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa 299690 \n", - "2 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab 299691 \n", - "3 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac 299692 \n", - "4 3916 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad 299693 \n", - "\n", - " name Category CategoryId \\\n", - "0 Window-Casement-Double [299579] Revit Windows -2000014 \n", - "1 Muntin Pattern_2x2 [299690] Revit Generic Models -2000151 \n", - "2 Muntin Pattern_2x2 [299691] Revit Generic Models -2000151 \n", - "3 Trim-Window-Exterior-Flat [299692] Revit Generic Models -2000151 \n", - "4 Trim-Window-Interior-Flat [299693] Revit Generic Models -2000151 \n", - "\n", - " Level Wall Thickness Frame Extension Head Height ... Distance \\\n", - "0 Level 1 152.4 6.35 2579.053247 ... NaN \n", - "1 Level 1 NaN NaN NaN ... 19.05 \n", - "2 Level 1 NaN NaN NaN ... 19.05 \n", - "3 Level 1 NaN NaN NaN ... NaN \n", - "4 Level 1 NaN NaN NaN ... NaN \n", - "\n", - " Opening Width Opening Height Trim Material Picture Frame Sill \\\n", - "0 NaN NaN NaN NaN NaN \n", - "1 NaN NaN NaN NaN NaN \n", - "2 NaN NaN NaN NaN NaN \n", - "3 1219.2 1524.0 Clad - White 0.0 1.0 \n", - "4 1219.2 1524.0 Wood - Stained 1.0 0.0 \n", - "\n", - " Trim Width Trim Thickness_Picture Frame Trim Thickness_with Sill \\\n", - "0 NaN NaN NaN \n", - "1 NaN NaN NaN \n", - "2 NaN NaN NaN \n", - "3 57.15 31.75 19.05 \n", - "4 57.15 31.75 19.05 \n", - "\n", - " Sill Thickness \n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 31.75 \n", - "4 31.75 \n", + " dbId external_id ElementId Name ... Trim Width Trim Thickness_Picture Frame Trim Thickness_with Sill Sill Thickness\n", + "0 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b 299579 Window-Casement-Double [299579] ... NaN NaN NaN NaN\n", + "1 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa 299690 Muntin Pattern_2x2 [299690] ... NaN NaN NaN NaN\n", + "2 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab 299691 Muntin Pattern_2x2 [299691] ... NaN NaN NaN NaN\n", + "3 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac 299692 Trim-Window-Exterior-Flat [299692] ... 57.15 31.75 19.05 31.75\n", + "4 3916 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad 299693 Trim-Window-Interior-Flat [299693] ... 57.15 31.75 19.05 31.75\n", "\n", "[5 rows x 97 columns]" ] }, - "execution_count": 10, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = prop_reader.get_data_by_category(\"Windows\")\n", + "df = prop_reader.get_data_by_category(\"Windows\",True)\n", + "# show 5 columns and fix the width of the columns\n", + "pd.set_option('display.max_columns', 8)\n", + "pd.set_option('display.width', 1000)\n", "df.head()" ] }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Index(['dbId', 'external_id', 'ElementId', 'name', 'Category', 'CategoryId',\n", - " 'Level', 'Wall Thickness', 'Frame Extension', 'Head Height',\n", - " 'Sill Height', 'Window Inset', 'Exterior Wall Closure',\n", - " 'Interior Wall Closure', 'Extension Jamb', 'Data.Hello.Parquet',\n", - " 'Exterior Trim Visibility', 'Interior Trim Visibility',\n", - " 'Extension Jamb Visibility', 'Image', 'Comments', 'Mark', 'Workset',\n", - " 'Edited by', 'IFC Predefined Type', 'Export to IFC As', 'Export to IFC',\n", - " 'IfcGUID', 'Phase Created', 'Phase Demolished', 'Type Name',\n", - " 'Room Name', 'Room Number', 'Host Family', 'Default Sill Height',\n", - " 'Half Width', 'Wall Closure', 'Construction Type', 'Muntin Pattern',\n", - " 'Exterior Trim', 'Interior Trim', 'Width', 'Height', 'Rough Width',\n", - " 'Rough Height', 'Muntin Visibility', 'Assembly Code', 'Fire Rating',\n", - " 'Keynote', 'Model', 'Manufacturer', 'Type Comments', 'Type Image',\n", - " 'URL', 'Description', 'Cost', 'Assembly Description', 'Type Mark',\n", - " 'OmniClass Number', 'OmniClass Title', 'Code Name',\n", - " 'Export Type to IFC As', 'Operation', 'Type IFC Predefined Type',\n", - " 'Export Type to IFC', 'Type IfcGUID', 'Exterior Frame Material',\n", - " 'Interior Frame Material', 'Exterior Trim Material',\n", - " 'Interior Trim Material', 'Glass Panel Material',\n", - " 'Analytic Construction', 'Define Thermal Properties by',\n", - " 'Visual Light Transmittance', 'Solar Heat Gain Coefficient',\n", - " 'Thermal Resistance (R)', 'Heat Transfer Coefficient (U)',\n", - " 'Elevation from Level', 'Host', 'Offset from Host',\n", - " 'Moves With Nearby Elements', 'Volume', 'Exterior Material',\n", - " 'Interior Material', 'Sub Family', 'Default Elevation', 'Thickness',\n", - " 'Distance', 'Opening Width', 'Opening Height', 'Trim Material',\n", - " 'Picture Frame', 'Sill', 'Trim Width', 'Trim Thickness_Picture Frame',\n", - " 'Trim Thickness_with Sill', 'Sill Thickness'],\n", - " dtype='object')" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.columns" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -881,7 +802,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2024-03-02T14:12:34.998404Z", @@ -913,24 +834,12 @@ " dbId\n", " external_id\n", " ElementId\n", - " name\n", - " Category\n", - " CategoryId\n", - " Level\n", - " Head Height\n", - " Sill Height\n", - " Frame Type\n", + " Name\n", " ...\n", - " Default Elevation\n", - " Distance\n", - " Opening Width\n", - " Opening Height\n", - " Trim Material\n", - " Picture Frame\n", - " Sill\n", - " Trim Thickness_Picture Frame\n", - " Trim Thickness_with Sill\n", - " Sill Thickness\n", + " Interior Frame Material\n", + " Exterior Trim Material\n", + " Interior Trim Material\n", + " Glass Panel Material\n", " \n", " \n", " \n", @@ -940,23 +849,11 @@ " 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee\n", " 291310\n", " Single-Flush [291310]\n", - " Revit Doors\n", - " -2000023\n", - " Level 1\n", - " 2133.600000\n", - " 0.000000\n", - " \n", " ...\n", " NaN\n", " NaN\n", " NaN\n", " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " 1\n", @@ -964,20 +861,89 @@ " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b\n", " 299579\n", " Window-Casement-Double [299579]\n", - " Revit Windows\n", - " -2000014\n", - " Level 1\n", - " 2579.053247\n", - " 1055.053247\n", - " NaN\n", + " ...\n", + " Wood - Stained\n", + " Clad - White\n", + " Wood - Stained\n", + " Glass\n", + " \n", + " \n", + "\n", + "

2 rows × 86 columns

\n", + "" + ], + "text/plain": [ + " dbId external_id ElementId Name ... Interior Frame Material Exterior Trim Material Interior Trim Material Glass Panel Material\n", + "0 3551 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee 291310 Single-Flush [291310] ... NaN NaN NaN NaN\n", + "1 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b 299579 Window-Casement-Double [299579] ... Wood - Stained Clad - White Wood - Stained Glass\n", + "\n", + "[2 rows x 86 columns]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = prop_reader.get_data_by_categories([\"Doors\",\"Windows\"])\n", + "pd.set_option('display.max_columns', 8)\n", + "pd.set_option('display.width', 1000)\n", + "df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -987,45 +953,17 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -1035,21 +973,7 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -1060,51 +984,25 @@ "" ], "text/plain": [ - " dbId external_id ElementId \\\n", - "0 3551 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee 291310 \n", - "1 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b 299579 \n", - "2 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa 299690 \n", - "3 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab 299691 \n", - "4 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac 299692 \n", - "\n", - " name Category CategoryId \\\n", - "0 Single-Flush [291310] Revit Doors -2000023 \n", - "1 Window-Casement-Double [299579] Revit Windows -2000014 \n", - "2 Muntin Pattern_2x2 [299690] Revit Generic Models -2000151 \n", - "3 Muntin Pattern_2x2 [299691] Revit Generic Models -2000151 \n", - "4 Trim-Window-Exterior-Flat [299692] Revit Generic Models -2000151 \n", - "\n", - " Level Head Height Sill Height Frame Type ... Default Elevation \\\n", - "0 Level 1 2133.600000 0.000000 ... NaN \n", - "1 Level 1 2579.053247 1055.053247 NaN ... NaN \n", - "2 Level 1 NaN NaN NaN ... 0.0 \n", - "3 Level 1 NaN NaN NaN ... 0.0 \n", - "4 Level 1 NaN NaN NaN ... 1219.2 \n", - "\n", - " Distance Opening Width Opening Height Trim Material Picture Frame Sill \\\n", - "0 NaN NaN NaN NaN NaN NaN \n", - "1 NaN NaN NaN NaN NaN NaN \n", - "2 19.05 NaN NaN NaN NaN NaN \n", - "3 19.05 NaN NaN NaN NaN NaN \n", - "4 NaN 1219.2 1524.0 Clad - White 0.0 1.0 \n", - "\n", - " Trim Thickness_Picture Frame Trim Thickness_with Sill Sill Thickness \n", - "0 NaN NaN NaN \n", - "1 NaN NaN NaN \n", - "2 NaN NaN NaN \n", - "3 NaN NaN NaN \n", - "4 31.75 19.05 31.75 \n", + " dbId external_id ElementId ... Trim Thickness_Picture Frame Trim Thickness_with Sill Sill Thickness\n", + "0 3551 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee 291310 ... NaN NaN NaN\n", + "1 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b 299579 ... NaN NaN NaN\n", + "2 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa 299690 ... NaN NaN NaN\n", + "3 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab 299691 ... NaN NaN NaN\n", + "4 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac 299692 ... 31.75 19.05 31.75\n", "\n", "[5 rows x 104 columns]" ] }, - "execution_count": 12, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = prop_reader.get_data_by_categories([\"Doors\",\"Windows\"])\n", + "df = prop_reader.get_data_by_categories([\"Doors\",\"Windows\"],True)\n", + "pd.set_option('display.max_columns', 6)\n", + "pd.set_option('display.width', 1000)\n", "df.head()" ] }, @@ -1117,13 +1015,89 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": { "ExecuteTime": { "end_time": "2024-03-02T14:12:33.727202Z", "start_time": "2024-03-02T14:12:33.148254Z" } }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "
dbIdexternal_idElementId...Trim Thickness_Picture FrameTrim Thickness_with SillSill Thickness
035515bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee291310...NaNNaNNaNNaNNaNNaNNaN
139026d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b299579...NaNNaNNaN39076d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa299690Muntin Pattern_2x2 [299690]Revit Generic Models-2000151Level 1NaNNaNNaN...0.019.05NaNNaNNaNNaNNaNNaNNaNNaN
339086d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab299691Muntin Pattern_2x2 [299691]Revit Generic Models-2000151Level 1NaNNaNNaN...0.019.05NaNNaNNaNNaNNaN
339086d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab299691...NaNNaNNaN39126d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac299692Trim-Window-Exterior-Flat [299692]Revit Generic Models-2000151Level 1NaNNaNNaN...1219.2NaN1219.21524.0Clad - White0.01.031.7519.0531.75
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
dbIdexternal_idWorksetHeightWidth
035515bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471eeFamily : Doors : Single-Flush2133.6914.4
139026d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923bFamily : Windows : Window-Casement-Double1524.01219.2
\n", + "
" + ], + "text/plain": [ + " dbId external_id Workset Height Width\n", + "0 3551 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee Family : Doors : Single-Flush 2133.6 914.4\n", + "1 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b Family : Windows : Window-Casement-Double 1524.0 1219.2" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "prop_reader.get_data_by_categories_and_params([\"Doors\",\"Windows\"], [\"Width\", \"Height\",\"Length\",\"Workset\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### I want get data by revit categories and parameters (include sub families)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, "outputs": [ { "data": { @@ -1207,30 +1181,22 @@ "" ], "text/plain": [ - " dbId external_id \\\n", - "0 3551 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee \n", - "1 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b \n", - "2 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa \n", - "3 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab \n", - "4 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac \n", - "5 3916 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad \n", - "\n", - " Workset Height Width \n", - "0 Family : Doors : Single-Flush 2133.6 914.400 \n", - "1 Family : Windows : Window-Casement-Double 1524.0 1219.200 \n", - "2 Family : Generic Models : Muntin Pattern_2x2 1384.3 473.075 \n", - "3 Family : Generic Models : Muntin Pattern_2x2 1384.3 473.075 \n", - "4 Family : Generic Models : Trim-Window-Exterio... NaN NaN \n", - "5 Family : Generic Models : Trim-Window-Interio... NaN NaN " + " dbId external_id Workset Height Width\n", + "0 3551 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee Family : Doors : Single-Flush 2133.6 914.400\n", + "1 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b Family : Windows : Window-Casement-Double 1524.0 1219.200\n", + "2 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa Family : Generic Models : Muntin Pattern_2x2 1384.3 473.075\n", + "3 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab Family : Generic Models : Muntin Pattern_2x2 1384.3 473.075\n", + "4 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac Family : Generic Models : Trim-Window-Exterio... NaN NaN\n", + "5 3916 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad Family : Generic Models : Trim-Window-Interio... NaN NaN" ] }, - "execution_count": 13, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "prop_reader.get_data_by_categories_and_params([\"Doors\",\"Windows\"], [\"Width\", \"Height\",\"Length\",\"Workset\"])" + "prop_reader.get_data_by_categories_and_params([\"Doors\",\"Windows\"], [\"Width\", \"Height\",\"Length\",\"Workset\"],True)" ] }, { @@ -1242,9 +1208,97 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Number of Windows parameters: 77\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
dbIdexternal_id...Thermal Resistance (R)Heat Transfer Coefficient (U)
039026d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b...00
\n", + "

1 rows × 77 columns

\n", + "
" + ], + "text/plain": [ + " dbId external_id ... Thermal Resistance (R) Heat Transfer Coefficient (U)\n", + "0 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b ... 0 0\n", + "\n", + "[1 rows x 77 columns]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = prop_reader.get_data_by_external_id(\"6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b\")\n", + "print(\"Number of Windows parameters: \",df.columns.size)\n", + "pd.set_option('display.max_columns', 5)\n", + "pd.set_option('display.width', 1000)\n", + "df.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### I want check parameters of specific element in Revit model (include sub families)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Number of Windows parameters: 97\n" + ] + }, { "data": { "text/html": [ @@ -1266,108 +1320,81 @@ " \n", " \n", " \n", - " property\n", - " value\n", + " dbId\n", + " external_id\n", + " ...\n", + " Trim Thickness_with Sill\n", + " Sill Thickness\n", " \n", " \n", " \n", " \n", " 0\n", - " dbId\n", - " 3551\n", + " 3902\n", + " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b\n", + " ...\n", + " NaN\n", + " NaN\n", " \n", " \n", " 1\n", - " external_id\n", - " 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee\n", + " 3907\n", + " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa\n", + " ...\n", + " NaN\n", + " NaN\n", " \n", " \n", " 2\n", - " ElementId\n", - " 291310\n", + " 3908\n", + " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab\n", + " ...\n", + " NaN\n", + " NaN\n", " \n", " \n", " 3\n", - " name\n", - " Single-Flush [291310]\n", + " 3912\n", + " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac\n", + " ...\n", + " 19.05\n", + " 31.75\n", " \n", " \n", " 4\n", - " Category\n", - " Revit Doors\n", - " \n", - " \n", - " ...\n", - " ...\n", + " 3916\n", + " 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad\n", " ...\n", - " \n", - " \n", - " 60\n", - " Visual Light Transmittance\n", - " 0\n", - " \n", - " \n", - " 61\n", - " Solar Heat Gain Coefficient\n", - " 0\n", - " \n", - " \n", - " 62\n", - " Heat Transfer Coefficient (U)\n", - " 0.651978\n", - " \n", - " \n", - " 63\n", - " Analytic Construction\n", - " Metal\n", - " \n", - " \n", - " 64\n", - " Thermal Resistance (R)\n", - " 1.533795\n", + " 19.05\n", + " 31.75\n", " \n", " \n", "\n", - "

65 rows × 2 columns

\n", + "

5 rows × 97 columns

\n", "" ], "text/plain": [ - " property \\\n", - "0 dbId \n", - "1 external_id \n", - "2 ElementId \n", - "3 name \n", - "4 Category \n", - ".. ... \n", - "60 Visual Light Transmittance \n", - "61 Solar Heat Gain Coefficient \n", - "62 Heat Transfer Coefficient (U) \n", - "63 Analytic Construction \n", - "64 Thermal Resistance (R) \n", - "\n", - " value \n", - "0 3551 \n", - "1 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee \n", - "2 291310 \n", - "3 Single-Flush [291310] \n", - "4 Revit Doors \n", - ".. ... \n", - "60 0 \n", - "61 0 \n", - "62 0.651978 \n", - "63 Metal \n", - "64 1.533795 \n", + " dbId external_id ... Trim Thickness_with Sill Sill Thickness\n", + "0 3902 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b ... NaN NaN\n", + "1 3907 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492aa ... NaN NaN\n", + "2 3908 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ab ... NaN NaN\n", + "3 3912 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ac ... 19.05 31.75\n", + "4 3916 6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-000492ad ... 19.05 31.75\n", "\n", - "[65 rows x 2 columns]" + "[5 rows x 97 columns]" ] }, - "execution_count": 21, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "prop_reader.get_data_by_external_id(\"31261f36-7edb-41d9-95bc-f8df75aec4c4-00005a5b\")" + "df = prop_reader.get_data_by_external_id(\"6d22740f-4d3f-4cc6-a442-8c98ddd54f1f-0004923b\",True)\n", + "print(\"Number of Windows parameters: \",df.columns.size)\n", + "pd.set_option('display.max_columns', 5)\n", + "pd.set_option('display.width', 1000)\n", + "df.head()" ] }, {