10/03/2013
' TARIH : 24.01.2012
' AMAÇ : Proje-Farklı Kaydet-DXF ile yazılan dxf dosyalarının
' Autocad ortamında açılmasında yaşanan sorunları giderir.
' NCZ dosyayı sorunsuz olarak saklanması için düzenler.
'
' GEREKLİLİKLER : NCMacro 4.0.015 ve üstü versiyon.
'
' HAZIRLAYAN : Kadri Bora
' NetCAD İstanbul Bölge Müdürlüğü
'
'
sub main
'obje Rengi2TabakaRengi
objCol2LayerCol
'Tabaka Rengi Kontrllü
setLayerColor
'Tabaka Adı Kontrolü
CorrectLayerNames
'Blok Adı Kontrolü
checkBlockNames
msgbox "Proje Düzenlendi..."
end sub
sub SetLayerColor
dim i,j
with nclayermanager
for i = 0 to .numlayer-1
if .layer(i).color = 80 or _
.layer(i).color = 15 or _
.layer(i).color = 0 or _
.layer(i).color = 16 then
.layer(i).color = 4
end if
next
end with
end sub
sub objCol2LayerCol
dim i,obj
with netcad
set obj = .getobject(i)
if obj.renk 0 then
obj.renk = 0
end if
set obj = nothing
end with
end sub
sub CorrectLayerNames
dim n,i
with nclayermanager
for i = 0 to .numlayer-1
n = ucase(.layer(i).name)
n = replace(n,"Ü","U")
n = replace(n,"Ğ","g")
n = replace(n,"İ","I")
n = replace(n,"ı","I")
n = replace(n,"Ş","s")
n = replace(n,"Ç","c")
n = replace(n,"Ö","o")
n = replace(n,".","_")
.layer(i).name = UCase(n)
next
end with
end sub
sub checkBlockNames
dim i,obj
with netcad
.setfilter nothing,array(),array(oblock)
set obj = .newobject
while .getnextobject2(obj)
if obj.pname = "" then
msgbox "İsimsiz Blok Var. Lütfen İsimsiz Olan Blok Objesine Bir İsim Veriniz..."
.resetFilter
exit sub
end if
wend
.resetfilter
end with
end sub