search in attributes during mapimport

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
it seems I might need a little help...
I need to import shape files into my drawing. These shape files always have a different name and I cant tell what the name is gonna be (random generated). During the import I change the shp files layer name into one of it's attribute's number. The next part in the importing procedure is when the imported newly named layer is merged to an existing one. The code works just fine.
_$ (defun c:shp () (command "._mapimport" "n" "fólia" "Adott" (vl-string-trim ".shp" (strcat "Default:"(getfiled "Válaszd ki az shp fájlokat" "" "shp" 8))) "fólia" "adatmezőből" "v_elhmod" "adat" "létrehoz" "tovább" "tovább") (if (tblsearch "Layer" "2") (progn (setq OLDLAY "2") (setq NEWLAY "Opa") (command "-laymrg" "N" OLDLAY "" "N" NEWLAY "i"))) (if (tblsearch "Layer" "3") (progn (setq OLDLAY "3") (setq NEWLAY "Opa") (command "-laymrg" "N" OLDLAY "" "N" NEWLAY "i"))) (if (tblsearch "Layer" "1") (progn (setq OLDLAY "1") (setq NEWLAY "Opl") (command "-laymrg" "N" OLDLAY "" "N" NEWLAY "i"))) ) _$
The problem is that some shp file's attribute data sometimes named V_ELHMOD instead of v_elhmod. So the code works with lowercases. Is there a way to solve this problem? Maybe with a searching code that runs through the attribute table and if it is written with capital letter then return with V_ELHMOD?
Thanks for the answers!
David