Avoided Area?

Anonymous
09-09-2003, 05:00 AM
I'm currently using the following code:-

Set objLoc = objMap.SelectedArea.Location
If Not objLoc Is Nothing Then
If Type Of objLoc Is Location Then
Set objShape = objMap.Shapes.AddShape(geoShapeRectangle, objLoc, 5, 5)
objShape.Avoided = True
End If
End If


This has been bugging me... How can I make the area to be avoided be the exact shape I've actually drawn? At the moment, I'm hard coding a distance of 5 x 5 miles. Surely there must be a simple way to use the Selected Areas distance?

Thanks

Martel
09-25-2003, 12:46 AM
If you're selecting area on the map and want the avoidance area to be the same size, try storing the selected area height and width before doing anything else. Or am I misreading your question?


Dim selWidth as long
Dim selHeight as long

selWidth = objMap.SelectedArea.Width
selHeight = objMap.SelectedArea.Height
..
..

Set objShape = objMap.Shapes.AddShape(geoShapeRectangle, objLoc, selWidth, selHeight)
..
..


fill in the rest of your code then substitute the height and width for your current values.

 
Web mp2kmag.com
mapforums.com