Excel\’den GIS Sınıfı Aktarma Makrosu (Transfer GIS Class from Excel Macro)

netcad-excel-gis-sinifi-aktar-tum

sabangul67@gmail.com
Mayıs 17, 20257 dk okuma11 görüntülenme

Excel\’den GIS Sınıfı Aktarma ile Netcad Projelerinizi Hızlandırın! 🚀

Speed Up Your Netcad Projects with GIS Class Transfer from Excel!


Bu makro, Netcad kullanıcılarının Excel dosyalarından GIS sınıflarını hızlı ve hatasız bir şekilde projelerine aktarmasını sağlar. 🗺️ Özellikle harita mühendisleri ve GIS uzmanları için tasarlanmış bu araç, parsel numaralarına karşılık gelen GIS sınıflarını otomatik olarak Netcad projesine entegre eder. Kullanıcı dostu arayüzü sayesinde, Excel dosyasındaki verileri seçilen sütunlara göre okur ve ilgili objelerin GIS sınıflarını günceller. Bu işlem, manuel veri girişini ortadan kaldırarak zaman tasarrufu sağlar ve hata riskini en aza indirir.

This macro enables Netcad users to transfer GIS classes from Excel files to their projects quickly and accurately. 🗺️ Designed specifically for surveyors and GIS professionals, it automatically integrates GIS classes corresponding to parcel numbers into the Netcad project. With its user-friendly interface, it reads data from selected columns in an Excel file and updates the GIS classes of relevant objects. This eliminates manual data entry, saving time and minimizing errors.


Nasıl Çalışır (How Does It Work)

Excel Dosyası Seçimi: Makro, kullanıcıdan GIS sınıflarını içeren bir Excel dosyasını seçmesini ister. 📂
Sütun Belirleme: Parsel numarası ve GIS sınıfı sütunlarını (A\’dan Z\’ye) seçmenize olanak tanır.
Veri Aktarımı: Excel\’deki veriler okunur ve parsel numaralarına karşılık gelen GIS sınıfları Netcad projesindeki objelere atanır.
Sonuç Bildirimi: İşlem tamamlandığında, kaç parselin GIS sınıfının güncellendiği bir mesaj kutusu ile bildirilir. ✅
Makro, çoklu doğru, alan, nokta ve yazı objelerini destekler ve işlemi hızlı bir şekilde tamamlar.

Excel File Selection: The macro prompts the user to select an Excel file containing GIS classes. 📂
Column Specification: Allows the user to specify the columns (A to Z) for parcel numbers and GIS classes.
Data Transfer: Reads data from the Excel file and assigns GIS classes to corresponding objects in the Netcad project based on parcel numbers.
Completion Notification: Displays a message box indicating how many parcels’ GIS classes were updated. ✅
The macro supports polylines, areas, points, and text objects, completing the process efficiently.


Etiket ( Labels )

excelden gis aktarma, netcad makro, gis sınıfı güncelleme, harita mühendisliği, veri aktarımı, otomasyon

excel to gis transfer, netcad macro, gis class update, surveying, data transfer, automation


📝 Netcad NVB Code

VB
'' www.sabangul.com.tr Web Sayfasından İndirilmiştir
' Şaban GÜL , Harita Mühendisi
' Her Türlü Hata, İstek ve Öneriler İçin 
' haritaakademi@gmail.com veya sagulnet@gmail.com
' adresine durumu anlatan bir e-posta gönderiniz.

Sub Main
 with netcad

Dim i
 dim j
 dim o
 dim SEL
 dim xls
 dim xlspath
 dim alan
 dim DEG
 dim CL
 dim bd
 DIM U,V,R,W
 dim ruhangul
 dim elifyaren
 DIM NO(50000,2)
 DEG = ""
 CL=0:U=0:R=0
 set xls = CreateObject("excel.application")

' Excel dosyasını seçmek için diyalog kutusu oluşturur
set BD = Netcad.NewBDialog("GIS Sınıfının Excelden Alınması [Şaban GÜL]")
 BD.GetFileName "item1","Aktarım Yapılacak Excel Dosyası Seçiniz:","","Excel Dosyalari|*.xls|Tum Dosyalar|*.*","xls"
 BD.Getcombo "item2","Parsel Numarası Hangi Sütunda Bulunuyor ? ","A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z" ,0
 BD.Getcombo "item3","GIS Sınıfı Hangi Sütunda Bulunuyor ? ","A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z" ,1

if BD.showmodal then
 xlspath = BD.ValueByName("item1")
 else
 exit sub
 end if

dim saban,ruhan

saban= BD.ValueByName("item2")
 ruhan= BD.ValueByName("item3")

saban=1
 ruhan=2

