|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
"""
|
|
|
import test
|
|
|
-from src.system_relation import systemutils, graph_model
|
|
|
+import systemutils, graph_model
|
|
|
|
|
|
|
|
|
def get_dicdata(sql,dic):
|
|
@@ -219,17 +219,20 @@ def save_edge_data(edge,block_id):
|
|
|
:param block_id:
|
|
|
:return:
|
|
|
"""
|
|
|
- vertex1=edge.start_vertex
|
|
|
- vertex2=edge.end_vertex
|
|
|
- c1=vertex1.system_data
|
|
|
- c2=vertex2.system_data
|
|
|
- model1= systemutils.get_specify_type_parent(vertex1, graph_model.FloorGraph).model
|
|
|
- model2 = systemutils.get_specify_type_parent(vertex2, graph_model.FloorGraph).model
|
|
|
- sql="insert into revit_calc.connected_block" \
|
|
|
- "(id1,type1,model_id1,id2,type2,model_id2,block_id,project_id) values " \
|
|
|
- "('%s','%s','%s','%s','%s','%s','%s','%s')"\
|
|
|
- %(c1.id,c1.type,model1.file_id,c2.id,c2.type,model2.file_id,block_id,model1.project_id)
|
|
|
- data = test.save_data(sql)
|
|
|
+ try:
|
|
|
+ vertex1=edge.start_vertex
|
|
|
+ vertex2=edge.end_vertex
|
|
|
+ c1=vertex1.system_data
|
|
|
+ c2=vertex2.system_data
|
|
|
+ model1= systemutils.get_specify_type_parent(vertex1, graph_model.FloorGraph).model
|
|
|
+ model2 = systemutils.get_specify_type_parent(vertex2, graph_model.FloorGraph).model
|
|
|
+ sql="insert into revit_calc.connected_block" \
|
|
|
+ "(id1,type1,model_id1,id2,type2,model_id2,block_id,project_id) values " \
|
|
|
+ "('%s','%s','%s','%s','%s','%s','%s','%s')"\
|
|
|
+ %(c1.id,c1.type,model1.file_id,c2.id,c2.type,model2.file_id,block_id,model1.project_id)
|
|
|
+ data = test.save_data(sql)
|
|
|
+ except Exception as e:
|
|
|
+ print(e)
|
|
|
def del_project_data(project_id):
|
|
|
"""
|
|
|
Before save.delete old data.
|