It'll be up to you to either manage all the lines (entities actually) within a sketch or search through all the entities within the sketch to identify the specific line you are wanting to edit. You'll need to know something about the entity you're looking for in order to identify it. It could be a point that's located on a plane, you may already know a start or stop point, there's any number of ways to search for location or features, but you must know something about the line or allow the user to select the line to identify it for you.
Once you have the specific entity identified, you assign that entity to a variable name to make it easier to manage since making a modification to that entity could alter the Inventor variable you just found it as. In the case of my previous example, I assigned the line to the variable "oLine" which was my way of referencing that entity to modify it.
True I only showed a very small snippet of that code, assuming you knew a bit about coding already. It would appear there's still a bit of learning going on here so I'll include more code that would at least allow you to run the example...
'declare how variable names will be used as
Dim oDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oSketch As PlanarSketch
Dim oWorkPlane As WorkPlane
Dim oLine As SketchLine
Dim oPt1, oPt2 As Point2d
For Each oSketch In oCompDef.Sketches 'delete any previous test sketch
If oSketch.Name = "Test Sketch" Then oSketch.Delete
Next
'Create a sketch
oWorkPlane = oCompDef.WorkPlanes.Item("XY Plane") 'assign XY Plane to oWorkplane variable
oSketch = oCompDef.Sketches.Add(oWorkPlane) 'assign oSketch as the variable for this new sketch
oSketch.Name = "Test Sketch" 'Assign Model Tree name to this scketch
oGC = oSketch.GeometricConstraints 'variable name shortcut for Sketch Constraints
oPt1 = oTG.CreatePoint2d(0, 0) 'identify location for first point variable
oPt2 = oTG.CreatePoint2d(5, -12) 'identify location for second point variable
oLine = oSketch.SketchLines.AddByTwoPoints(oPt1, oPt2) 'create a new line and reference it as the variable "oLine"
oLine.Construction = True
Hope this helps.
Autodesk Inventor Certified Professional