' Parsel numarası sütununu belirler (A-Z)
if BD.ValueByName("item2")="A" then saban=1
 if BD.ValueByName("item2")="B" then saban=2
 if BD.ValueByName("item2")="C" then saban=3
 if BD.ValueByName("item2")="D" then saban=4
 if BD.ValueByName("item2")="E" then saban=5
 if BD.ValueByName("item2")="F" then saban=6
 if BD.ValueByName("item2")="G" then saban=7
 if BD.ValueByName("item2")="H" then saban=8
 if BD.ValueByName("item2")="I" then saban=9
 if BD.ValueByName("item2")="J" then saban=10
 if BD.ValueByName("item2")="K" then saban=11
 if BD.ValueByName("item2")="L" then saban=12
 if BD.ValueByName("item2")="M" then saban=13
 if BD.ValueByName("item2")="N" then saban=14
 if BD.ValueByName("item2")="O" then saban=15
 if BD.ValueByName("item2")="P" then saban=16
 if BD.ValueByName("item2")="Q" then saban=17
 if BD.ValueByName("item2")="R" then saban=18
 if BD.ValueByName("item2")="S" then saban=19
 if BD.ValueByName("item2")="T" then saban=20
 if BD.ValueByName("item2")="U" then saban=21
 if BD.ValueByName("item2")="V" then saban=22
 if BD.ValueByName("item2")="W" then saban=23
 if BD.ValueByName("item2")="X" then saban=24
 if BD.ValueByName("item2")="Y" then saban=25
 if BD.ValueByName("item2")="Z" then saban=26

' GIS sınıfı sütununu belirler (A-Z)
if BD.ValueByName("item3")="A" then ruhan=1
 if BD.ValueByName("item3")="B" then ruhan=2
 if BD.ValueByName("item3")="C" then ruhan=3
 if BD.ValueByName("item3")="D" then ruhan=4
 if BD.ValueByName("item3")="E" then ruhan=5
 if BD.ValueByName("item3")="F" then ruhan=6
 if BD.ValueByName("item3")="G" then ruhan=7
 if BD.ValueByName("item3")="H" then ruhan=8
 if BD.ValueByName("item3")="I" then ruhan=9
 if BD.ValueByName("item3")="J" then ruhan=10
 if BD.ValueByName("item3")="K" then ruhan=11
 if BD.ValueByName("item3")="L" then ruhan=12
 if BD.ValueByName("item3")="M" then ruhan=13
 if BD.ValueByName("item3")="N" then ruhan=14
 if BD.ValueByName("item3")="O" then ruhan=15
 if BD.ValueByName("item3")="P" then ruhan=16
 if BD.ValueByName("item3")="Q" then ruhan=17
 if BD.ValueByName("item3")="R" then ruhan=18
 if BD.ValueByName("item3")="S" then ruhan=19
 if BD.ValueByName("item3")="T" then ruhan=20
 if BD.ValueByName("item3")="U" then ruhan=21
 if BD.ValueByName("item3")="V" then ruhan=22
 if BD.ValueByName("item3")="W" then ruhan=23
 if BD.ValueByName("item3")="X" then ruhan=24
 if BD.ValueByName("item3")="Y" then ruhan=25
 if BD.ValueByName("item3")="Z" then ruhan=26

set BD = Nothing
 xls.workbooks.open(xlspath)
 xls.range("A1").select

' Excel'deki verileri okur ve diziye kaydeder
FOR U=1 TO 100000
 CL=CL+1
 NO(U,1)="*" & XLS.CELLS(U,saban)
 NO(U,2)= XLS.CELLS(U,ruhan)
 IF NO(U,2)="" THEN NO(U,2)=0
 IF NO(U,1)="*" THEN U=100000
 NEXT
 xls.quit

' Netcad objelerini seçer ve GIS sınıflarını günceller
set SEL = .NewSelectionSet
 set o = .NewObject

if SEL.SELECT("CokluDogru,Alan,Nokta ve Yazı Objelerini Seçiniz...",array(opline,oline,opoint,otext)) then

for i = 0 to SEL.NE-1
 j = SEL.GetSelectedObject(i, o)
 alan = o.objname
 on error resume next
 FOR V=1 TO CL
 W=NO(V,1)
 if W ="*" & alan then
 o.objname = NO(V,2)
 .putobject j, o
 R=R+1
 'MSGBOX alan & " : " & NO(V,1) & " : " & NO(V,2)
 V=U
 end if
 NEXT

next
 SEL.RedrawAndRewind
 end if

set SEL = nothing
 set o = nothing
 end with

' İşlem sonucunu bildirir
MSGBOX R & " adet Parselin GIS Sınıfı Değiştirildi."

end sub
VB

netcad-excel-gis-sinifi-aktar-tum

Yazar

sabangul67@gmail.com

Bu yazarın yayınladığı diğer içerikleri inceleyebilirsiniz.

Tüm yazıları