Hi list,
I try to make this script work unsuccessfully.

The goal is to get a ID just in selected items

and I get an error

Methon Invocation f.getAttribute (Target Error)
Why?? please help

luca


{
addGidSel(String layer) {
        lay = wc.layerManager.getLayer(layer);
        if (lay==null) {
            wc.workbench.frame.warnUser(layer + "does not exist");
            return;
        }
        schema = lay.featureCollectionWrapper.featureSchema;
        if (!schema.hasAttribute("gid")) schema.addAttribute("gid",
AttributeType.INTEGER);

        features = lay.featureCollectionWrapper.features;
        //featuressel = lay.featureCollectionWrapper.FeaturesWithSelectedItems;
        //featuressel = lay.featureCollectionWrapper.features;
        featuressel = 
wc.layerViewPanel.selectionManager.getFeaturesWithSelectedItems(lay);
        
        gid = 1;
        for (f : features) {
                //if (f in featuressel) selezionata = "true";
                wc.workbench.frame.warnUser(gid + " - " + 
f.getAttribute("id_edif")
+ " - " + f.getAttribute("gid"));
                //f.setAttribute("gid", gid);
                //f.setAttribute("gid", changeValue(f.getAttribute("gid")));
                gid++;
        }
}

ll = wc.layerNamePanel.selectedLayers;
addGidSel(ll[0].name);

} // end script


luca marletta
www.beopen.it
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users

Reply via email to