wie kann ich diese Befehle in einer Schleife verallgemeinern/ vereinfachen?
Bin sehr dankbar auf jede Hilfe....
Code: Alles auswählen
MCAD_ELEMENT=gom.script.primitive.create_line_by_2_points (
name='Linie 1',
point1={'coordinates': list_actual_2 [0][0], 'id': Linie1_id1, 'normal': gom.app.project.inspection['Referenzpunkte'].normal[binarySearch(points2,Linie1_id1)], 'target': gom.app.project.inspection['Referenzpunkte'], 'type': 'coded'},
point2={'coordinates': list_actual_2 [0][1], 'id': Linie1_id2, 'normal': gom.app.project.inspection['Referenzpunkte'].normal[binarySearch(points2,Linie1_id2)] , 'target': gom.app.project.inspection['Referenzpunkte'], 'type': 'coded'})
MCAD_ELEMENT=gom.script.primitive.create_line_by_2_points (
name='Linie 3',
point1={'coordinates': list_actual_2 [1][0], 'id': Linie2_id1, 'normal': gom.app.project.inspection['Referenzpunkte'].normal[binarySearch(points2,Linie2_id1)], 'target': gom.app.project.inspection['Referenzpunkte'], 'type': 'coded'},
point2={'coordinates': list_actual_2 [1][1], 'id': Linie2_id2, 'normal': gom.app.project.inspection['Referenzpunkte'].normal[binarySearch(points2,Linie2_id2)] , 'target': gom.app.project.inspection['Referenzpunkte'], 'type': 'coded'})
MCAD_ELEMENT=gom.script.primitive.create_line_by_2_points (
name='Linie 5',
point1={'coordinates': list_actual_2 [2][0], 'id': Linie3_id1, 'normal': gom.app.project.inspection['Referenzpunkte'].normal[binarySearch(points2,Linie3_id2)], 'target': gom.app.project.inspection['Referenzpunkte'], 'type': 'coded'},
point2={'coordinates': list_actual_2 [2][1], 'id': Linie3_id2, 'normal': gom.app.project.inspection['Referenzpunkte'].normal[binarySearch(points2,Linie3_id1)] , 'target': gom.app.project.inspection['Referenzpunkte'], 'type': 'coded'})