2019-11-17 11:38:56 +11:00
import json
import os
2020-04-08 14:15:36 +10:00
import ifcopenshell
2019-11-17 11:38:56 +11:00
from pathlib import Path
2019-12-04 17:49:28 +11:00
from . import export_ifc
2020-01-15 17:17:03 +11:00
from . import schema
2020-04-24 18:05:59 +10:00
from . import ifc
2020-05-03 19:54:27 +10:00
from . import annotation
2020-12-10 23:49:35 +07:00
from . import decoration
2019-12-07 21:33:44 +11:00
import bpy
2021-01-06 15:19:55 +11:00
from blenderbim . bim . ifc import IfcStore
2019-11-17 11:38:56 +11:00
from bpy . types import PropertyGroup
2019-12-07 21:33:44 +11:00
from bpy . app . handlers import persistent
2019-11-17 11:38:56 +11:00
from bpy . props import (
2020-01-19 18:41:57 +11:00
PointerProperty ,
2019-11-17 11:38:56 +11:00
StringProperty ,
EnumProperty ,
BoolProperty ,
IntProperty ,
FloatProperty ,
2020-04-27 09:33:00 +10:00
FloatVectorProperty ,
2020-11-01 20:08:48 +07:00
CollectionProperty ,
2019-11-17 11:38:56 +11:00
)
cwd = os . path . dirname ( os . path . realpath ( __file__ ) )
2019-12-12 12:51:47 +11:00
diagram_scales_enum = [ ]
2020-01-13 17:35:56 +11:00
products_enum = [ ]
2020-01-14 17:38:54 +11:00
profiledef_enum = [ ]
2019-11-17 11:38:56 +11:00
classes_enum = [ ]
types_enum = [ ]
2020-01-12 19:01:35 +11:00
availablematerialpsets_enum = [ ]
2020-08-05 17:18:10 +10:00
ifcpatchrecipes_enum = [ ]
2020-01-28 18:10:33 +11:00
featuresfiles_enum = [ ]
2020-08-28 23:16:25 +10:00
titleblocks_enum = [ ]
2020-01-28 18:10:33 +11:00
scenarios_enum = [ ]
2020-11-11 23:02:07 +11:00
materialpsetnames_enum = [ ]
2019-11-17 11:38:56 +11:00
psetfiles_enum = [ ]
2020-04-24 17:14:07 +10:00
psettemplatefiles_enum = [ ]
propertysettemplates_enum = [ ]
2019-11-17 11:38:56 +11:00
classification_enum = [ ]
attributes_enum = [ ]
2021-01-07 19:09:55 +11:00
psetnames = { }
2020-04-08 14:15:36 +10:00
qtonames_enum = [ ]
2020-01-14 15:38:22 +11:00
materialattributes_enum = [ ]
2020-01-14 13:28:48 +11:00
materialtypes_enum = [ ]
2019-12-04 17:49:28 +11:00
contexts_enum = [ ]
subcontexts_enum = [ ]
target_views_enum = [ ]
2020-01-03 15:53:57 +11:00
persons_enum = [ ]
organisations_enum = [ ]
2020-03-26 18:26:35 +11:00
sheets_enum = [ ]
2020-08-13 20:38:50 +10:00
vector_styles_enum = [ ]
2019-11-17 11:38:56 +11:00
2020-11-01 20:08:48 +07:00
2019-12-07 21:33:44 +11:00
@persistent
def setDefaultProperties ( scene ) :
2020-08-13 09:22:27 +10:00
if len ( bpy . context . scene . DocProperties . drawing_styles ) == 0 :
drawing_style = bpy . context . scene . DocProperties . drawing_styles . add ( )
2020-11-01 20:08:48 +07:00
drawing_style . name = " Technical "
drawing_style . render_type = " VIEWPORT "
drawing_style . raster_style = json . dumps (
{
" bpy.data.worlds[0].color " : ( 1 , 1 , 1 ) ,
" bpy.context.scene.render.engine " : " BLENDER_WORKBENCH " ,
" bpy.context.scene.render.film_transparent " : False ,
" bpy.context.scene.display.shading.show_object_outline " : True ,
" bpy.context.scene.display.shading.show_cavity " : False ,
" bpy.context.scene.display.shading.cavity_type " : " BOTH " ,
" bpy.context.scene.display.shading.curvature_ridge_factor " : 1 ,
" bpy.context.scene.display.shading.curvature_valley_factor " : 1 ,
" bpy.context.scene.view_settings.view_transform " : " Standard " ,
" bpy.context.scene.display.shading.light " : " FLAT " ,
" bpy.context.scene.display.shading.color_type " : " SINGLE " ,
" bpy.context.scene.display.shading.single_color " : ( 1 , 1 , 1 ) ,
" bpy.context.scene.display.shading.show_shadows " : False ,
" bpy.context.scene.display.shading.shadow_intensity " : 0.5 ,
" bpy.context.scene.display.light_direction " : ( 0.5 , 0.5 , 0.5 ) ,
" bpy.context.scene.view_settings.use_curve_mapping " : False ,
" space.overlay.show_wireframes " : True ,
" space.overlay.wireframe_threshold " : 0 ,
" space.overlay.show_floor " : False ,
" space.overlay.show_axis_x " : False ,
" space.overlay.show_axis_y " : False ,
" space.overlay.show_axis_z " : False ,
" space.overlay.show_object_origins " : False ,
" space.overlay.show_relationship_lines " : False ,
}
)
2020-08-13 09:22:27 +10:00
drawing_style = bpy . context . scene . DocProperties . drawing_styles . add ( )
2020-11-01 20:08:48 +07:00
drawing_style . name = " Shaded "
drawing_style . render_type = " VIEWPORT "
drawing_style . raster_style = json . dumps (
{
" bpy.data.worlds[0].color " : ( 1 , 1 , 1 ) ,
" bpy.context.scene.render.engine " : " BLENDER_WORKBENCH " ,
" bpy.context.scene.render.film_transparent " : False ,
" bpy.context.scene.display.shading.show_object_outline " : True ,
" bpy.context.scene.display.shading.show_cavity " : True ,
" bpy.context.scene.display.shading.cavity_type " : " BOTH " ,
" bpy.context.scene.display.shading.curvature_ridge_factor " : 1 ,
" bpy.context.scene.display.shading.curvature_valley_factor " : 1 ,
" bpy.context.scene.view_settings.view_transform " : " Standard " ,
" bpy.context.scene.display.shading.light " : " STUDIO " ,
" bpy.context.scene.display.shading.color_type " : " MATERIAL " ,
" bpy.context.scene.display.shading.single_color " : ( 1 , 1 , 1 ) ,
" bpy.context.scene.display.shading.show_shadows " : True ,
" bpy.context.scene.display.shading.shadow_intensity " : 0.5 ,
" bpy.context.scene.display.light_direction " : ( 0.5 , 0.5 , 0.5 ) ,
" bpy.context.scene.view_settings.use_curve_mapping " : False ,
" space.overlay.show_wireframes " : True ,
" space.overlay.wireframe_threshold " : 0 ,
" space.overlay.show_floor " : False ,
" space.overlay.show_axis_x " : False ,
" space.overlay.show_axis_y " : False ,
" space.overlay.show_axis_z " : False ,
" space.overlay.show_object_origins " : False ,
" space.overlay.show_relationship_lines " : False ,
}
)
2020-09-09 23:21:24 +10:00
drawing_style = bpy . context . scene . DocProperties . drawing_styles . add ( )
2020-11-01 20:08:48 +07:00
drawing_style . name = " Blender Default "
drawing_style . render_type = " DEFAULT "
bpy . ops . bim . save_drawing_style ( index = " 2 " )
2019-12-07 21:33:44 +11:00
2019-11-17 11:38:56 +11:00
def getIfcPredefinedTypes ( self , context ) :
global types_enum
2021-01-06 15:19:55 +11:00
file = IfcStore . get_file ( )
if len ( types_enum ) < 1 and file :
2021-01-07 10:47:50 +11:00
declaration = IfcStore . get_schema ( ) . declaration_by_name ( self . ifc_class )
2021-01-06 15:19:55 +11:00
for attribute in declaration . attributes ( ) :
if attribute . name ( ) == " PredefinedType " :
types_enum . extend ( [ ( e , e , " " ) for e in attribute . type_of_attribute ( ) . declared_type ( ) . enumeration_items ( ) ] )
break
2019-11-17 11:38:56 +11:00
return types_enum
2020-01-13 17:35:56 +11:00
def refreshClasses ( self , context ) :
global classes_enum
classes_enum . clear ( )
2020-01-30 15:33:01 +11:00
enum = getIfcClasses ( self , context )
context . scene . BIMProperties . ifc_class = enum [ 0 ] [ 0 ]
2020-01-13 17:35:56 +11:00
2019-11-17 11:38:56 +11:00
def refreshPredefinedTypes ( self , context ) :
global types_enum
types_enum . clear ( )
2020-01-30 08:57:20 +11:00
enum = getIfcPredefinedTypes ( self , context )
context . scene . BIMProperties . ifc_predefined_type = enum [ 0 ] [ 0 ]
2019-11-17 11:38:56 +11:00
2019-12-12 12:51:47 +11:00
def getDiagramScales ( self , context ) :
global diagram_scales_enum
2020-11-01 20:08:48 +07:00
if (
len ( diagram_scales_enum ) < 1
or ( bpy . context . scene . unit_settings . system == " IMPERIAL " and len ( diagram_scales_enum ) == 13 )
or ( bpy . context . scene . unit_settings . system == " METRIC " and len ( diagram_scales_enum ) == 31 )
) :
if bpy . context . scene . unit_settings . system == " IMPERIAL " :
2020-08-28 21:40:24 +10:00
diagram_scales_enum = [
2020-11-01 20:08:48 +07:00
( " CUSTOM " , " Custom " , " " ) ,
( " 1 ' =1 ' -0 \" |1/1 " , " 1 ' =1 ' -0 \" " , " " ) ,
( ' 6 " =1 \' -0 " |1/6 ' , ' 6 " =1 \' -0 " ' , " " ) ,
( ' 1-1/2 " =1 \' -0 " |1/8 ' , ' 1-1/2 " =1 \' -0 " ' , " " ) ,
( ' 1 " =1 \' -0 " |1/12 ' , ' 1 " =1 \' -0 " ' , " " ) ,
( ' 3/4 " =1 \' -0 " |1/16 ' , ' 3/4 " =1 \' -0 " ' , " " ) ,
( ' 1/2 " =1 \' -0 " |1/24 ' , ' 1/2 " =1 \' -0 " ' , " " ) ,
( ' 3/8 " =1 \' -0 " |1/32 ' , ' 3/8 " =1 \' -0 " ' , " " ) ,
( ' 1/4 " =1 \' -0 " |1/48 ' , ' 1/4 " =1 \' -0 " ' , " " ) ,
( ' 3/16 " =1 \' -0 " |1/64 ' , ' 3/16 " =1 \' -0 " ' , " " ) ,
( ' 1/8 " =1 \' -0 " |1/96 ' , ' 1/8 " =1 \' -0 " ' , " " ) ,
( ' 3/32 " =1 \' -0 " |1/128 ' , ' 3/32 " =1 \' -0 " ' , " " ) ,
( ' 1/16 " =1 \' -0 " |1/192 ' , ' 1/16 " =1 \' -0 " ' , " " ) ,
( ' 1/32 " =1 \' -0 " |1/384 ' , ' 1/32 " =1 \' -0 " ' , " " ) ,
( ' 1/64 " =1 \' -0 " |1/768 ' , ' 1/64 " =1 \' -0 " ' , " " ) ,
( ' 1/128 " =1 \' -0 " |1/1536 ' , ' 1/128 " =1 \' -0 " ' , " " ) ,
( " 1 \" =10 ' |1/120 " , " 1 \" =10 ' " , " " ) ,
( " 1 \" =20 ' |1/240 " , " 1 \" =20 ' " , " " ) ,
( " 1 \" =30 ' |1/360 " , " 1 \" =30 ' " , " " ) ,
( " 1 \" =40 ' |1/480 " , " 1 \" =40 ' " , " " ) ,
( " 1 \" =50 ' |1/600 " , " 1 \" =50 ' " , " " ) ,
( " 1 \" =60 ' |1/720 " , " 1 \" =60 ' " , " " ) ,
( " 1 \" =70 ' |1/840 " , " 1 \" =70 ' " , " " ) ,
( " 1 \" =80 ' |1/960 " , " 1 \" =80 ' " , " " ) ,
( " 1 \" =90 ' |1/1080 " , " 1 \" =90 ' " , " " ) ,
( " 1 \" =100 ' |1/1200 " , " 1 \" =100 ' " , " " ) ,
( " 1 \" =150 ' |1/1800 " , " 1 \" =150 ' " , " " ) ,
( " 1 \" =200 ' |1/2400 " , " 1 \" =200 ' " , " " ) ,
( " 1 \" =300 ' |1/3600 " , " 1 \" =300 ' " , " " ) ,
( " 1 \" =400 ' |1/4800 " , " 1 \" =400 ' " , " " ) ,
( " 1 \" =500 ' |1/6000 " , " 1 \" =500 ' " , " " ) ,
2020-08-28 21:40:24 +10:00
]
else :
diagram_scales_enum = [
2020-11-01 20:08:48 +07:00
( " CUSTOM " , " Custom " , " " ) ,
( " 1:5000|1/5000 " , " 1:5000 " , " " ) ,
( " 1:2000|1/2000 " , " 1:2000 " , " " ) ,
( " 1:1000|1/1000 " , " 1:1000 " , " " ) ,
( " 1:500|1/500 " , " 1:500 " , " " ) ,
( " 1:200|1/200 " , " 1:200 " , " " ) ,
( " 1:100|1/100 " , " 1:100 " , " " ) ,
( " 1:50|1/50 " , " 1:50 " , " " ) ,
( " 1:20|1/20 " , " 1:20 " , " " ) ,
( " 1:10|1/10 " , " 1:10 " , " " ) ,
( " 1:5|1/5 " , " 1:5 " , " " ) ,
( " 1:2|1/2 " , " 1:2 " , " " ) ,
( " 1:1|1/1 " , " 1:1 " , " " ) ,
2020-08-28 21:40:24 +10:00
]
2019-12-12 12:51:47 +11:00
return diagram_scales_enum
2020-08-13 20:17:51 +10:00
def updateDrawingName ( self , context ) :
2020-08-28 11:45:57 +10:00
if not self . camera :
return
2020-08-13 20:17:51 +10:00
if self . camera . name == self . name :
return
2020-11-01 20:08:48 +07:00
self . camera . name = " IfcGroup/ {} " . format ( self . name )
2020-08-13 20:17:51 +10:00
self . camera . users_collection [ 0 ] . name = self . camera . name
2020-11-01 20:08:48 +07:00
self . name = self . camera . name . split ( " / " ) [ 1 ]
2020-08-13 20:17:51 +10:00
2020-01-19 18:41:57 +11:00
def getBoundaryConditionClasses ( self , context ) :
2020-11-01 20:08:48 +07:00
return [
( c , c , " " )
for c in [
" IfcBoundaryEdgeCondition " ,
" IfcBoundaryFaceCondition " ,
" IfcBoundaryNodeCondition " ,
" IfcBoundaryNodeConditionWarping " ,
]
]
2020-01-19 18:41:57 +11:00
def refreshBoundaryConditionAttributes ( self , context ) :
while len ( context . active_object . BIMObjectProperties . boundary_condition . attributes ) > 0 :
context . active_object . BIMObjectProperties . boundary_condition . attributes . remove ( 0 )
2020-11-01 20:08:48 +07:00
for attribute in schema . ifc . elements [ context . active_object . BIMObjectProperties . boundary_condition . name ] [
" complex_attributes "
] :
2020-01-19 18:41:57 +11:00
new_attribute = context . active_object . BIMObjectProperties . boundary_condition . attributes . add ( )
2020-11-01 20:08:48 +07:00
new_attribute . name = attribute [ " name " ]
2020-01-19 18:41:57 +11:00
2020-09-07 17:08:04 +10:00
def refreshActiveDrawingIndex ( self , context ) :
bpy . ops . bim . activate_view ( drawing_index = context . scene . DocProperties . active_drawing_index )
2020-01-13 17:35:56 +11:00
def getIfcProducts ( self , context ) :
global products_enum
2021-01-07 21:02:46 +11:00
file = IfcStore . get_file ( )
2020-01-13 17:35:56 +11:00
if len ( products_enum ) < 1 :
2020-11-01 20:08:48 +07:00
products_enum . extend (
[
( e , e , " " )
for e in [
" IfcElement " ,
" IfcElementType " ,
" IfcSpatialElement " ,
" IfcGroup " ,
2021-01-06 15:19:55 +11:00
" IfcStructuralItem " ,
2020-11-01 20:08:48 +07:00
" IfcContext " ,
" IfcAnnotation " ,
]
]
)
2021-01-07 21:02:46 +11:00
if file . schema == " IFC2X3 " :
products_enum [ 2 ] = ( " IfcSpatialStructureElement " , " IfcSpatialStructureElement " , " " )
2020-01-13 17:35:56 +11:00
return products_enum
2019-11-17 11:38:56 +11:00
def getIfcClasses ( self , context ) :
global classes_enum
2021-01-06 15:19:55 +11:00
file = IfcStore . get_file ( )
if len ( classes_enum ) < 1 and file :
2021-01-07 10:47:50 +11:00
declaration = IfcStore . get_schema ( ) . declaration_by_name ( self . ifc_product )
2021-01-06 15:19:55 +11:00
def get_classes ( declaration ) :
results = [ ]
if not declaration . is_abstract ( ) :
results . append ( declaration . name ( ) )
for subtype in declaration . subtypes ( ) :
results . extend ( get_classes ( subtype ) )
return results
classes = get_classes ( declaration )
classes_enum . extend ( [ ( c , c , " " ) for c in sorted ( classes ) ] )
2019-11-17 11:38:56 +11:00
return classes_enum
2021-01-05 13:16:31 +11:00
def getAttributeEnumValues ( self , context ) :
return [ ( e , e , " " ) for e in json . loads ( self . enum_items ) ]
2020-01-14 17:38:54 +11:00
def getProfileDef ( self , context ) :
global profiledef_enum
if len ( profiledef_enum ) < 1 :
2020-11-01 20:08:48 +07:00
profiledef_enum . extend ( [ ( e , e , " " ) for e in getattr ( schema . ifc , " IfcParameterizedProfileDef " ) ] )
2020-01-14 17:38:54 +11:00
return profiledef_enum
2020-01-03 15:53:57 +11:00
def getPersons ( self , context ) :
global persons_enum
2020-07-13 15:29:06 +10:00
persons_enum . clear ( )
2020-11-01 20:08:48 +07:00
persons_enum . extend ( [ ( p . name , p . name , " " ) for p in bpy . context . scene . BIMProperties . people ] )
2020-01-03 15:53:57 +11:00
return persons_enum
def getOrganisations ( self , context ) :
global organisations_enum
2020-07-13 15:29:06 +10:00
organisations_enum . clear ( )
2020-11-01 20:08:48 +07:00
organisations_enum . extend ( [ ( o . name , o . name , " " ) for o in bpy . context . scene . BIMProperties . organisations ] )
2020-01-03 15:53:57 +11:00
return organisations_enum
2020-08-05 17:18:10 +10:00
def getIfcPatchRecipes ( self , context ) :
global ifcpatchrecipes_enum
if len ( ifcpatchrecipes_enum ) < 1 :
ifcpatchrecipes_enum . clear ( )
2020-11-01 20:08:48 +07:00
for filename in Path ( os . path . join ( cwd , " .. " , " libs " , " site " , " packages " , " recipes " ) ) . glob ( " *.py " ) :
2020-08-05 17:18:10 +10:00
f = str ( filename . stem )
2020-11-01 20:08:48 +07:00
if f == " __init__ " :
2020-08-05 17:18:10 +10:00
continue
2020-11-01 20:08:48 +07:00
ifcpatchrecipes_enum . append ( ( f , f , " " ) )
2020-08-05 17:18:10 +10:00
return ifcpatchrecipes_enum
2020-01-28 18:10:33 +11:00
def getFeaturesFiles ( self , context ) :
global featuresfiles_enum
if len ( featuresfiles_enum ) < 1 :
featuresfiles_enum . clear ( )
2020-11-01 20:08:48 +07:00
for filename in Path ( context . scene . BIMProperties . features_dir ) . glob ( " *.feature " ) :
2020-01-28 18:10:33 +11:00
f = str ( filename . stem )
2020-11-01 20:08:48 +07:00
featuresfiles_enum . append ( ( f , f , " " ) )
2020-01-28 18:10:33 +11:00
return featuresfiles_enum
def refreshFeaturesFiles ( self , context ) :
global featuresfiles_enum
featuresfiles_enum . clear ( )
getFeaturesFiles ( self , context )
2020-08-28 23:16:25 +10:00
def getTitleblocks ( self , context ) :
global titleblocks_enum
if len ( titleblocks_enum ) < 1 :
titleblocks_enum . clear ( )
2020-11-01 20:08:48 +07:00
for filename in Path ( os . path . join ( context . scene . BIMProperties . data_dir , " templates " , " titleblocks " ) ) . glob (
" *.svg "
) :
2020-08-28 23:16:25 +10:00
f = str ( filename . stem )
2020-11-01 20:08:48 +07:00
titleblocks_enum . append ( ( f , f , " " ) )
2020-08-28 23:16:25 +10:00
return titleblocks_enum
def refreshTitleblocks ( self , context ) :
global titleblocks_enum
titleblocks_enum . clear ( )
getTitleblocks ( self , context )
2020-12-11 11:13:48 +11:00
def toggleDecorations ( self , context ) :
toggle = self . should_draw_decorations
2020-12-10 23:49:35 +07:00
if toggle :
2021-01-06 03:52:40 +07:00
decoration . DecorationsHandler . install ( context )
2020-12-10 23:49:35 +07:00
else :
2021-01-06 03:52:40 +07:00
decoration . DecorationsHandler . uninstall ( )
2020-12-10 23:49:35 +07:00
2021-01-06 04:01:03 +07:00
@persistent
def toggleDecorationsOnLoad ( * args ) :
toggle = bpy . context . scene . DocProperties . should_draw_decorations
if toggle :
decoration . DecorationsHandler . install ( bpy . context )
else :
decoration . DecorationsHandler . uninstall ( )
2020-01-28 18:10:33 +11:00
def getScenarios ( self , context ) :
global scenarios_enum
if len ( scenarios_enum ) < 1 :
scenarios_enum . clear ( )
filename = os . path . join (
2020-11-01 20:08:48 +07:00
context . scene . BIMProperties . features_dir , context . scene . BIMProperties . features_file + " .feature "
)
with open ( filename , " r " ) as feature_file :
2020-01-28 18:10:33 +11:00
lines = feature_file . readlines ( )
for line in lines :
2020-11-01 20:08:48 +07:00
if " Scenario: " in line :
s = line . strip ( ) [ len ( " Scenario: " ) : ]
scenarios_enum . append ( ( s , s , " " ) )
2020-01-28 18:10:33 +11:00
return scenarios_enum
def refreshScenarios ( self , context ) :
global scenarios_enum
scenarios_enum . clear ( )
getScenarios ( self , context )
2020-04-24 17:14:07 +10:00
def getPsetTemplateFiles ( self , context ) :
global psettemplatefiles_enum
if len ( psettemplatefiles_enum ) < 1 :
2020-11-01 20:08:48 +07:00
files = os . listdir ( os . path . join ( self . data_dir , " pset " ) )
psettemplatefiles_enum . extend ( [ ( f . replace ( " .ifc " , " " ) , f . replace ( " .ifc " , " " ) , " " ) for f in files ] )
2020-04-24 17:14:07 +10:00
return psettemplatefiles_enum
def refreshPropertySetTemplates ( self , context ) :
global propertysettemplates_enum
propertysettemplates_enum . clear ( )
getPropertySetTemplates ( self , context )
def getPropertySetTemplates ( self , context ) :
global propertysettemplates_enum
if len ( propertysettemplates_enum ) < 1 :
2020-04-24 18:05:59 +10:00
ifc . IfcStore . pset_template_path = os . path . join (
2020-11-01 20:08:48 +07:00
context . scene . BIMProperties . data_dir , " pset " , context . scene . BIMProperties . pset_template_files + " .ifc "
)
2020-04-24 18:05:59 +10:00
ifc . IfcStore . pset_template_file = ifcopenshell . open ( ifc . IfcStore . pset_template_path )
2020-11-01 20:08:48 +07:00
templates = ifc . IfcStore . pset_template_file . by_type ( " IfcPropertySetTemplate " )
propertysettemplates_enum . extend ( [ ( t . GlobalId , t . Name , " " ) for t in templates ] )
2020-04-24 17:14:07 +10:00
return propertysettemplates_enum
2019-11-17 11:38:56 +11:00
def getClassifications ( self , context ) :
global classification_enum
if len ( classification_enum ) < 1 :
classification_enum . clear ( )
2020-11-01 20:08:48 +07:00
files = os . listdir ( os . path . join ( self . schema_dir , " classifications " ) )
classification_enum . extend ( [ ( f . replace ( " .ifc " , " " ) , f . replace ( " .ifc " , " " ) , " " ) for f in files ] )
2019-11-17 11:38:56 +11:00
return classification_enum
2019-12-04 17:49:28 +11:00
2019-11-17 11:38:56 +11:00
def refreshReferences ( self , context ) :
2020-04-23 16:05:06 +10:00
context . scene . BIMProperties . classification_references . root = None
ClassificationView . raw_data = schema . ifc . load_classification ( context . scene . BIMProperties . classification )
2020-11-01 20:08:48 +07:00
context . scene . BIMProperties . classification_references . root = " "
2019-11-17 11:38:56 +11:00
2019-12-04 17:49:28 +11:00
2020-04-24 20:54:24 +10:00
def getPsetNames ( self , context ) :
2021-01-07 19:09:55 +11:00
global psetnames
if " / " in context . active_object . name :
ifc_class = context . active_object . name . split ( " / " ) [ 0 ]
if ifc_class not in psetnames :
psets = schema . ifc . psetqto . get_applicable ( ifc_class , pset_only = True )
psetnames [ ifc_class ] = [ ( p . Name , p . Name , " " ) for p in psets ]
return psetnames [ ifc_class ]
return [ ]
2020-04-08 14:15:36 +10:00
2020-11-11 23:02:07 +11:00
def getMaterialPsetNames ( self , context ) :
global materialpsetnames_enum
materialpsetnames_enum . clear ( )
2020-12-31 11:39:33 +01:00
pset_names = schema . ifc . psetqto . get_applicable_names ( " IfcMaterial " , pset_only = True )
2020-11-11 23:02:07 +11:00
materialpsetnames_enum . extend ( [ ( p , p , " " ) for p in pset_names ] )
return materialpsetnames_enum
2020-04-08 14:15:36 +10:00
def getQtoNames ( self , context ) :
global qtonames_enum
qtonames_enum . clear ( )
2020-11-01 20:08:48 +07:00
if " / " in context . active_object . name and context . active_object . name . split ( " / " ) [ 0 ] in schema . ifc . elements :
2020-12-31 11:39:33 +01:00
qto_names = schema . ifc . psetqto . get_applicable_names ( context . active_object . name . split ( " / " ) [ 0 ] , qto_only = True )
2020-11-03 09:53:03 +11:00
qtonames_enum . extend ( [ ( q , q , " " ) for q in qto_names ] )
2020-04-08 14:15:36 +10:00
return qtonames_enum
2020-01-14 15:38:22 +11:00
def getApplicableMaterialAttributes ( self , context ) :
global materialattributes_enum
materialattributes_enum . clear ( )
2020-11-11 22:13:50 +11:00
if " / " in context . active_object . name :
ifc_schema = ifcopenshell . ifcopenshell_wrapper . schema_by_name ( bpy . context . scene . BIMProperties . export_schema )
entity = ifc_schema . declaration_by_name ( " IfcMaterial " )
2020-11-01 20:08:48 +07:00
materialattributes_enum . extend (
2020-11-13 15:50:37 +07:00
[ ( a . name ( ) , a . name ( ) , " " ) for a in entity . all_attributes ( ) if self . attributes . find ( a . name ( ) ) == - 1 ]
2020-11-01 20:08:48 +07:00
)
2020-01-14 15:38:22 +11:00
return materialattributes_enum
2020-01-14 17:38:54 +11:00
def refreshProfileAttributes ( self , context ) :
2020-11-15 21:05:24 +11:00
if not context . active_object :
return
2020-11-09 19:15:23 +11:00
props = context . active_object . BIMObjectProperties
profile = props . material_set . material_profiles [ props . material_set . active_material_profile_index ]
while len ( profile . profile_attributes ) > 0 :
profile . profile_attributes . remove ( 0 )
for attribute in schema . ifc . IfcParameterizedProfileDef [ profile . profile ] [ " attributes " ] :
profile_attribute = profile . profile_attributes . add ( )
2020-11-01 20:08:48 +07:00
profile_attribute . name = attribute [ " name " ]
2020-01-14 17:38:54 +11:00
2020-01-14 13:28:48 +11:00
def getMaterialTypes ( self , context ) :
global materialtypes_enum
materialtypes_enum . clear ( )
2020-11-01 20:08:48 +07:00
materialtypes_enum = [
2020-11-30 11:25:11 +11:00
( m , m , " " ) for m in [ " None " , " IfcMaterial " , " IfcMaterialConstituentSet " , " IfcMaterialLayerSet " , " IfcMaterialProfileSet " ]
2020-11-01 20:08:48 +07:00
]
2020-01-14 13:28:48 +11:00
return materialtypes_enum
2021-01-03 19:09:01 +11:00
def getContexts ( self , context ) :
from blenderbim . bim . module . context . data import Data
if not Data . is_loaded :
Data . load ( )
results = [ ]
for ifc_id , context in Data . contexts . items ( ) :
results . append ( ( str ( ifc_id ) , context [ " ContextType " ] , " " ) )
for ifc_id2 , subcontext in context [ " HasSubContexts " ] . items ( ) :
results . append ( ( str ( ifc_id2 ) , " {} / {} / {} " . format (
subcontext [ " ContextType " ] , subcontext [ " ContextIdentifier " ] , subcontext [ " TargetView " ] ) , " " ) )
return results
2019-12-04 17:49:28 +11:00
def getSubcontexts ( self , context ) :
global subcontexts_enum
subcontexts_enum . clear ( )
# TODO: allow override of generated subcontexts?
subcontexts = export_ifc . IfcExportSettings ( ) . subcontexts
for subcontext in subcontexts :
2020-11-01 20:08:48 +07:00
subcontexts_enum . append ( ( subcontext , subcontext , " " ) )
2019-12-04 17:49:28 +11:00
return subcontexts_enum
def getTargetViews ( self , context ) :
global target_views_enum
target_views_enum . clear ( )
for target_view in export_ifc . IfcExportSettings ( ) . target_views :
2020-11-01 20:08:48 +07:00
target_views_enum . append ( ( target_view , target_view , " " ) )
2019-12-04 17:49:28 +11:00
return target_views_enum
2020-08-13 20:38:50 +10:00
def getVectorStyles ( self , context ) :
global vector_styles_enum
if len ( vector_styles_enum ) < 1 :
sheets_enum . clear ( )
2020-11-01 20:08:48 +07:00
for filename in Path ( os . path . join ( context . scene . BIMProperties . data_dir , " styles " ) ) . glob ( " *.css " ) :
2020-08-13 20:38:50 +10:00
f = str ( filename . stem )
2020-11-01 20:08:48 +07:00
vector_styles_enum . append ( ( f , f , " " ) )
2020-08-13 20:38:50 +10:00
return vector_styles_enum
2020-05-03 19:54:27 +10:00
def refreshFontSize ( self , context ) :
annotation . Annotator . resize_text ( context . active_object )
2020-04-23 16:05:06 +10:00
class StrProperty ( PropertyGroup ) :
pass
2020-05-04 12:20:34 +10:00
class Variable ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
prop_key : StringProperty ( name = " Property Key " )
2020-11-09 19:15:23 +11:00
class Attribute ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
data_type : StringProperty ( name = " Data Type " )
string_value : StringProperty ( name = " Value " )
bool_value : BoolProperty ( name = " Value " )
int_value : IntProperty ( name = " Value " )
float_value : FloatProperty ( name = " Value " )
2021-01-05 13:16:31 +11:00
is_null : BoolProperty ( name = " Is Null " )
enum_items : StringProperty ( name = " Value " )
enum_value : EnumProperty ( items = getAttributeEnumValues , name = " Value " )
2020-11-09 19:15:23 +11:00
2020-11-04 21:28:47 +11:00
class MaterialLayer ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
material : PointerProperty ( name = " Material " , type = bpy . types . Material )
layer_thickness : FloatProperty ( name = " Layer Thickness " )
is_ventilated : EnumProperty (
items = [
( " TRUE " , " True " , " Is an air gap and provides air exchange from the layer to outside air " ) ,
( " FALSE " , " False " , " Is a solid material layer " ) ,
( " UNKNOWN " , " Unknown " , " Is an air gap but does not provide air exchange or not known " ) ,
] ,
name = " Is Ventilated " ,
default = " FALSE " ,
)
description : StringProperty ( name = " Description " )
category : EnumProperty (
items = [
2020-11-06 21:57:34 +11:00
( " None " , " None " , " " ) ,
2020-11-04 21:28:47 +11:00
( " LoadBearing " , " Load Bearing " , " " ) ,
( " Insulation " , " Insulation " , " " ) ,
( " Finish " , " Finish " , " " ) ,
( " Custom " , " Custom " , " " ) ,
] ,
name = " Category " ,
2020-11-20 19:49:04 +11:00
default = " None " ,
2020-11-04 21:28:47 +11:00
)
custom_category : StringProperty ( name = " Custom Category " )
priority : IntProperty ( name = " Priority " )
2020-11-05 22:41:43 +11:00
class MaterialConstituent ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
material : PointerProperty ( name = " Material " , type = bpy . types . Material )
fraction : FloatProperty ( name = " Fraction " )
category : StringProperty ( name = " Category " )
2020-11-09 19:15:23 +11:00
class MaterialProfile ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
material : PointerProperty ( name = " Material " , type = bpy . types . Material )
profile : EnumProperty ( items = getProfileDef , name = " Parameterized Profile Def " , update = refreshProfileAttributes )
profile_attributes : CollectionProperty ( name = " Profile Attributes " , type = Attribute )
priority : IntProperty ( name = " Priority " )
category : StringProperty ( name = " Category " )
2020-11-05 22:41:43 +11:00
class MaterialSet ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
active_material_layer_index : IntProperty ( name = " Active Material Layer Index " )
material_layers : CollectionProperty ( name = " Material Layers " , type = MaterialLayer )
active_material_constituent_index : IntProperty ( name = " Active Material Constituent Index " )
material_constituents : CollectionProperty ( name = " Material Constituents " , type = MaterialConstituent )
2020-11-09 19:15:23 +11:00
active_material_profile_index : IntProperty ( name = " Active Material Profile Index " )
material_profiles : CollectionProperty ( name = " Material Profiles " , type = MaterialProfile )
2020-11-05 22:41:43 +11:00
2020-08-13 20:17:51 +10:00
class Drawing ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " , update = updateDrawingName )
camera : PointerProperty ( name = " Camera " , type = bpy . types . Object )
2020-08-13 20:17:51 +10:00
2020-08-17 21:43:33 +10:00
class Schedule ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " )
file : StringProperty ( name = " File " )
2020-08-17 21:43:33 +10:00
2020-08-16 11:54:05 +10:00
class Sheet ( PropertyGroup ) :
def set_name ( self , new ) :
2020-11-01 20:08:48 +07:00
old = self . get ( " name " )
path = os . path . join ( bpy . context . scene . BIMProperties . data_dir , " sheets " )
if old and os . path . isfile ( os . path . join ( path , old + " .svg " ) ) :
os . rename ( os . path . join ( path , old + " .svg " ) , os . path . join ( path , new + " .svg " ) )
self [ " name " ] = new
2020-08-16 11:54:05 +10:00
def get_name ( self ) :
2020-11-01 20:08:48 +07:00
return self . get ( " name " )
2020-08-16 11:54:05 +10:00
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " , get = get_name , set = set_name )
drawings : CollectionProperty ( name = " Drawings " , type = Drawing )
active_drawing_index : IntProperty ( name = " Active Drawing Index " )
2020-08-16 11:54:05 +10:00
2020-08-12 21:50:57 +10:00
class DrawingStyle ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " )
raster_style : StringProperty ( name = " Raster Style " )
render_type : EnumProperty (
2020-11-02 11:26:31 +11:00
items = [ ( " NONE " , " None " , " " ) , ( " DEFAULT " , " Default " , " " ) , ( " VIEWPORT " , " Viewport " , " " ) , ] ,
2020-11-01 20:08:48 +07:00
name = " Render Type " ,
default = " VIEWPORT " ,
)
vector_style : EnumProperty ( items = getVectorStyles , name = " Vector Style " )
include_query : StringProperty ( name = " Include Query " )
exclude_query : StringProperty ( name = " Exclude Query " )
attributes : CollectionProperty ( name = " Attributes " , type = StrProperty )
2020-08-12 21:50:57 +10:00
2019-12-10 18:54:26 +11:00
class DocProperties ( PropertyGroup ) :
2019-12-12 18:16:02 +11:00
should_recut : BoolProperty ( name = " Should Recut " , default = True )
2020-07-10 21:22:02 +10:00
should_recut_selected : BoolProperty ( name = " Should Recut Selected Only " , default = False )
2020-05-04 12:20:34 +10:00
should_extract : BoolProperty ( name = " Should Extract " , default = True )
2020-11-01 20:08:48 +07:00
drawings : CollectionProperty ( name = " Drawings " , type = Drawing )
active_drawing_index : IntProperty ( name = " Active Drawing Index " , update = refreshActiveDrawingIndex )
current_drawing_index : IntProperty ( name = " Current Drawing Index " )
schedules : CollectionProperty ( name = " Schedules " , type = Schedule )
active_schedule_index : IntProperty ( name = " Active Schedule Index " )
2020-08-28 23:16:25 +10:00
titleblock : EnumProperty ( items = getTitleblocks , name = " Titleblock " , update = refreshTitleblocks )
2020-11-01 20:08:48 +07:00
sheets : CollectionProperty ( name = " Sheets " , type = Sheet )
active_sheet_index : IntProperty ( name = " Active Sheet Index " )
ifc_files : CollectionProperty ( name = " IFCs " , type = StrProperty )
drawing_styles : CollectionProperty ( name = " Drawing Styles " , type = DrawingStyle )
2020-12-11 11:13:48 +11:00
should_draw_decorations : BoolProperty ( name = " Should Draw Decorations " , update = toggleDecorations )
2020-12-24 21:04:44 +07:00
decorations_colour : FloatVectorProperty ( name = " Decorations Colour " , subtype = " COLOR " , default = ( 1 , 0 , 0 , 1 ) ,
2021-01-06 03:52:40 +07:00
min = 0.0 , max = 1.0 , size = 4 )
2019-12-10 18:54:26 +11:00
2020-01-06 11:46:42 +11:00
class BIMCameraProperties ( PropertyGroup ) :
view_name : StringProperty ( name = " View Name " )
2020-11-01 20:08:48 +07:00
target_view : EnumProperty (
items = [
( " PLAN_VIEW " , " PLAN_VIEW " , " " ) ,
( " ELEVATION_VIEW " , " ELEVATION_VIEW " , " " ) ,
( " SECTION_VIEW " , " SECTION_VIEW " , " " ) ,
( " REFLECTED_PLAN_VIEW " , " REFLECTED_PLAN_VIEW " , " " ) ,
( " MODEL_VIEW " , " MODEL_VIEW " , " " ) ,
] ,
name = " Target View " ,
default = " PLAN_VIEW " ,
)
diagram_scale : EnumProperty ( items = getDiagramScales , name = " Drawing Scale " )
custom_diagram_scale : StringProperty ( name = " Custom Scale " )
raster_x : IntProperty ( name = " Raster X " , default = 1000 )
raster_y : IntProperty ( name = " Raster Y " , default = 1000 )
is_nts : BoolProperty ( name = " Is NTS " )
cut_objects : EnumProperty (
items = [
(
" .IfcWall|.IfcSlab|.IfcCurtainWall|.IfcStair|.IfcStairFlight|.IfcColumn|.IfcBeam|.IfcMember|.IfcCovering|.IfcSpace " ,
" Overall Plan / Section " ,
" " ,
) ,
( " .IfcElement " , " Detail Drawing " , " " ) ,
( " CUSTOM " , " Custom " , " " ) ,
] ,
name = " Cut Objects " ,
)
cut_objects_custom : StringProperty ( name = " Custom Cut " )
active_drawing_style_index : IntProperty ( name = " Active Drawing Style Index " )
2020-01-06 11:46:42 +11:00
2020-05-03 19:54:27 +10:00
class BIMTextProperties ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
font_size : EnumProperty (
items = [
( " 1.8 " , " 1.8 - Small " , " " ) ,
( " 2.5 " , " 2.5 - Regular " , " " ) ,
( " 3.5 " , " 3.5 - Large " , " " ) ,
( " 5.0 " , " 5.0 - Header " , " " ) ,
( " 7.0 " , " 7.0 - Title " , " " ) ,
] ,
update = refreshFontSize ,
name = " Font Size " ,
)
symbol : EnumProperty (
2020-11-02 11:26:31 +11:00
items = [ ( " None " , " None " , " " ) , ( " rectangle-tag " , " Rectangle Tag " , " " ) , ( " door-tag " , " Door Tag " , " " ) , ] ,
2020-11-01 20:08:48 +07:00
update = refreshFontSize ,
name = " Symbol " ,
)
related_element : PointerProperty ( name = " Related Element " , type = bpy . types . Object )
variables : CollectionProperty ( name = " Variables " , type = Variable )
2020-05-03 19:54:27 +10:00
2020-05-01 12:56:57 +10:00
class DocumentInformation ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Identification " )
human_name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
location : StringProperty ( name = " Location " )
purpose : StringProperty ( name = " Purpose " )
intended_use : StringProperty ( name = " Intended Use " )
scope : StringProperty ( name = " Scope " )
revision : StringProperty ( name = " Revision " )
document_owner : StringProperty ( name = " Owner " )
editors : StringProperty ( name = " Editors " )
creation_time : StringProperty ( name = " Created On " )
last_revision_time : StringProperty ( name = " Last Revised " )
electronic_format : StringProperty ( name = " Format " )
valid_from : StringProperty ( name = " Valid From " )
valid_until : StringProperty ( name = " Valid Until " )
confidentiality : EnumProperty (
items = [
( " NOTDEFINED " , " NOTDEFINED " , " Not defined. " ) ,
( " PUBLIC " , " PUBLIC " , " Document is publicly available. " ) ,
( " RESTRICTED " , " RESTRICTED " , " Document availability is restricted. " ) ,
(
" CONFIDENTIAL " ,
" CONFIDENTIAL " ,
" Document is confidential and its contents should not be revealed without permission. " ,
) ,
( " PERSONAL " , " PERSONAL " , " Document is personal to the author. " ) ,
( " USERDEFINED " , " USERDEFINED " , " Describe confidentiality elsewhere. " ) ,
] ,
name = " Confidentiality " ,
)
status : EnumProperty (
items = [
( " NOTDEFINED " , " NOTDEFINED " , " Not defined " ) ,
( " DRAFT " , " DRAFT " , " Document is a draft. " ) ,
( " FINALDRAFT " , " FINALDRAFT " , " Document is a final draft. " ) ,
( " FINAL " , " FINAL " , " Document is final. " ) ,
( " REVISION " , " REVISION " , " Document has undergone revision. " ) ,
] ,
name = " Status " ,
)
2020-05-01 12:56:57 +10:00
2020-05-01 17:24:59 +10:00
class DocumentReference ( PropertyGroup ) :
location : StringProperty ( name = " Location " )
name : StringProperty ( name = " Identification " )
human_name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
2020-05-01 19:13:54 +10:00
referenced_document : StringProperty ( name = " Referenced Document " )
2020-05-01 17:24:59 +10:00
2020-05-19 15:08:54 +10:00
class ClashSource ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " File " )
selector : StringProperty ( name = " Selector " )
mode : EnumProperty (
items = [
( " i " , " Include " , " Only the selected objects are included for clashing " ) ,
( " e " , " Exclude " , " All objects except the selected objects are included for clashing " ) ,
] ,
name = " Mode " ,
)
2020-05-19 15:08:54 +10:00
class ClashSet ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " )
tolerance : FloatProperty ( name = " Tolerance " )
a : CollectionProperty ( name = " Group A " , type = ClashSource )
b : CollectionProperty ( name = " Group B " , type = ClashSource )
2020-05-19 15:08:54 +10:00
2020-11-02 15:14:33 +01:00
class PresentationLayer ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
identifier : StringProperty ( name = " Identifier " )
layer_on : BoolProperty ( name = " LayerOn " , default = True )
2020-11-08 13:52:20 +01:00
layer_frozen : BoolProperty ( name = " LayerFrozen " , default = False )
layer_blocked : BoolProperty ( name = " LayerBlocked " , default = False )
2020-05-19 15:08:54 +10:00
2020-11-10 21:01:51 -05:00
class SmartClashGroup ( PropertyGroup ) :
2020-12-11 20:46:07 -05:00
number : StringProperty ( name = " Number " )
2020-11-10 21:01:51 -05:00
global_ids : CollectionProperty ( name = " GlobalIDs " , type = StrProperty )
2020-05-19 15:08:54 +10:00
2020-07-06 17:26:38 +10:00
class Constraint ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
constraint_grade : EnumProperty (
items = [
(
" HARD " ,
" HARD " ,
" Qualifies a constraint such that it must be followed rigidly within or at the values set. " ,
) ,
( " SOFT " , " SOFT " , " Qualifies a constraint such that it should be followed within or at the values set. " ) ,
(
" ADVISORY " ,
" ADVISORY " ,
" Qualifies a constraint such that it is advised that it is followed within or at the values set. " ,
) ,
(
" USERDEFINED " ,
" USERDEFINED " ,
" A user-defined grade indicated by a separate attribute at the referencing entity. " ,
) ,
( " NOTDEFINED " , " NOTDEFINED " , " Grade has not been specified. " ) ,
] ,
name = " Grade " ,
)
constraint_source : StringProperty ( name = " Source " )
user_defined_grade : StringProperty ( name = " Custom Grade " )
objective_qualifier : EnumProperty (
items = [
(
" CODECOMPLIANCE " ,
" CODECOMPLIANCE " ,
" A constraint whose objective is to ensure satisfaction of a code compliance provision. " ,
) ,
(
" CODEWAIVER " ,
" CODEWAIVER " ,
" A constraint whose objective is to identify an agreement that code compliance requirements (the waiver) will not be enforced. " ,
) ,
(
" DESIGNINTENT " ,
" DESIGNINTENT " ,
" A constraint whose objective is to ensure satisfaction of a design intent provision. " ,
) ,
(
" EXTERNAL " ,
" EXTERNAL " ,
" A constraint whose objective is to synchronize data with an external source such as a file " ,
) ,
(
" HEALTHANDSAFETY " ,
" HEALTHANDSAFETY " ,
" A constraint whose objective is to ensure satisfaction of a health and safety provision. " ,
) ,
(
" MERGECONFLICT " ,
" MERGECONFLICT " ,
" A constraint whose objective is to resolve a conflict such as merging data from multiple sources. " ,
) ,
(
" MODELVIEW " ,
" MODELVIEW " ,
" A constraint whose objective is to ensure data conforms to a model view definition. " ,
) ,
(
" PARAMETER " ,
" PARAMETER " ,
" A constraint whose objective is to calculate a value based on other referenced values. " ,
) ,
(
" REQUIREMENT " ,
" REQUIREMENT " ,
" A constraint whose objective is to ensure satisfaction of a project requirement provision. " ,
) ,
(
" SPECIFICATION " ,
" SPECIFICATION " ,
" A constraint whose objective is to ensure satisfaction of a specification provision. " ,
) ,
(
" TRIGGERCONDITION " ,
" TRIGGERCONDITION " ,
" A constraint whose objective is to indicate a limiting value beyond which the condition of an object requires a particular form of attention. " ,
) ,
( " USERDEFINED " , " USERDEFINED " , " " ) ,
( " NOTDEFINED " , " NOTDEFINED " , " " ) ,
] ,
name = " Qualifier " ,
)
user_defined_qualifier : StringProperty ( name = " Custom Qualifier " )
2020-07-06 17:26:38 +10:00
2020-04-24 17:14:07 +10:00
class PropertySetTemplate ( PropertyGroup ) :
global_id : StringProperty ( name = " Global ID " )
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
2020-11-01 20:08:48 +07:00
template_type : EnumProperty (
items = [
(
" PSET_TYPEDRIVENONLY " ,
" Pset - IfcTypeObject " ,
" The property sets defined by this IfcPropertySetTemplate can only be assigned to subtypes of IfcTypeObject. " ,
) ,
(
" PSET_TYPEDRIVENOVERRIDE " ,
" Pset - IfcTypeObject - Override " ,
" The property sets defined by this IfcPropertySetTemplate can only be assigned to subtypes of IfcTypeObject. " ,
) ,
(
" PSET_OCCURRENCEDRIVEN " ,
" Pset - IfcObject " ,
" The property sets defined by this IfcPropertySetTemplate can only be assigned to subtypes of IfcObject. " ,
) ,
(
" PSET_PERFORMANCEDRIVEN " ,
" Pset - IfcPerformanceHistory " ,
" The property sets defined by this IfcPropertySetTemplate can only be assigned to IfcPerformanceHistory. " ,
) ,
(
" QTO_TYPEDRIVENONLY " ,
" Qto - IfcTypeObject " ,
" The element quantity defined by this IfcPropertySetTemplate can only be assigned to subtypes of IfcTypeObject. " ,
) ,
(
" QTO_TYPEDRIVENOVERRIDE " ,
" Qto - IfcTypeObject - Override " ,
" The element quantity defined by this IfcPropertySetTemplate can be assigned to subtypes of IfcTypeObject and can be overridden by an element quantity with same name at subtypes of IfcObject. " ,
) ,
(
" QTO_OCCURRENCEDRIVEN " ,
" Qto - IfcObject " ,
" The element quantity defined by this IfcPropertySetTemplate can only be assigned to subtypes of IfcObject. " ,
) ,
(
" NOTDEFINED " ,
" Not defined " ,
" No restriction provided, the property sets defined by this IfcPropertySetTemplate can be assigned to any entity, if not otherwise restricted by the ApplicableEntity attribute. " ,
) ,
] ,
name = " Template Type " ,
)
2020-04-24 17:14:07 +10:00
applicable_entity : StringProperty ( name = " Applicable Entity " )
class PropertyTemplate ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
global_id : StringProperty ( name = " Global ID " )
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
primary_measure_type : EnumProperty (
items = [
( x , x , " " )
for x in [
" IfcInteger " ,
" IfcReal " ,
" IfcBoolean " ,
" IfcIdentifier " ,
" IfcText " ,
" IfcLabel " ,
" IfcLogical " ,
" IfcDateTime " ,
" IfcDate " ,
" IfcTime " ,
" IfcDuration " ,
" IfcTimeStamp " ,
" IfcPositiveInteger " ,
" IfcBinary " ,
" IfcVolumeMeasure " ,
" IfcTimeMeasure " ,
" IfcThermodynamicTemperatureMeasure " ,
" IfcSolidAngleMeasure " ,
" IfcPositiveRatioMeasure " ,
" IfcRatioMeasure " ,
" IfcPositivePlaneAngleMeasure " ,
" IfcPlaneAngleMeasure " ,
" IfcParameterValue " ,
" IfcNumericMeasure " ,
" IfcMassMeasure " ,
" IfcPositiveLengthMeasure " ,
" IfcLengthMeasure " ,
" IfcElectricCurrentMeasure " ,
" IfcDescriptiveMeasure " ,
" IfcCountMeasure " ,
" IfcContextDependentMeasure " ,
" IfcAreaMeasure " ,
" IfcAmountOfSubstanceMeasure " ,
" IfcLuminousIntensityMeasure " ,
" IfcNormalisedRatioMeasure " ,
" IfcComplexNumber " ,
" IfcNonNegativeLengthMeasure " ,
" IfcAbsorbedDoseMeasure " ,
" IfcAccelerationMeasure " ,
" IfcAngularVelocityMeasure " ,
" IfcAreaDensityMeasure " ,
" IfcCompoundPlaneAngleMeasure " ,
" IfcCurvatureMeasure " ,
" IfcDoseEquivalentMeasure " ,
" IfcDynamicViscosityMeasure " ,
" IfcElectricCapacitanceMeasure " ,
" IfcElectricChargeMeasure " ,
" IfcElectricConductanceMeasure " ,
" IfcElectricResistanceMeasure " ,
" IfcElectricVoltageMeasure " ,
" IfcEnergyMeasure " ,
" IfcForceMeasure " ,
" IfcFrequencyMeasure " ,
" IfcHeatFluxDensityMeasure " ,
" IfcHeatingValueMeasure " ,
" IfcIlluminanceMeasure " ,
" IfcInductanceMeasure " ,
" IfcIntegerCountRateMeasure " ,
" IfcIonConcentrationMeasure " ,
" IfcIsothermalMoistureCapacityMeasure " ,
" IfcKinematicViscosityMeasure " ,
" IfcLinearForceMeasure " ,
" IfcLinearMomentMeasure " ,
" IfcLinearStiffnessMeasure " ,
" IfcLinearVelocityMeasure " ,
" IfcLuminousFluxMeasure " ,
" IfcLuminousIntensityDistributionMeasure " ,
" IfcMagneticFluxDensityMeasure " ,
" IfcMagneticFluxMeasure " ,
" IfcMassDensityMeasure " ,
" IfcMassFlowRateMeasure " ,
" IfcMassPerLengthMeasure " ,
" IfcModulusOfElasticityMeasure " ,
" IfcModulusOfLinearSubgradeReactionMeasure " ,
" IfcModulusOfRotationalSubgradeReactionMeasure " ,
" IfcModulusOfSubgradeReactionMeasure " ,
" IfcMoistureDiffusivityMeasure " ,
" IfcMolecularWeightMeasure " ,
" IfcMomentOfInertiaMeasure " ,
" IfcMonetaryMeasure " ,
" IfcPHMeasure " ,
" IfcPlanarForceMeasure " ,
" IfcPowerMeasure " ,
" IfcPressureMeasure " ,
" IfcRadioActivityMeasure " ,
" IfcRotationalFrequencyMeasure " ,
" IfcRotationalMassMeasure " ,
" IfcRotationalStiffnessMeasure " ,
" IfcSectionModulusMeasure " ,
" IfcSectionalAreaIntegralMeasure " ,
" IfcShearModulusMeasure " ,
" IfcSoundPowerLevelMeasure " ,
" IfcSoundPowerMeasure " ,
" IfcSoundPressureLevelMeasure " ,
" IfcSoundPressureMeasure " ,
" IfcSpecificHeatCapacityMeasure " ,
" IfcTemperatureGradientMeasure " ,
" IfcTemperatureRateOfChangeMeasure " ,
" IfcThermalAdmittanceMeasure " ,
" IfcThermalConductivityMeasure " ,
" IfcThermalExpansionCoefficientMeasure " ,
" IfcThermalResistanceMeasure " ,
" IfcThermalTransmittanceMeasure " ,
" IfcTorqueMeasure " ,
" IfcVaporPermeabilityMeasure " ,
" IfcVolumetricFlowRateMeasure " ,
" IfcWarpingConstantMeasure " ,
" IfcWarpingMomentMeasure " ,
2020-04-24 17:14:07 +10:00
]
2020-11-01 20:08:48 +07:00
] ,
name = " Primary Measure Type " ,
)
2020-04-24 17:14:07 +10:00
2020-07-09 20:46:50 +10:00
class Address ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : StringProperty ( name = " Name " , default = " IfcPostalAddress " ) # Stores IfcPostalAddress or IfcTelecomAddress
purpose : EnumProperty (
items = [
( " OFFICE " , " OFFICE " , " An office address. " ) ,
( " SITE " , " SITE " , " A site address. " ) ,
( " HOME " , " HOME " , " A home address. " ) ,
( " DISTRIBUTIONPOINT " , " DISTRIBUTIONPOINT " , " A postal distribution point address. " ) ,
( " USERDEFINED " , " USERDEFINED " , " A user defined address type to be provided. " ) ,
] ,
name = " Purpose " ,
)
2020-07-09 20:46:50 +10:00
description : StringProperty ( name = " Description " )
user_defined_purpose : StringProperty ( name = " Custom Purpose " )
internal_location : StringProperty ( name = " Internal Location " )
address_lines : StringProperty ( name = " Address " )
2020-07-13 15:29:06 +10:00
postal_box : StringProperty ( name = " Postal Box " )
2020-07-09 20:46:50 +10:00
town : StringProperty ( name = " Town " )
region : StringProperty ( name = " Region " )
postal_code : StringProperty ( name = " Postal Code " )
country : StringProperty ( name = " Country " )
telephone_numbers : StringProperty ( name = " Telephone Numbers " )
fascimile_numbers : StringProperty ( name = " Fascimile Numbers " )
pager_number : StringProperty ( name = " Pager Number " )
electronic_mail_addresses : StringProperty ( name = " Emails " )
www_home_page_url : StringProperty ( name = " Websites " )
messaging_ids : StringProperty ( name = " IMs " )
2020-07-13 15:29:06 +10:00
class Role ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : EnumProperty (
items = [
( " SUPPLIER " , " SUPPLIER " , " " ) ,
( " MANUFACTURER " , " MANUFACTURER " , " " ) ,
( " CONTRACTOR " , " CONTRACTOR " , " " ) ,
( " SUBCONTRACTOR " , " SUBCONTRACTOR " , " " ) ,
( " ARCHITECT " , " ARCHITECT " , " " ) ,
( " STRUCTURALENGINEER " , " STRUCTURALENGINEER " , " " ) ,
( " COSTENGINEER " , " COSTENGINEER " , " " ) ,
( " CLIENT " , " CLIENT " , " " ) ,
( " BUILDINGOWNER " , " BUILDINGOWNER " , " " ) ,
( " BUILDINGOPERATOR " , " BUILDINGOPERATOR " , " " ) ,
( " MECHANICALENGINEER " , " MECHANICALENGINEER " , " " ) ,
( " ELECTRICALENGINEER " , " ELECTRICALENGINEER " , " " ) ,
( " PROJECTMANAGER " , " PROJECTMANAGER " , " " ) ,
( " FACILITIESMANAGER " , " FACILITIESMANAGER " , " " ) ,
( " CIVILENGINEER " , " CIVILENGINEER " , " " ) ,
( " COMMISSIONINGENGINEER " , " COMMISSIONINGENGINEER " , " " ) ,
( " ENGINEER " , " ENGINEER " , " " ) ,
( " OWNER " , " OWNER " , " " ) ,
( " CONSULTANT " , " CONSULTANT " , " " ) ,
( " CONSTRUCTIONMANAGER " , " CONSTRUCTIONMANAGER " , " " ) ,
( " FIELDCONSTRUCTIONMANAGER " , " FIELDCONSTRUCTIONMANAGER " , " " ) ,
( " RESELLER " , " RESELLER " , " " ) ,
( " USERDEFINED " , " USERDEFINED " , " " ) ,
] ,
name = " Name " ,
)
2020-07-13 15:29:06 +10:00
user_defined_role : StringProperty ( name = " Custom Role " )
description : StringProperty ( name = " Description " )
2020-07-09 20:46:50 +10:00
class Organisation ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
2020-07-13 15:29:06 +10:00
roles : CollectionProperty ( name = " Roles " , type = Role )
active_role_index : bpy . props . IntProperty ( )
2020-07-09 20:46:50 +10:00
addresses : CollectionProperty ( name = " Addresses " , type = Address )
active_address_index : bpy . props . IntProperty ( )
class Person ( PropertyGroup ) :
name : StringProperty ( name = " Identification " )
family_name : StringProperty ( name = " Family Name " )
given_name : StringProperty ( name = " Given Name " )
middle_names : StringProperty ( name = " Middle Names " )
prefix_titles : StringProperty ( name = " Prefixes " )
suffix_titles : StringProperty ( name = " Suffixes " )
2020-07-13 15:29:06 +10:00
roles : CollectionProperty ( name = " Roles " , type = Role )
active_role_index : bpy . props . IntProperty ( )
2020-07-09 20:46:50 +10:00
addresses : CollectionProperty ( name = " Addresses " , type = Address )
active_address_index : bpy . props . IntProperty ( )
2020-04-23 16:05:06 +10:00
class Classification ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
source : StringProperty ( name = " Source " )
edition : StringProperty ( name = " Edition " )
edition_date : StringProperty ( name = " Edition Date " )
description : StringProperty ( name = " Description " )
location : StringProperty ( name = " Location " )
reference_tokens : StringProperty ( name = " Reference Tokens " )
2020-10-24 21:35:01 +11:00
data : StringProperty ( name = " Data " )
2020-04-23 16:05:06 +10:00
class ClassificationReference ( PropertyGroup ) :
name : StringProperty ( name = " Identification " )
location : StringProperty ( name = " Location " )
human_name : StringProperty ( name = " Name " )
referenced_source : StringProperty ( name = " Source " )
description : StringProperty ( name = " Description " )
sort : StringProperty ( name = " Sort " )
class ClassificationView ( PropertyGroup ) :
crumbs : None
children : None
active_index : bpy . props . IntProperty ( )
raw_data = { }
@property
def root ( self ) :
data = self . raw_data
for crumb in self . crumbs :
2020-11-01 20:08:48 +07:00
data = data [ " children " ] . get ( crumb . name )
2020-04-23 16:05:06 +10:00
if not data :
2020-11-01 20:08:48 +07:00
raise TypeError ( " Cannot resolve crumb path " )
2020-04-23 16:05:06 +10:00
return data
@root.setter
def root ( self , rt ) :
if rt == None :
self . crumbs . clear ( )
self . children . clear ( )
2020-11-01 20:08:48 +07:00
elif rt == " " :
2020-04-23 16:05:06 +10:00
if self . crumbs :
2020-11-01 20:08:48 +07:00
self . crumbs . remove ( len ( self . crumbs ) - 1 )
2020-04-23 16:05:06 +10:00
self . children . clear ( )
2020-11-01 20:08:48 +07:00
for child in self . root [ " children " ] . keys ( ) :
2020-04-23 16:05:06 +10:00
self . children . add ( ) . name = child
else :
data = self . root
2020-11-01 20:08:48 +07:00
if rt in data [ " children " ] . keys ( ) :
2020-04-23 16:05:06 +10:00
self . crumbs . add ( ) . name = rt
self . children . clear ( )
2020-11-01 20:08:48 +07:00
for child in data [ " children " ] [ rt ] [ " children " ] . keys ( ) :
2020-04-23 16:05:06 +10:00
self . children . add ( ) . name = child
def draw_stub ( self , context , layout ) :
if not self . children :
2020-11-01 20:08:48 +07:00
op = layout . operator ( " bim.change_classification_level " , text = " @Toplevel " )
2020-04-23 16:05:06 +10:00
else :
2020-11-01 20:08:48 +07:00
op = layout . operator ( " bim.change_classification_level " , text = self . root [ " name " ] )
op . path_sid = " %r " % self . id_data
2020-04-23 16:05:06 +10:00
op . path_lst = self . path_from_id ( )
2020-11-01 20:08:48 +07:00
op . path_itm = " "
layout . template_list ( " BIM_UL_classifications " , self . path_from_id ( ) , self , " children " , self , " active_index " )
2020-04-23 16:05:06 +10:00
# Monkey-patched, just to keep registration in one block
2020-11-01 20:08:48 +07:00
ClassificationView . __annotations__ [ " crumbs " ] = bpy . props . CollectionProperty ( type = StrProperty )
ClassificationView . __annotations__ [ " children " ] = bpy . props . CollectionProperty ( type = StrProperty )
2020-04-23 16:05:06 +10:00
2019-11-17 11:38:56 +11:00
class BIMProperties ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
schema_dir : StringProperty ( default = os . path . join ( cwd , " schema " ) + os . path . sep , name = " Schema Directory " )
data_dir : StringProperty ( default = os . path . join ( cwd , " data " ) + os . path . sep , name = " Data Directory " )
2020-01-29 11:42:43 +11:00
ifc_file : StringProperty ( name = " IFC File " )
2020-04-28 14:52:04 +10:00
ifc_cache : StringProperty ( name = " IFC Cache " )
2019-11-26 21:05:05 +11:00
audit_ifc_class : EnumProperty ( items = getIfcClasses , name = " Audit Class " )
2020-01-13 17:35:56 +11:00
ifc_product : EnumProperty ( items = getIfcProducts , name = " Products " , update = refreshClasses )
2019-11-17 11:38:56 +11:00
ifc_class : EnumProperty ( items = getIfcClasses , name = " Class " , update = refreshPredefinedTypes )
2020-11-01 20:08:48 +07:00
ifc_predefined_type : EnumProperty ( items = getIfcPredefinedTypes , name = " Predefined Type " , default = None )
2019-11-17 11:38:56 +11:00
ifc_userdefined_type : StringProperty ( name = " Userdefined Type " )
2020-11-01 20:08:48 +07:00
export_schema : EnumProperty ( items = [ ( " IFC4 " , " IFC4 " , " " ) , ( " IFC2X3 " , " IFC2X3 " , " " ) ] , name = " IFC Schema " )
export_json_version : EnumProperty ( items = [ ( " 4 " , " 4 " , " " ) , ( " 5a " , " 5a " , " " ) ] , name = " IFC JSON Version " )
2020-08-09 18:10:30 +10:00
export_json_compact : BoolProperty ( name = " Export Compact IFCJSON " , default = False )
2019-11-17 11:38:56 +11:00
export_has_representations : BoolProperty ( name = " Export Representations " , default = True )
2020-07-18 14:22:18 +10:00
export_should_guess_quantities : BoolProperty ( name = " Export with Guessed Quantities " , default = False )
2020-11-01 20:08:48 +07:00
export_should_use_presentation_style_assignment : BoolProperty (
name = " Export with Presentation Style Assignment " , default = False
)
2020-08-21 18:14:46 +10:00
export_should_force_faceted_brep : BoolProperty ( name = " Export with Faceted Breps " , default = False )
2020-11-05 22:01:53 +11:00
export_should_force_triangulation : BoolProperty ( name = " Export with Triangulation " , default = False )
2021-01-07 10:47:50 +11:00
export_should_export_from_memory : BoolProperty ( name = " Export from Memory " , default = True )
2019-11-17 11:38:56 +11:00
import_should_ignore_site_coordinates : BoolProperty ( name = " Import Ignoring Site Coordinates " , default = False )
2020-01-22 21:43:18 +11:00
import_should_ignore_building_coordinates : BoolProperty ( name = " Import Ignoring Building Coordinates " , default = False )
2020-01-24 10:19:44 +11:00
import_should_reset_absolute_coordinates : BoolProperty ( name = " Import Resetting Absolute Coordinates " , default = False )
2020-11-10 22:43:05 +11:00
import_should_guess_georeferencing : BoolProperty ( name = " Import Guessing Georeferencing " , default = False )
2020-06-12 21:46:28 +10:00
import_should_import_type_representations : BoolProperty ( name = " Import Type Representations " , default = False )
2020-06-11 10:52:00 +10:00
import_should_import_curves : BoolProperty ( name = " Import Curves " , default = False )
2020-01-31 12:52:44 +11:00
import_should_import_opening_elements : BoolProperty ( name = " Import Opening Elements " , default = False )
2020-02-21 11:43:48 +11:00
import_should_import_spaces : BoolProperty ( name = " Import Spaces " , default = False )
2020-01-09 15:30:43 +11:00
import_should_auto_set_workarounds : BoolProperty ( name = " Automatically Set Vendor Workarounds " , default = True )
2019-12-31 16:32:20 +11:00
import_should_use_legacy : BoolProperty ( name = " Import with Legacy Importer " , default = False )
2020-06-07 22:53:33 +10:00
import_should_import_native : BoolProperty ( name = " Import Native Representations " , default = False )
2021-01-07 10:47:50 +11:00
import_export_should_roundtrip_native : BoolProperty ( name = " Roundtrip Native Representations " , default = True )
2020-08-30 21:41:46 +10:00
import_should_use_cpu_multiprocessing : BoolProperty ( name = " Import with CPU Multiprocessing " , default = True )
2020-07-13 16:15:23 +10:00
import_should_import_with_profiling : BoolProperty ( name = " Import with Profiling " , default = True )
2020-03-11 15:44:00 +11:00
import_should_import_aggregates : BoolProperty ( name = " Import Aggregates " , default = True )
2020-04-29 09:20:30 +10:00
import_should_merge_aggregates : BoolProperty ( name = " Import and Merge Aggregates " , default = False )
2020-03-10 09:56:34 +11:00
import_should_merge_by_class : BoolProperty ( name = " Import and Merge by Class " , default = False )
2020-03-11 15:27:03 +11:00
import_should_merge_by_material : BoolProperty ( name = " Import and Merge by Material " , default = False )
2020-04-26 22:06:27 +10:00
import_should_merge_materials_by_colour : BoolProperty ( name = " Import and Merge Materials by Colour " , default = False )
2020-03-18 17:49:08 +11:00
import_should_clean_mesh : BoolProperty ( name = " Import and Clean Mesh " , default = True )
2020-09-15 15:59:52 +10:00
import_deflection_tolerance : FloatProperty ( name = " Import Deflection Tolerance " , default = 0.001 )
import_angular_tolerance : FloatProperty ( name = " Import Angular Tolerance " , default = 0.5 )
2020-10-26 14:06:06 +11:00
import_should_allow_non_element_aggregates : BoolProperty ( name = " Import Non-Element Aggregates " , default = False )
2020-10-26 13:36:18 +11:00
import_should_offset_model : BoolProperty ( name = " Import and Offset Model " , default = False )
2020-11-01 20:08:48 +07:00
import_model_offset_coordinates : StringProperty ( name = " Model Offset Coordinates " , default = " 0,0,0 " )
2019-11-17 11:38:56 +11:00
qa_reject_element_reason : StringProperty ( name = " Element Rejection Reason " )
2021-01-08 16:27:19 +11:00
person : PointerProperty ( type = Person )
2020-01-03 15:53:57 +11:00
organisation : EnumProperty ( items = getOrganisations , name = " Organisation " )
2020-07-09 20:46:50 +10:00
people : CollectionProperty ( name = " People " , type = Person )
organisations : CollectionProperty ( name = " Organisations " , type = Organisation )
2021-01-08 16:27:19 +11:00
active_person_id : IntProperty ( name = " Active Person Id " )
2020-11-01 20:08:48 +07:00
active_organisation_index : IntProperty ( name = " Active Organisation Index " )
2019-11-17 11:38:56 +11:00
has_georeferencing : BoolProperty ( name = " Has Georeferencing " , default = False )
2019-11-21 07:09:08 +11:00
has_library : BoolProperty ( name = " Has Project Library " , default = False )
2020-02-19 17:24:01 +11:00
search_regex : BoolProperty ( name = " Search With Regex " , default = False )
search_ignorecase : BoolProperty ( name = " Search Ignoring Case " , default = True )
2019-11-17 11:38:56 +11:00
global_id : StringProperty ( name = " GlobalId " )
2020-02-19 17:24:01 +11:00
search_attribute_name : StringProperty ( name = " Search Attribute Name " )
search_attribute_value : StringProperty ( name = " Search Attribute Value " )
2020-02-21 09:41:35 +11:00
search_pset_name : StringProperty ( name = " Search Pset Name " )
search_prop_name : StringProperty ( name = " Search Prop Name " )
2020-02-20 17:31:38 +11:00
search_pset_value : StringProperty ( name = " Search Pset Value " )
2020-11-01 20:08:48 +07:00
features_dir : StringProperty ( default = " " , name = " Features Directory " , update = refreshFeaturesFiles )
2020-01-28 18:10:33 +11:00
features_file : EnumProperty ( items = getFeaturesFiles , name = " Features File " , update = refreshScenarios )
scenario : EnumProperty ( items = getScenarios , name = " Scenario " )
2020-11-01 20:08:48 +07:00
cobie_ifc_file : StringProperty ( default = " " , name = " COBie IFC File " )
cobie_types : StringProperty ( default = " .COBieType " , name = " COBie Types " )
cobie_components : StringProperty ( default = " .COBie " , name = " COBie Components " )
cobie_json_file : StringProperty ( default = " " , name = " COBie JSON File " )
diff_json_file : StringProperty ( default = " " , name = " Diff JSON File " )
diff_old_file : StringProperty ( default = " " , name = " Diff Old IFC File " )
diff_new_file : StringProperty ( default = " " , name = " Diff New IFC File " )
diff_relationships : StringProperty ( default = " " , name = " Diff Relationships " )
2019-11-17 11:38:56 +11:00
aggregate_class : EnumProperty ( items = getIfcClasses , name = " Aggregate Class " )
aggregate_name : StringProperty ( name = " Aggregate Name " )
classification : EnumProperty ( items = getClassifications , name = " Classification " , update = refreshReferences )
2020-10-24 21:35:01 +11:00
active_classification_name : StringProperty ( name = " Active Classification Name " )
2020-04-23 16:05:06 +10:00
classifications : CollectionProperty ( name = " Classifications " , type = Classification )
2021-01-03 19:09:01 +11:00
contexts : EnumProperty ( items = getContexts , name = " Contexts " )
2020-11-01 20:08:48 +07:00
available_contexts : EnumProperty ( items = [ ( " Model " , " Model " , " " ) , ( " Plan " , " Plan " , " " ) ] , name = " Available Contexts " )
2019-12-04 17:49:28 +11:00
available_subcontexts : EnumProperty ( items = getSubcontexts , name = " Available Subcontexts " )
available_target_views : EnumProperty ( items = getTargetViews , name = " Available Target Views " )
2020-04-23 16:05:06 +10:00
classification_references : PointerProperty ( type = ClassificationView )
2020-11-01 20:08:48 +07:00
pset_template_files : EnumProperty (
items = getPsetTemplateFiles , name = " Pset Template Files " , update = refreshPropertySetTemplates
)
2020-04-24 17:14:07 +10:00
property_set_templates : EnumProperty ( items = getPropertySetTemplates , name = " Pset Template Files " )
active_property_set_template : PointerProperty ( type = PropertySetTemplate )
2020-11-01 20:08:48 +07:00
property_templates : CollectionProperty ( name = " Property Templates " , type = PropertyTemplate )
2020-04-25 19:17:47 +10:00
should_section_selected_objects : BoolProperty ( name = " Section Selected Objects " , default = False )
2020-11-01 20:08:48 +07:00
section_plane_colour : FloatVectorProperty (
name = " Temporary Section Cutaway Colour " , subtype = " COLOR " , default = ( 1 , 0 , 0 ) , min = 0.0 , max = 1.0
)
ifc_import_filter : EnumProperty (
2020-11-02 11:26:31 +11:00
items = [ ( " NONE " , " None " , " " ) , ( " WHITELIST " , " Whitelist " , " " ) , ( " BLACKLIST " , " Blacklist " , " " ) , ] ,
2020-11-01 20:08:48 +07:00
name = " Import Filter " ,
)
ifc_selector : StringProperty ( default = " " , name = " IFC Selector " )
csv_attributes : CollectionProperty ( name = " CSV Attributes " , type = StrProperty )
2020-12-28 10:18:55 +07:00
csv_delimiter : EnumProperty (
items = [ ( " ; " , " ; " , " " ) , ( " , " , " , " , " " ) , ( " . " , " . " , " " ) , ( " CUSTOM " , " Custom " , " " ) , ] ,
name = " IFC CSV Delimiter " ,
default = " ; " ,
)
csv_custom_delimiter : StringProperty ( default = " " , name = " Custom Delimiter " )
2020-11-01 20:08:48 +07:00
document_information : CollectionProperty ( name = " Document Information " , type = DocumentInformation )
active_document_information_index : IntProperty ( name = " Active Document Information Index " )
document_references : CollectionProperty ( name = " Document References " , type = DocumentReference )
active_document_reference_index : IntProperty ( name = " Active Document Reference Index " )
2020-11-27 18:18:23 +11:00
blender_clash_set_a : CollectionProperty ( name = " Blender Clash Set A " , type = StrProperty )
blender_clash_set_b : CollectionProperty ( name = " Blender Clash Set B " , type = StrProperty )
2020-11-01 20:08:48 +07:00
clash_sets : CollectionProperty ( name = " Clash Sets " , type = ClashSet )
2020-12-30 12:18:41 +11:00
should_create_clash_snapshots : BoolProperty ( name = " Create Snapshots " , default = True )
2020-11-21 16:29:55 -05:00
clash_results_path : StringProperty ( name = " Clash Results Path " )
smart_grouped_clashes_path : StringProperty ( name = " Smart Grouped Clashes Path " )
2020-11-01 20:08:48 +07:00
active_clash_set_index : IntProperty ( name = " Active Clash Set Index " )
2020-11-10 21:01:51 -05:00
smart_clash_groups : CollectionProperty ( name = " Smart Clash Groups " , type = SmartClashGroup )
active_smart_group_index : IntProperty ( name = " Active Smart Group Index " )
2020-11-21 19:17:29 -05:00
smart_clash_grouping_max_distance : IntProperty ( name = " Smart Clash Grouping Max Distance " , default = 3 , soft_min = 1 , soft_max = 10 )
2020-11-01 20:08:48 +07:00
constraints : CollectionProperty ( name = " Constraints " , type = Constraint )
active_constraint_index : IntProperty ( name = " Active Constraint Index " )
2020-11-05 18:17:45 +11:00
eastings : StringProperty ( name = " Eastings " )
northings : StringProperty ( name = " Northings " )
orthogonal_height : StringProperty ( name = " Orthogonal Height " )
2020-08-05 17:18:10 +10:00
ifc_patch_recipes : EnumProperty ( items = getIfcPatchRecipes , name = " Recipes " )
2020-11-01 20:08:48 +07:00
ifc_patch_input : StringProperty ( default = " " , name = " IFC Patch Input IFC " )
ifc_patch_output : StringProperty ( default = " " , name = " IFC Patch Output IFC " )
ifc_patch_args : StringProperty ( default = " " , name = " Arguments " )
qto_result : StringProperty ( default = " " , name = " Qto Result " )
area_unit : EnumProperty (
2020-11-02 11:26:31 +11:00
default = " SQUARE_METRE " ,
2020-11-01 20:08:48 +07:00
items = [
2020-11-02 11:26:31 +11:00
( " MILLI/SQUARE_METRE " , " Square Millimetre " , " " ) ,
( " CENTI/SQUARE_METRE " , " Square Centimetre " , " " ) ,
( " SQUARE_METRE " , " Square Metre " , " " ) ,
( " KILO/SQUARE_METRE " , " Square Kilometre " , " " ) ,
( " square inch " , " Square Inch " , " " ) ,
( " square foot " , " Square Foot " , " " ) ,
( " square yard " , " Square Yard " , " " ) ,
( " square mile " , " Square Mile " , " " ) ,
2020-11-01 20:08:48 +07:00
] ,
name = " IFC Area Unit " ,
)
volume_unit : EnumProperty (
2020-11-02 11:26:31 +11:00
default = " CUBIC_METRE " ,
2020-11-01 20:08:48 +07:00
items = [
2020-11-02 11:26:31 +11:00
( " MILLI/CUBIC_METRE " , " Cubic Millimetre " , " " ) ,
( " CENTI/CUBIC_METRE " , " Cubic Centimetre " , " " ) ,
( " CUBIC_METRE " , " Cubic Metre " , " " ) ,
( " KILO/CUBIC_METRE " , " Cubic Kilometre " , " " ) ,
( " cubic inch " , " Cubic Inch " , " " ) ,
( " cubic foot " , " Cubic Foot " , " " ) ,
( " cubic yard " , " Cubic Yard " , " " ) ,
2020-11-01 20:08:48 +07:00
] ,
name = " IFC Volume Unit " ,
)
metric_precision : FloatProperty ( default = 0 , name = " Drawing Metric Precision " )
imperial_precision : EnumProperty (
items = [
( " NONE " , " No rounding " , " " ) ,
( " 1 " , ' Nearest 1 " ' , " " ) ,
( " 1/2 " , ' Nearest 1/2 " ' , " " ) ,
( " 1/4 " , ' Nearest 1/4 " ' , " " ) ,
( " 1/8 " , ' Nearest 1/8 " ' , " " ) ,
( " 1/16 " , ' Nearest 1/16 " ' , " " ) ,
( " 1/32 " , ' Nearest 1/32 " ' , " " ) ,
( " 1/64 " , ' Nearest 1/64 " ' , " " ) ,
( " 1/128 " , ' Nearest 1/128 " ' , " " ) ,
( " 1/256 " , ' Nearest 1/256 " ' , " " ) ,
] ,
name = " Drawing Imperial Precision " ,
)
override_colour : FloatVectorProperty (
name = " Override Colour " , subtype = " COLOR " , default = ( 1 , 0 , 0 , 1 ) , min = 0.0 , max = 1.0 , size = 4
)
2020-11-05 13:54:20 +01:00
active_presentation_layer_index : IntProperty ( name = " Active Presentation Layer Index " )
2020-11-05 07:57:24 +01:00
presentation_layers : CollectionProperty ( name = " Presentation Layers " , type = PresentationLayer )
2020-03-24 17:53:58 +11:00
2019-11-17 11:38:56 +11:00
class MapConversion ( PropertyGroup ) :
eastings : StringProperty ( name = " Eastings " )
northings : StringProperty ( name = " Northings " )
orthogonal_height : StringProperty ( name = " Orthogonal Height " )
x_axis_abscissa : StringProperty ( name = " X Axis Abscissa " )
x_axis_ordinate : StringProperty ( name = " X Axis Ordinate " )
scale : StringProperty ( name = " Scale " )
2020-11-01 20:08:48 +07:00
2019-11-17 11:38:56 +11:00
class TargetCRS ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
description : StringProperty ( name = " Description " )
geodetic_datum : StringProperty ( name = " Geodetic Datum " )
vertical_datum : StringProperty ( name = " Vertical Datum " )
map_projection : StringProperty ( name = " Map Projection " )
map_zone : StringProperty ( name = " Map Zone " )
map_unit : StringProperty ( name = " Map Unit " )
2020-11-01 20:08:48 +07:00
2019-11-21 07:09:08 +11:00
class BIMLibrary ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
version : StringProperty ( name = " Version " )
publisher : StringProperty ( name = " Publisher " )
version_date : StringProperty ( name = " Version Date " )
location : StringProperty ( name = " Location " )
description : StringProperty ( name = " Description " )
2020-09-17 17:28:17 +10:00
class IfcParameter ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
step_id : IntProperty ( name = " STEP ID " )
index : IntProperty ( name = " Index " )
2020-11-01 20:08:48 +07:00
value : FloatProperty ( name = " Value " ) # For now, only floats
2020-09-17 17:28:17 +10:00
type : StringProperty ( name = " Type " )
2020-03-19 16:48:50 +11:00
class PsetQto ( PropertyGroup ) :
2019-11-17 11:38:56 +11:00
name : StringProperty ( name = " Name " )
2020-01-15 17:17:03 +11:00
properties : CollectionProperty ( name = " Properties " , type = Attribute )
2020-11-30 11:25:11 +11:00
is_expanded : BoolProperty ( name = " Is Expanded " , default = True )
2020-11-29 23:24:56 +11:00
is_editable : BoolProperty ( name = " Is Editable " )
2019-11-17 11:38:56 +11:00
2020-05-01 09:58:15 +10:00
2019-11-17 11:38:56 +11:00
class GlobalId ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
2020-01-19 18:41:57 +11:00
class BoundaryCondition ( PropertyGroup ) :
2020-11-01 20:08:48 +07:00
name : EnumProperty (
items = getBoundaryConditionClasses , name = " Boundary Type " , update = refreshBoundaryConditionAttributes
)
2020-01-19 18:41:57 +11:00
attributes : CollectionProperty ( name = " Attributes " , type = Attribute )
2019-11-17 11:38:56 +11:00
class BIMObjectProperties ( PropertyGroup ) :
2021-01-01 12:15:18 +11:00
ifc_definition_id : IntProperty ( name = " IFC Definition ID " )
2020-11-03 22:59:35 +11:00
is_reassigning_class : BoolProperty ( name = " Is Reassigning Class " )
2019-11-17 11:38:56 +11:00
global_ids : CollectionProperty ( name = " GlobalIds " , type = GlobalId )
attributes : CollectionProperty ( name = " Attributes " , type = Attribute )
2021-01-05 13:16:31 +11:00
is_editing_attributes : BoolProperty ( name = " Is Editing Attributes " )
2021-01-05 16:29:14 +11:00
relating_object : PointerProperty ( name = " Aggregate " , type = bpy . types . Object )
is_editing_aggregate : BoolProperty ( name = " Is Editing Aggregate " )
2021-01-06 11:06:59 +11:00
is_editing_container : BoolProperty ( name = " Is Editing Container " )
2021-01-07 10:47:50 +11:00
relating_type : PointerProperty ( name = " Type " , type = bpy . types . Object )
is_editing_type : BoolProperty ( name = " Is Editing Type " )
2020-11-01 20:08:48 +07:00
relating_type : PointerProperty ( name = " Type Product " , type = bpy . types . Object )
relating_structure : PointerProperty ( name = " Spatial Container " , type = bpy . types . Object )
2021-01-07 19:09:55 +11:00
active_pset_id : IntProperty ( name = " Active Pset ID " )
active_pset_name : StringProperty ( name = " Pset Name " )
properties : CollectionProperty ( name = " Properties " , type = Attribute )
2020-03-19 16:48:50 +11:00
psets : CollectionProperty ( name = " Psets " , type = PsetQto )
qtos : CollectionProperty ( name = " Qtos " , type = PsetQto )
2020-05-01 17:24:59 +10:00
document_references : CollectionProperty ( name = " Document References " , type = DocumentReference )
2020-11-01 20:08:48 +07:00
active_document_reference_index : IntProperty ( name = " Active Document Reference Index " )
constraints : CollectionProperty ( name = " Constraints " , type = Constraint )
active_constraint_index : IntProperty ( name = " Active Constraint Index " )
2020-04-23 16:05:06 +10:00
classifications : CollectionProperty ( name = " Classifications " , type = ClassificationReference )
2020-01-14 13:28:48 +11:00
material_type : EnumProperty ( items = getMaterialTypes , name = " Material Type " )
2020-11-04 21:28:47 +11:00
material : PointerProperty ( name = " Material " , type = bpy . types . Material )
2020-11-05 22:41:43 +11:00
material_set : PointerProperty ( name = " Material Set " , type = MaterialSet )
2020-11-01 20:08:48 +07:00
pset_name : EnumProperty ( items = getPsetNames , name = " Pset Name " )
qto_name : EnumProperty ( items = getQtoNames , name = " Qto Name " )
has_boundary_condition : BoolProperty ( name = " Has Boundary Condition " )
boundary_condition : PointerProperty ( name = " Boundary Condition " , type = BoundaryCondition )
structural_member_connection : PointerProperty ( name = " Structural Member Connection " , type = bpy . types . Object )
2020-09-10 16:11:33 +10:00
# Address applies to IfcSite's SiteAddress and IfcBuilding's BuildingAddress
2020-11-01 20:08:48 +07:00
address : PointerProperty ( name = " Address " , type = Address )
2019-11-17 11:38:56 +11:00
class BIMMaterialProperties ( PropertyGroup ) :
is_external : BoolProperty ( name = " Has External Definition " )
location : StringProperty ( name = " Location " )
identification : StringProperty ( name = " Identification " )
name : StringProperty ( name = " Name " )
2020-11-11 23:02:07 +11:00
pset_name : EnumProperty ( items = getMaterialPsetNames , name = " Pset Name " )
2020-03-19 16:48:50 +11:00
psets : CollectionProperty ( name = " Psets " , type = PsetQto )
2020-01-14 15:38:22 +11:00
attributes : CollectionProperty ( name = " Attributes " , type = Attribute )
applicable_attributes : EnumProperty ( items = getApplicableMaterialAttributes , name = " Attribute Names " )
2021-01-02 17:45:36 +11:00
ifc_definition_id : IntProperty ( name = " IFC Definition ID " )
# In Blender, a material object can map to an IFC material, IFC surface style, or both
ifc_style_id : IntProperty ( name = " IFC Style ID " )
2019-11-17 11:38:56 +11:00
class SweptSolid ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
outer_curve : StringProperty ( name = " Outer Curve " )
inner_curves : StringProperty ( name = " Inner Curves " )
extrusion : StringProperty ( name = " Extrusion " )
2020-06-11 10:52:00 +10:00
class RepresentationItem ( PropertyGroup ) :
name : StringProperty ( name = " Name " )
vgroup : StringProperty ( name = " Vertex Group " )
2020-11-26 21:31:42 +11:00
class ItemSlotMap ( PropertyGroup ) :
name : StringProperty ( name = " Item Element ID " )
slot_index : IntProperty ( name = " Material Slot Index " )
2019-11-17 11:38:56 +11:00
class BIMMeshProperties ( PropertyGroup ) :
2021-01-01 12:15:18 +11:00
ifc_definition_id : IntProperty ( name = " IFC Definition ID " )
2020-06-21 09:48:54 +10:00
is_native : BoolProperty ( name = " Is Native " , default = False )
2019-11-17 11:38:56 +11:00
is_swept_solid : BoolProperty ( name = " Is Swept Solid " )
swept_solids : CollectionProperty ( name = " Swept Solids " , type = SweptSolid )
2020-11-01 20:08:48 +07:00
is_parametric : BoolProperty ( name = " Is Parametric " , default = False )
2020-09-17 17:28:17 +10:00
ifc_definition : StringProperty ( name = " IFC Definition " )
ifc_parameters : CollectionProperty ( name = " IFC Parameters " , type = IfcParameter )
2020-11-01 20:08:48 +07:00
active_representation_item_index : IntProperty ( name = " Active Representation Item Index " )
2020-11-15 17:00:50 +11:00
presentation_layer_index : IntProperty ( name = " Presentation Layer Index " , default = - 1 )
2021-01-01 12:15:18 +11:00
ifc_item_ids : CollectionProperty ( name = " IFC Item IDs " , type = ItemSlotMap )