Default to IfcAnnotation for all annotation objects

This commit is contained in:
Dion Moult
2020-05-11 17:13:27 +10:00
parent 42634e9c60
commit 7728e83f1e
2 changed files with 7 additions and 6 deletions
@@ -78,12 +78,12 @@ class Annotator:
if name in obj.name:
return obj
if data_type == 'mesh':
data = bpy.data.meshes.new(name)
data = bpy.data.meshes.new('Plan/Annotation/PLAN_VIEW/' + name)
elif data_type == 'curve':
data = bpy.data.curves.new(name, type='CURVE')
data = bpy.data.curves.new('Plan/Annotation/PLAN_VIEW/' + name, type='CURVE')
data.dimensions = '3D'
data.resolution_u = 2
obj = bpy.data.objects.new(name, data)
obj = bpy.data.objects.new('IfcAnnotation/' + name, data)
collection.objects.link(obj)
return obj
@@ -1517,9 +1517,10 @@ class CreateView(bpy.types.Operator):
if not bpy.data.collections.get('Views'):
bpy.context.scene.collection.children.link(bpy.data.collections.new('Views'))
views_collection = bpy.data.collections.get('Views')
view_collection = bpy.data.collections.new(bpy.context.scene.DocProperties.view_name)
view_collection = bpy.data.collections.new('IfcGroup/' + bpy.context.scene.DocProperties.view_name)
views_collection.children.link(view_collection)
camera = bpy.data.objects.new(bpy.context.scene.DocProperties.view_name, bpy.data.cameras.new(bpy.context.scene.DocProperties.view_name))
camera = bpy.data.objects.new('IfcGroup/' + bpy.context.scene.DocProperties.view_name,
bpy.data.cameras.new(bpy.context.scene.DocProperties.view_name))
camera.data.type = 'ORTHO'
camera.data.BIMCameraProperties.diagram_scale = '1:100'
bpy.context.scene.camera = camera
@@ -1548,7 +1549,7 @@ class CutSection(bpy.types.Operator):
camera = bpy.context.scene.camera
if not (camera.type == 'CAMERA' and camera.data.type == 'ORTHO'):
return {'FINISHED'}
self.diagram_name = camera.name
self.diagram_name = camera.name.split('/')[1]
bpy.context.scene.render.filepath = os.path.join(
bpy.context.scene.BIMProperties.data_dir,
'diagrams',