Select to view content in your preferred language

Creating a Polygon from entered coordinates

508
2
11-23-2011 02:50 AM
DanikBourdeau
Deactivated User
I want to create a square polygon from a pair of coords.  Figuring out the extent of the square is easy but how do I add the array of points into the polygon shapefile?  I've been playing around with the recordset object but I can't figure out how to add a feature.

I know I can do it using the Map.AddFeature function but I also need to enter attribute values from forms which I kind of have to do using recordset.Fields().Value.  Is it possible to add features to a shapefile through recordset?

Thanks
Tags (3)
0 Kudos
2 Replies
DanikBourdeau
Deactivated User
So I guess using Map.AddFeature is the only way.

What is the best way to add attributes for the feature that is added using Map.AddFeature?  I know I can set it to open the edit form automatically but I already have the values so I don't really need the form.  I just need to input the values at the same time the feature is being added.
0 Kudos
DanikBourdeau
Deactivated User
Nevermind, I figured it out. Don't know why it eluded me for so long.

Once the feature is created select it's attribute table with Application.Map.SelectionLayer.Records then you can add values to the specific fields.

One thing I'm not clear on is using Bookmark.

In this example:
Set objFeat = Application.Map.SelectionLayer.Records
objFeat.Bookmark = Application.Map.SelectionBookmark
objFeat.Fields("Field1").Value = now()
objFeat.Fields("Field2").Value = Applet.Forms("T1").Pages("Page1").Controls("C1").Value
objFeat.Update

Do I have to use the Bookmark property?
0 Kudos