Hi,
I am trying to learn NET by example. ( I know some VB)
Is there a complete code for creating an alignment from ployline ?
Thanks
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
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
Please take a look at the following :
Hope this helps.