Minor spatial refactor

This commit is contained in:
Massimo Fabbro
2023-10-05 21:17:25 +02:00
parent bbfd42cf19
commit 698ccceda2
4 changed files with 9 additions and 5 deletions
@@ -62,7 +62,7 @@ class GenerateSpace(bpy.types.Operator, tool.Ifc.Operator):
bpy.context.window_manager.popup_menu(msg, title="Error", icon="ERROR")
return
core.generate_space(tool.Ifc, tool.Spatial, tool.Model)
core.generate_space(tool.Ifc, tool.Spatial, tool.Model, tool.Type)
class GenerateSpacesFromWalls(bpy.types.Operator, tool.Ifc.Operator):
+2 -4
View File
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import blenderbim.core.type
def reference_structure(ifc, spatial, structure=None, element=None):
if spatial.can_reference(structure, element):
@@ -127,7 +126,7 @@ def select_decomposed_elements(spatial):
spatial.select_products(spatial.get_decomposed_elements(container))
#HERE STARTS SPATIAL TOOL
def generate_space(ifc, spatial, model):
def generate_space(ifc, spatial, model, Type):
active_obj = spatial.get_active_obj()
selected_objects = spatial.get_selected_objects()
element = None
@@ -171,8 +170,7 @@ def generate_space(ifc, spatial, model):
element = ifc.get_entity(obj)
if relating_type:
blenderbim.core.type.assign_type(tool.Ifc, tool.Type, element=element, type=relating_type)
spatial.assign_relating_type_to_element(ifc, Type, element, relating_type)
def generate_spaces_from_walls(ifc, spatial, collector):
z = spatial.get_active_obj_z()
+1
View File
@@ -843,6 +843,7 @@ class Spatial:
def get_body_representation(cls, obj): pass
def assign_ifcspace_class_to_obj(cls, obj): pass
def assign_type_to_obj(cls, obj): pass
def assign_relating_type_to_element(cls, ifc, Type, element, relating_type): pass
def regen_obj_representation(cls, ifc, geometry, obj, body): pass
def toggle_spaces_visibility_wired_and_textured(cls, spaces): pass
@@ -20,6 +20,7 @@ import bpy
import bmesh
import shapely
import ifcopenshell
import blenderbim.core.type
import blenderbim.core.tool
import blenderbim.core.root
import blenderbim.core.spatial
@@ -661,6 +662,10 @@ class Spatial(blenderbim.core.tool.Spatial):
element = tool.Ifc.get_entity(obj)
blenderbim.core.type.assign_type(tool.Ifc, tool.Type, element=element, type=relating_type)
@classmethod
def assign_relating_type_to_element(cls, ifc, Type, element, relating_type):
blenderbim.core.type.assign_type(ifc, Type, element=element, type=relating_type)
@classmethod
def assign_container_to_obj(cls, obj):
active_obj = bpy.context.active_object