Replace this code in the CreateAlignmentsByLWPolyline function:
dObjId = CreatePolyline()
If (dObjId.IsNull) Then
m_Editor.WriteMessage("Sample Alignment: Error creating a polyline." + Convert.ToChar(10))
Return False
End If
With this:
Dim dObjId As ObjectId
dObjId = SelectPolyline()
If (dObjId.IsNull) Then
m_Editor.WriteMessage("Sample Alignment: Error getting a polyline." + Convert.ToChar(10))
Return False
End If
Then add this Function to the end of the class:
Public Function SelectPolyline() As ObjectId
Dim oPoly As ObjectId = Nothing
Dim entOpts As New PromptEntityOptions("Select polyline:")
entOpts.SetRejectMessage("...not a LWPolyline, try again!")
entOpts.AddAllowedClass(GetType(Polyline), True)
Dim entRes As PromptEntityResult = m_Editor.GetEntity(entOpts)
If entRes.Status = PromptStatus.OK Then
oPoly = entRes.ObjectId
End If
Return oPoly
End Function