POST
|
Hi The above code is now working. What I really need is to create two parallel lines, which stay the same distance apart whether the user zooms in or out. Is this possible? Regards Lawrence
... View more
10-04-2010
12:16 PM
|
0
|
0
|
358
|
POST
|
Sorry Neil (or anyone else), my last reply should have read, how can I change my code to return a polyline and not an element? I am struggling with the concepts here. Many thanks
... View more
09-25-2010
02:23 AM
|
0
|
0
|
358
|
POST
|
Hi Neil After a lot of surfing around, I found the following example: ______________ Private Function ConstructOffset(pInPolyline As IPolyline, dOffset As Double) As IPolyline Dim pConstructCurve As IConstructCurve On Error GoTo ErrorHandler If pInPolyline Is Nothing Or pInPolyline.IsEmpty Then Exit Function Set pConstructCurve = New Polyline pConstructCurve.ConstructOffset pInPolyline, dOffset, esriConstructOffsetRounded + esriConstructOffsetSimple Set ConstructOffset = pConstructCurve Exit Function ErrorHandler: Set ConstructOffset = Nothing End Function ______________ Here is my line drawing function. I can't get my function to correctly call the above function. Can you see what is wrong? Many thanks ______________ Private Function DrawLine(x1, y1, x2, y2, aView As IActiveView, pMap, LineName) On Error GoTo err_handler Dim pPointCollection As IPointCollection Dim pFromPoint As ipoint Dim pToPoint As ipoint Dim pPolyline As IPolyline Set pFromPoint = New Point Set pToPoint = New Point Dim pLineSym As ISimpleLineSymbol Dim pLineElement As ILineElement pFromPoint.PutCoords x1, y1 pToPoint.PutCoords x2, y2 Set pPolyline = New Polyline Set pPointCollection = New Polyline Set oPointCollection = New Polyline pPointCollection.AddPoint pFromPoint pPointCollection.AddPoint pToPoint Dim pGC As IGraphicsContainer Set pGC = pMap Dim pElement As IElement Dim oElement As IElement Dim oLineElement As ILineElement Set pElement = New LineElement Set oElement = New LineElement pElement.Geometry = pPointCollection Dim oLineSym As ISimpleLineSymbol Dim SymCol As IRgbColor Set pLineElement = pElement Set oLineElement = oElement Set pLineSym = New SimpleLineSymbol pLineSym.Style = esriSLSSolid pLineSym.Width = 3 Set SymCol = New RgbColor SymCol.Blue = 255 pLineSym.Color = SymCol pLineElement.Symbol = pLineSym oLineElement = ConstructOffset(pPointCollection, 100) Dim elemProps As IElementProperties Set elemProps = pLineElement elemProps.Name = LineName pGC.AddElement pLineElement, 0 pGC.AddElement oLineElement, 0 aView.PartialRefresh esriViewGraphics, Nothing, Nothing Exit Function err_handler: MsgBox Err & " - " & Error$ Resume End Function ______________
... View more
09-24-2010
11:53 AM
|
0
|
0
|
358
|
POST
|
Hi I have a VBA routine, where the user clicks on a polyline and the coordinates are returned. X1, Y1, X2 and Y2. I also have a routine to draw a line between these coordinates. How do I draw the polyline parallel to the original line, which is offset by the same distance, regardless of the zoom factor? Thanks in advance. Lawrence
... View more
09-23-2010
11:51 AM
|
0
|
5
|
689
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|