mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
minor fix for d4eb56e
This commit is contained in:
@@ -145,7 +145,7 @@ class AssignResource(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
related_object: bpy.props.StringProperty()
|
related_object: bpy.props.StringProperty()
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
core.assign_resource(tool.Ifc, tool.Resource, resource=tool.Ifc.get().by_id(self.resource))
|
core.assign_resource(tool.Ifc, tool.Spatial, resource=tool.Ifc.get().by_id(self.resource))
|
||||||
|
|
||||||
|
|
||||||
class UnassignResource(bpy.types.Operator, tool.Ifc.Operator):
|
class UnassignResource(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
@@ -156,7 +156,7 @@ class UnassignResource(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
related_object: bpy.props.StringProperty()
|
related_object: bpy.props.StringProperty()
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
core.unassign_resource(tool.Ifc, tool.Resource, resource=tool.Ifc.get().by_id(self.resource))
|
core.unassign_resource(tool.Ifc, tool.Spatial, resource=tool.Ifc.get().by_id(self.resource))
|
||||||
|
|
||||||
|
|
||||||
class EnableEditingResourceTime(bpy.types.Operator, tool.Ifc.Operator):
|
class EnableEditingResourceTime(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
|
|||||||
@@ -158,15 +158,15 @@ def contract_resource(resource_tool, resource):
|
|||||||
resource_tool.load_resource_properties()
|
resource_tool.load_resource_properties()
|
||||||
|
|
||||||
|
|
||||||
def assign_resource(ifc, resource_tool, resource=None, products=None):
|
def assign_resource(ifc, spatial, resource=None, products=None):
|
||||||
if not products:
|
if not products:
|
||||||
products = resource_tool.get_selected_products()
|
products = spatial.get_selected_products()
|
||||||
for product in products:
|
for product in products:
|
||||||
rel = ifc.run("resource.assign_resource", relating_resource=resource, related_object=product)
|
rel = ifc.run("resource.assign_resource", relating_resource=resource, related_object=product)
|
||||||
|
|
||||||
|
|
||||||
def unassign_resource(ifc, resource_tool, resource=None, products=None):
|
def unassign_resource(ifc, spatial, resource=None, products=None):
|
||||||
if not products:
|
if not products:
|
||||||
products = resource_tool.get_selected_products()
|
products = spatial.get_selected_products()
|
||||||
for product in products:
|
for product in products:
|
||||||
ifc.run("resource.unassign_resource", relating_resource=resource, related_object=product)
|
ifc.run("resource.unassign_resource", relating_resource=resource, related_object=product)
|
||||||
|
|||||||
Reference in New Issue
Block a user