Implement support for IfcLibraryInformation like a Git server

This commit is contained in:
Dion Moult
2019-11-21 21:27:32 +11:00
parent 9a18198988
commit f16861d5a9
3 changed files with 15 additions and 3 deletions
@@ -95,6 +95,7 @@ def register():
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
bpy.types.Scene.BIMLibrary = bpy.props.PointerProperty(type=prop.BIMLibrary)
bpy.types.Scene.MapConversion = bpy.props.PointerProperty(type=prop.MapConversion)
bpy.types.Scene.TargetCRS = bpy.props.PointerProperty(type=prop.TargetCRS)
bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
+13 -2
View File
@@ -865,9 +865,9 @@ class IfcExporter():
self.create_units()
self.create_people()
self.create_organisations()
self.create_library_information()
self.create_rep_context()
self.create_project()
self.create_library_information()
self.create_documents()
self.create_classifications()
self.create_classification_references()
@@ -1001,7 +1001,18 @@ class IfcExporter():
information = self.ifc_parser.library_information
if not information:
return
# TODO
information['attributes']['Publisher'] = self.owner_history.OwningUser
information['ifc'] = self.file.create_entity('IfcLibraryInformation',
**information['attributes'])
print(information['ifc'])
print(self.ifc_parser.project['ifc'])
self.file.createIfcRelAssociatesLibrary(
ifcopenshell.guid.new(),
self.owner_history,
information['attributes']['Name'],
information['attributes']['Description'],
[self.ifc_parser.project['ifc']],
information['ifc'])
def create_documents(self):
for document in self.ifc_parser.documents.values():
+1 -1
View File
@@ -313,7 +313,7 @@ class BIM_PT_library(Panel):
scene = context.scene
bim_properties = scene.BIMProperties
layout.row().prop(scene.BIMProperties, 'has_georeferencing')
layout.row().prop(scene.BIMProperties, 'has_library')
layout.label(text="Project Library:")
layout.row().prop(scene.BIMLibrary, 'location')