# Scenario 4 elif (not CloseNumber(proj_start.X, line_start.X) \ or not CloseNumber(proj_start.Y, line_start.Y)) \ and (not CloseNumber(proj_end.X, line_end.X) \ or not CloseNumber(proj_end.Y, line_end.Y)): print('4') t = Transaction(doc, 'Correct Lines 4') t.Start() try: newLine1 = Line.CreateBound(proj_start, line_start) line.SetGeometryCurve(newLine1, True) except: print('Fail 411') newLine2 = Line.CreateBound(proj_end, line_end) line2 = ElementTransformUtils.CopyElement( doc, line.Id, XYZ(0.1, 0.1, 0.1)) doc.GetElement(line2[0]).SetGeometryCurve(newLine2, True) print('Correction Successful') ''' except: print('Fail 412') # print("Wall" + format(outprint.linkify(wall.Id))) # print("Line" + format(outprint.linkify(line.Id))) ''' t.Commit() else: print('Error 5') print("---------------") except: print('Error 6') # t.Commit()
def copy_by_normal_length(self, vect): """Копировать арматуру по вектору""" return self.__class__(doc.GetElement(ElementTransformUtils.CopyElement(doc, self.rebar.Id, vect)[0]))