def METHOD_NAME(self, segment, oldLength, length, diameter, innerdiameter):
    constrRadius = 4 + segment * 6
    constrLength = 7 + segment * 6
    constrInnerRadius = 1 # Currently we don't allow multiple different innner diameters
    # update total length
    self.totalLength = self.totalLength - oldLength + length
    # Adjust length of centerline
    self.sketch.setDatum(0,self.totalLength)
    # Adjust segment length
    self.sketch.setDatum(constrLength, length)
    # Adjust diameter
    self.sketch.setDatum(constrRadius, diameter/2)
    # Adjust inner diameter
    self.sketch.setDatum(constrInnerRadius, innerdiameter/2)
    # Update feature
    self.Doc.recompute()
    self.Gui.SendMsgToActiveView("ViewFit")