{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import ifcopenshell" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "modelo_ifc = ifcopenshell.open('c:/Users/Fabiano/Downloads/Duplex_A_20110907_optimized.ifc')" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "#23728=IfcPropertySet('0POQNAwJXF8v2Jc_ap9HfZ',#1,'PSet_Revit_Structural',$,(#669,#672,#245))" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "quant = modelo_ifc.by_type('IfcRelDefinesByProperties')#('Qto_SpaceBaseQuantities')\n", "quant[0].RelatingPropertyDefinition" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "46.29\n" ] } ], "source": [ "for i in quant:\n", " if i.RelatingPropertyDefinition.is_a().find('IfcElementQuantity') != -1:\n", " if i.RelatedObjects[0].id() == 89:\n", " area = i.RelatingPropertyDefinition.Quantities[0].AreaValue \n", " volume = altura * area\n", " print('%.2f'%volume) " ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#89=IfcSpace('0BTBFw6f90Nfh9rP1dlXrr',#1,'A101','',$,#17711,#17014,'Foyer',.ELEMENT.,.INTERNAL.,$)\n" ] } ], "source": [ "espacos = modelo_ifc.by_type('ifcspace')\n", "for i in espacos:\n", " if i.id() == 89:\n", " elemento = i\n", " print(elemento)" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2.581" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sol = elemento.Representation.Representations[0].Items[0]\n", "altura = elemento.Representation.Representations[0].Items[0].Depth\n", "altura" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "#24853=IfcPolyline((#4419,#6906,#6629,#7106,#6922,#7127,#7193,#7719,#7665,#7120,#7893,#7512,#7122,#7900,#8072,#8077,#4419))" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sol.SweptArea.OuterCurve" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "lista = modelo_ifc.by_type('IfcRelContainedInSpatialStructure')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "#488=IfcBuildingStorey('1xS3BCk291UvhgP2dvNMQJ',#1,'Level 2',$,$,#29,$,$,.ELEMENT.,3.100000000000378)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pavimentos = modelo_ifc.by_type('IfcBuildingStorey')\n", "pavimentos[0]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "489\n" ] } ], "source": [ "for i in pavimentos:\n", " if i.Name.find('Roof') != -1:\n", " identidade = i.id()\n", " print(identidade)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "489" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "identidade" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[#25627=IfcRelContainedInSpatialStructure('1d5AvRcmP9xuXjyi_pQ1k$',#1,$,$,(#453),#129),\n", " #27003=IfcRelContainedInSpatialStructure('1DrPm_24bErQ1OLWfhdX_h',#1,$,$,(#442,#451),#128),\n", " #27004=IfcRelContainedInSpatialStructure('2V7GTP4vX5SxzTYePgxo_z',#1,$,$,(#454,#443),#118),\n", " #27367=IfcRelContainedInSpatialStructure('31Ont0taD6dx31BRi_5LrC',#1,$,$,(#368,#363,#501,#499),#82),\n", " #27368=IfcRelContainedInSpatialStructure('2FK3PgUTX0tfQdRZc_LDIM',#1,$,$,(#365,#364,#506,#502),#97),\n", " #27369=IfcRelContainedInSpatialStructure('3pEFVYrCPBaxU_NegLJnxW',#1,$,$,(#370,#369,#500,#509),#83),\n", " #27370=IfcRelContainedInSpatialStructure('066ZTZCdfA$hyZXIeKoLN9',#1,$,$,(#367,#366,#510,#504),#96),\n", " #27430=IfcRelContainedInSpatialStructure('2UCaZkgYb1h8JT$WYIuSAX',#1,$,$,(#511,#513,#507,#512,#498),#119),\n", " #27431=IfcRelContainedInSpatialStructure('0S5bxbJXX7yR6EQQkY9pZC',#1,$,$,(#496,#497,#503,#505,#508),#113),\n", " #27464=IfcRelContainedInSpatialStructure('0yjJ6N$wD2kfre4S1$lVJf',#1,$,$,(#197,#217,#215,#218,#221,#290,#292),#489),\n", " #27503=IfcRelContainedInSpatialStructure('1r1dNJmmP8kB7iDB$DoF_F',#1,$,$,(#223,#187,#224,#189,#222,#225,#219,#336,#334,#337,#339,#338,#340,#335),#617),\n", " #27505=IfcRelContainedInSpatialStructure('1$znIZCDr7IRIDOwiYHdiX',#1,$,$,(#446,#433,#444,#434,#344,#342,#447,#345,#450,#440,#438,#458,#456,#457,#460),#126),\n", " #27506=IfcRelContainedInSpatialStructure('1MP07bBzT6zBpJTsfmd_lI',#1,$,$,(#435,#449,#445,#441,#346,#343,#439,#341,#448,#455,#436,#437,#452,#461,#459),#127),\n", " #27525=IfcRelContainedInSpatialStructure('1OnF7j$Fj2cP4Xy3mK4kIj',#1,$,$,(#123,#104,#133,#101,#216,#135,#122,#121,#263,#134,#131,#220,#111,#112,#130,#132,#268,#274,#252,#253,#231,#230,#199,#201,#170,#150,#211,#207,#209,#151,#214,#254,#251,#179,#327,#328,#333,#250,#188,#156,#154,#141,#153,#169,#257,#261,#175,#178,#171,#172,#256,#255),#490),\n", " #27527=IfcRelContainedInSpatialStructure('0jhxSK53z3pxjw0BkrBPlO',#1,$,$,(#98,#105,#99,#114,#94,#92,#155,#142,#144,#91,#160,#143,#140,#87,#86,#272,#229,#293,#298,#273,#228,#299,#297,#181,#180,#200,#203,#204,#202,#212,#205,#206,#208,#213,#210,#183,#182,#227,#296,#275,#294,#226,#291,#295,#271,#270,#269,#329,#332,#289,#286,#287,#288,#331,#330,#161,#159,#157,#198,#158,#125,#173,#174,#177,#176,#260,#266,#264,#265,#267,#258,#262,#259),#488)]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lista" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.6" } }, "nbformat": 4, "nbformat_minor": 2 }