|
|
Iscritto: Nov 2006
Posts: 13
Junior Member
|
OP
Junior Member
Iscritto: Nov 2006
Posts: 13 |
ho un problema.... devo convertire uno shapefile da polyline a polylineM qualcuno mi sa indicare qualche estensione e/o script da usare o in Arcview 3.x o Arcgis 9.x Grazie in anticipo a chiunque voglia darmi una mano grazie
|
|
|
|
|
Iscritto: Jan 2008
Posts: 4
Junior Member
|
Junior Member
Iscritto: Jan 2008
Posts: 4 |
Ciao, dovresti provare con questo script per arcview 3.x
***inizio script***
'Il tema attivo deve essere di polilinee
'-- Get the active theme ...
theView = av.GetActiveDoc theCount = theView.GetActiveThemes.Count If (theCount = 0) then msgbox.info("There is no active theme to process.","No active theme...") exit End theTheme = theView.GetActiveThemes.Get(0) theFtab = theTheme.GetFtab theClassName = theFtab.GetShapeClass.GetClassName.AsString
If (theClassName = "PolyLine") then theFieldList = theFtab.GetFields.Clone
theShapeField = theFtab.FindField("shape")
'-- Nuovo shape theNewShapefile = Filedialog.Put("*.shp".AsFilename,"*.shp", "Enter new shapefile name for "+theTheme.GetName) If (theNewShapefile = nil) then exit End theNewFtab = Ftab.MakeNew(theNewShapefile,PolyLineM) theNewFtab.StartEditingWithRecovery '-- calculate dei valori theFieldList.RemoveObj(theShapeField) '-- ignore the shape field
theFieldCount = theFieldList.Count - 1 theNewShapeField = theNewFtab.FindField("shape") theNewFieldList = theFieldList.DeepClone theNewFtab.AddFields(theNewFieldList)
'-- conversione For each rec in theFtab theShape = theFtab.ReturnValue(theShapeField,rec) theShapeM = theShape.AsPolyLineM theNewRecnum = theNewFtab.AddRecord theNewFtab.SetValue(theNewShapeField,theNewRecnum,theShapeM)
For each fld in (0..theFieldCount) theVal = theFtab.ReturnValue(theFieldList.Get(fld),rec) theNewFtab.SetValue(theNewFieldList.Get(fld),theNewRecnum,theVal) End End '-- For each rec... Else '-- If the current theme is not a PolyLine theme ... msgbox.info (theTheme.GetName+" è costituito da "+theClassName.AsString+" non è un tema di polilinee.", theTheme.GetName+" non è un tema di polilinee") exit End '-- If (theClassName = "PolyLine") ... theNewFtab.StopEditingWithRecovery(true)
'-- carica shape...
If (MsgBox.YesNo("Carico il nuovo shape nella vista?", "Convert to Shapefile",true)) then newFtheme = Ftheme.Make(theNewFtab) theView.Addtheme(newFtheme) newFtheme.Setvisible(true) End
***fine script***
provalo! Simona
|
|
|
|
|
Iscritto: Nov 2006
Posts: 13
Junior Member
|
OP
Junior Member
Iscritto: Nov 2006
Posts: 13 |
grazie Simona lo script funziona ciao
|
|
|
Link Copiato negli Appunti