Friday, June 14, 2013

Algorithm for Nepali date conversion


If you are looking for code to put in your website visit http://nepalidateconve.sourceforge.net/ to download php code.


.....i don't have time to read..download NepaliDateConverterAddIn.xlsm now.


The codes


Nepali date conversion consists of two parts


A. Data of number of days that occur in each month in each year. This is the reason why all the Nepali date conversion programs have its limitations


B. Algorithm to convert the date from AD to BS or vice versa.


This is explained with the code in VBA (in Excel) below with the required steps.


1. Open MS Excel


2. Open Visual Basic editor (short cut Alt + F11)


3. Insert a class module


4. Rename the class module to Nepali_Calender in Properties window (F4)


5. Paste the code 1 given at the end of this article


6. Insert a Module (normal module not class module!) and Paste the code 2 . It consists of two functions :


a. nepaliToEnglish(y,m,d,formateCode)


b. englishToNepali(y,m,d,formateCode)


where y,m,d=year, month and day and formate code will display the desired output format






















Formate code



Formate



0



20671/25



1



2067-Mangsir-25



2



2067-Mangsir-25-Saturday



7. Now close the editor


8. Save your file as *.xlsm (macro enabled)


9. Now you can use two functions made in step 6


10. To make these functions available to all the worksheets


a. save this sheet as add-ins *.xlam format


b. then enable it at Excel Options>Add in>Manage


c. the function will be available as user defined function under Insert functions


11. . In this code the limits are


a. AD 1944-2033


b. BS 2000-2089


c. if date is out of range then output is string "Out of range"


The readymade file is also available. Download NepaliDateConverterAddIn.xlsm now.


If you are looking for code to put in your website visit http://nepalidateconve.sourceforge.net/ to download php code.


Code1


Option Explicit


'the original sorce code of this program is found in sourceforge.net


'the code in php was translated to VBA


'this add-in is copyfree and can be distributed freely in multiple copies


'the user should be responsible for the use of this add in


'the author is not liable for any damage that may occur by using this add-in


'modification to the code is welcome. Any additional data in the code if notified over the internet will be usefull to all


'***********************************************************************************************************


'*******currently can only calculate the date between BS 2000-2089 and AD 1944-2033*************************


'***********************************************************************************************************


'Coder: Nirmal Raj Joshi


'@copyfree nirmaljoshi.com.np,2010


'joshi.amn@gmail.com


Private bs As Variant


Public nep_date As Dictionary


Public eng_date As Dictionary


Public debug_info


Sub initilizeClass()


ReDim bs(90)


bs(0) = Array(2000, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(1) = Array(2001, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(2) = Array(2002, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(3) = Array(2003, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(4) = Array(2004, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(5) = Array(2005, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(6) = Array(2006, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(7) = Array(2007, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(8) = Array(2008, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31)


bs(9) = Array(2009, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(10) = Array(2010, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(11) = Array(2011, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(12) = Array(2012, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30)


bs(13) = Array(2013, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(14) = Array(2014, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(15) = Array(2015, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(16) = Array(2016, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30)


bs(17) = Array(2017, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(18) = Array(2018, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(19) = Array(2019, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(20) = Array(2020, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30)


bs(21) = Array(2021, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(22) = Array(2022, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30)


bs(23) = Array(2023, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(24) = Array(2024, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30)


bs(25) = Array(2025, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(26) = Array(2026, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(27) = Array(2027, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(28) = Array(2028, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(29) = Array(2029, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30)


bs(30) = Array(2030, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(31) = Array(2031, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(32) = Array(2032, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(33) = Array(2033, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(34) = Array(2034, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(35) = Array(2035, 30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31)


bs(36) = Array(2036, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(37) = Array(2037, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(38) = Array(2038, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(39) = Array(2039, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30)


bs(40) = Array(2040, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(41) = Array(2041, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(42) = Array(2042, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(43) = Array(2043, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30)


bs(44) = Array(2044, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(45) = Array(2045, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(46) = Array(2046, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(47) = Array(2047, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30)


bs(48) = Array(2048, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(49) = Array(2049, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30)


bs(50) = Array(2050, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(51) = Array(2051, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30)


bs(52) = Array(2052, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(53) = Array(2053, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30)


bs(54) = Array(2054, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(55) = Array(2055, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(56) = Array(2056, 31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30)


bs(57) = Array(2057, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(58) = Array(2058, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(59) = Array(2059, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(60) = Array(2060, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(61) = Array(2061, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(62) = Array(2062, 30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31)


bs(63) = Array(2063, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(64) = Array(2064, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(65) = Array(2065, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(66) = Array(2066, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31)


bs(67) = Array(2067, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(68) = Array(2068, 31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(69) = Array(2069, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(70) = Array(2070, 31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30)


bs(71) = Array(2071, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(72) = Array(2072, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30)


bs(73) = Array(2073, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31)


bs(74) = Array(2074, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30)


bs(75) = Array(2075, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(76) = Array(2076, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30)


bs(77) = Array(2077, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31)


bs(78) = Array(2078, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30)


bs(79) = Array(2079, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30)


bs(80) = Array(2080, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30)


bs(81) = Array(2081, 31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30)


bs(82) = Array(2082, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30)


bs(83) = Array(2083, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30)


bs(84) = Array(2084, 31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30)


bs(85) = Array(2085, 31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30)


bs(86) = Array(2086, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30)


bs(87) = Array(2087, 31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30)


bs(88) = Array(2088, 30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30)


bs(89) = Array(2089, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30)


bs(90) = Array(2090, 30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30)


Set nep_date = New Dictionary


nep_date.Add "year", 0


nep_date.Add "month", 0


nep_date.Add "date", 0


nep_date.Add "day", 0


nep_date.Add "nmonth", 0


nep_date.Add "num_day", 0


Set eng_date = New Dictionary


eng_date.Add "year", 0


eng_date.Add "month", 0


eng_date.Add "date", 0


eng_date.Add "day", 0


eng_date.Add "emonth", 0


eng_date.Add "num_day", 0


End Sub


' /**


' * Calculates wheather english year is leap year or not


' *


' * @param integer $year


' * @return boolean


' */'


Public Function is_leap_year(year) As Boolean


Dim a, returnVal


a = year


If a Mod 100 = 0 Then


If a Mod 400 = 0 Then


returnVal = True


Else


returnVal = False


End If


Else


If a Mod 4 = 0 Then


returnVal = True


Else


returnVal = False


End If


End If


is_leap_year = returnVal


End Function


Public Function get_nepali_month(m)


Dim n_month


n_month = False


Select Case m


Case 1:


n_month = "Baishak"


Case 2:


n_month = "Jestha"


Case 3:


n_month = "Ashad"


Case 4:


n_month = "Shrawn"


Case 5:


n_month = "Bhadra"


Case 6:


n_month = "Ashwin"


Case 7:


n_month = "Kartik"


Case 8:


n_month = "Mangshir"


Case 9:


n_month = "Poush"


Case 10:


n_month = "Magh"


Case 11:


n_month = "Falgun"


Case 12:


n_month = "Chaitra"


End Select


get_nepali_month = n_month


End Function


Public Function get_english_month(m)


Dim eMonth


eMonth = False


Select Case m


Case 1


eMonth = "January"


Case 2:


eMonth = "February"


Case 3:


eMonth = "March"


Case 4:


eMonth = "April"


Case 5:


eMonth = "May"


Case 6:


eMonth = "June"


Case 7:


eMonth = "July"


Case 8:


eMonth = "August"


Case 9:


eMonth = "September"


Case 10:


eMonth = "October"


Case 11:


eMonth = "November"


Case 12:


eMonth = "December"


End Select


get_english_month = eMonth


End Function


Public Function get_day_of_week(d)


Dim day


day = False


Select Case d


Case 1:


day = "Sunday"


Case 2:


day = "Monday"


Case 3:


day = "Tuesday"


Case 4:


day = "Wednesday"


Case 5:


day = "Thursday"


Case 6:


day = "Friday"


Case 7:


day = "Saturday"


End Select


get_day_of_week = day


End Function


Public Function is_range_eng(yy, mm, dd)


Dim returnVal


returnVal = True


If (yy < 1944 Or yy > 2033) Then


debug_info = "Supported only between 1944-2022"


returnVal = False


End If


If (mm < 1 Or mm > 12) Then


debug_info = "Error! value 1-12 only"


returnVal = False


End If


If (dd < 1 Or dd > 31) Then


debug_info = "Error! value 1-31 only"


returnVal = False


End If


is_range_eng = returnVal


End Function


Public Function is_range_nep(yy, mm, dd)


Dim returnVal


returnVal = True


If (yy < 2000 Or yy > 2089) Then


debug_info = "Supported only between 2000-2089"


returnVal = False


End If


If (mm < 1 Or mm > 12) Then


debug_info = "Error! value 1-12 only"


returnVal = False


End If


If (dd < 1 Or dd > 32) Then


debug_info = "Error! value 1-31 only"


returnVal = False


End If


is_range_nep = returnVal


End Function


' /**


' * currently can only calculate the date between AD 1944-2033...


' *


' * @param unknown_type $yy


' * @param unknown_type $mm


' * @param unknown_type $dd


' * @return unknown


' */


Public Sub eng_to_nep(yy, mm, dd)


If (is_range_eng(yy, mm, dd) = False) Then


debug_info = "Out of range"


Else


' // english month data.


Dim month, lmonth


month = Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)


lmonth = Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)


Dim def_eyy, def_nyy, def_nmm, def_ndd


Dim total_eDays, total_nDays, a, day


Dim m, y, i, j


Dim numDay


def_eyy = 1944 ' //spear head english date...


def_nyy = 2000: def_nmm = 9: def_ndd = 17 - 1 ' //spear head nepali date...


total_eDays = 0: total_nDays = 0: a = 0: day = 7 - 1 ' //all the initializations...


m = 0: y = 0: i = 0: j = 0


numDay = 0


'// count total no. of days in-terms of year


For i = 0 To yy - def_eyy - 1 ' //total days for month calculation...(english)


If (is_leap_year(def_eyy + i) = True) Then


For j = 0 To 12 - 1


total_eDays = total_eDays + lmonth(j)


Next j


Else


For j = 0 To 12 - 1


total_eDays = total_eDays + month(j)


Next j


End If


Next i


'// count total no. of days in-terms of month


For i = 0 To (mm - 1) - 1


If (is_leap_year(yy) = True) Then


total_eDays = total_eDays + lmonth(i)


Else


total_eDays = total_eDays + month(i)


End If


Next i


' // count total no. of days in-terms of date


total_eDays = total_eDays + dd


i = 0: j = def_nmm


total_nDays = def_ndd


m = def_nmm


y = def_nyy


'// count nepali date from array


Do While (total_eDays <> 0)


a = bs(i)(j)


total_nDays = total_nDays + 1 ' //count the days


day = day + 1 ' //count the days interms of 7 days


If (total_nDays > a) Then


m = m + 1


total_nDays = 1


j = j + 1


End If


If (day > 7) Then


day = 1


End If


If (m > 12) Then


y = y + 1


m = 1


End If


If (j > 12) Then


j = 1: i = i + 1


End If


total_eDays = total_eDays - 1


Loop


numDay = day


nep_date("year") = y


nep_date("month") = m


nep_date("date") = total_nDays


nep_date("day") = get_day_of_week(day)


nep_date("nmonth") = get_nepali_month(m)


nep_date("num_day") = numDay


End If


End Sub


'


' /**


' * currently can only calculate the date between BS 2000-2089


' *


' * @param unknown_type $yy


' * @param unknown_type $mm


' * @param unknown_type $dd


' * @return unknown


' */


Public Sub nep_to_eng(yy, mm, dd)


Dim def_eyy, def_emm, def_edd


Dim def_nyy, def_nmm, def_ndd


Dim total_eDays, total_nDays, a, day


Dim m, y, i, j


Dim k, numDay


Dim month, lmonth


def_eyy = 1943: def_emm = 4: def_edd = 14 - 1 '// init english date.


def_nyy = 2000: def_nmm = 1: def_ndd = 1 ' // equivalent nepali date.


total_eDays = 0: total_nDays = 0: a = 0: day = 4 - 1 ' // initializations...


m = 0: y = 0: i = 0


k = 0: numDay = 0


month = Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)


lmonth = Array(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)


If (is_range_nep(yy, mm, dd) = False) Then


debug_info = "Out of range"


Else


'// count total days in-terms of year


For i = 0 To yy - def_nyy - 1


For j = 1 To 12


total_nDays = total_nDays + bs(k)(j)


Next j


k = k + 1


Next i


'// count total days in-terms of month


For j = 1 To mm - 1


total_nDays = total_nDays + bs(k)(j)


Next j


'// count total days in-terms of dat


total_nDays = total_nDays + dd


'//calculation of equivalent english date...


total_eDays = def_edd


m = def_emm


y = def_eyy


Do While (total_nDays <> 0)


If (is_leap_year(y)) Then


a = lmonth(m)


Else


a = month(m)


End If


total_eDays = total_eDays + 1


day = day + 1


If (total_eDays > a) Then


m = m + 1


total_eDays = 1


If (m > 12) Then


y = y + 1


m = 1


End If


End If


If (day > 7) Then day = 1


total_nDays = total_nDays - 1


Loop


numDay = day


eng_date("year") = y


eng_date("month") = m


eng_date("date") = total_eDays


eng_date("day") = get_day_of_week(day)


eng_date("emonth") = get_english_month(m)


eng_date("num_day") = numDay


End If


End Sub


Code 2


Public Function nepaliToEnglish(yy, mm, dd, formate)


' this function depends on Nepali_calander class


'@copyfree nirmaljoshi.com.np,2010


'formateType default=2010/1/25


'formateType 1=2010-jan-25


'formateType 2=2010-jan-25-saturday


If IsMissing(formate) Then formateType = 0


'MsgBox formateType


Dim a As Nepali_Calender


Set a = New Nepali_Calender


Call a.initilizeClass


Call a.nep_to_eng(yy, mm, dd)


If a.debug_info = "" Then


Select Case formate


Case 1:


output = a.eng_date("year") & "-" & a.eng_date("emonth") & "-" & a.eng_date("date")


Case 2:


output = a.eng_date("year") & "-" & a.eng_date("emonth") & "-" & a.eng_date("date") & "-" & a.eng_date("day")


Case Else:


output = a.eng_date("year") & "/" & a.eng_date("month") & "/" & a.eng_date("date")


End Select


Else


output = a.debug_info


End If


nepaliToEnglish = output


End Function


Public Function englishToNepali(yy, mm, dd, formate)


' this function depends on Nepali_calander class


'@copyfree nirmaljoshi.com.np,2010


'formateType default=20671/25


'formateType 1=2067-mangsir-25


'formateType 2=2067-mangsir-25-saturday


If IsMissing(formate) Then formateType = 0


'MsgBox formateType


Dim a As Nepali_Calender


Set a = New Nepali_Calender


Call a.initilizeClass


Call a.eng_to_nep(yy, mm, dd)


If a.debug_info = "" Then


Select Case formate


Case 1:


output = a.nep_date("year") & "-" & a.nep_date("nmonth") & "-" & a.nep_date("date")


Case 2:


output = a.nep_date("year") & "-" & a.nep_date("nmonth") & "-" & a.nep_date("date") & "-" & a.nep_date("day")


Case Else:


output = a.nep_date("year") & "/" & a.nep_date("month") & "/" & a.nep_date("date")


End Select


Else


output = a.debug_info


End If


englishToNepali = output


End Function


Monday, November 12, 2012

Hydrological stations of Nepal

Here is list of hydrological station of Nepal installed by department of hydrology and meterology. The location of these places can be seen by downloading this google earth file "hydrologicalStationOfNepal.kml".









stations.jpg







The data listed below can be downloaded as excel file here.




























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































SNStation No.Name of the RiverLocation NameLatitude

Longitude

Elevation mDrainage Area sq. kmStart of RecordEnd of Record
1120Chamelia RiverKarkale Gaon294020803330724115001/01/65
2169Surnaya GadGujar Gaon29310803501275


3170Sumagad RiverPatan near Baitadi292730803310111018823/05/69
4220Tila NalaNagma29190815501935187019/03/64
5225Sinja KholaDiware2919081550194382417/03/64
6240Kamali RiverAsara Ghat2857108126306291926001/01/61
7250Karnali RiverBenighat285740817103202124001/02/63
8260Seti RiverBanga Near Bel Gaon28574081840328746006/02/63
9262Thuli GadKhanayatal Near Bel Gaon2856108058031489617/06/65
10265Thulo Bheri RiverRimna284230821730550672018/06/72
11270Bheri RiverJamii284520812102461229023/01/63
12280Kamali RiverChisa Pani2838408117301914289001/01/62
13286Sarada KholaDaredhunga28175882130579
26299
14290Babai Riverbargadha282520812210192300016/07/66
15330Mari KholaNaya Gaon2842082480536198001/01/64
16339.5Jhimruk KholaTigra Gaon283082494076268322/05/71
17340Jhrimruk KholaKalimati Ghat282108253069269601/01/6521/05/71
18350Rapti RiverBagasoti Gaon2754082510381338008/05/75
19360Rapti RiverJalkundi275650821330218515008/04/64
20375Rapti RiverKusum2802782535235
21/12/2002
21390Tinau KholaButwal27421083275018455409/12/63
22395Banganga RiverBangachia2749508364057134701/01/66omitted
23404.7Myagdi KholaMangia Ghat28213083320914111219/05/75
24410Kali GandakiSeti Beni28030833610546663021/02/64
25415Andhi KholaDuinrichaur, Andhimuhan27582083352054347606/04/64
26417Badigad KholaRudrabeni, Gulmi275820832810731199024/05/67
27419Kali GandakiAngsing27532483480351.05
13/04/1989
28420Kali GandakiKota Gaon274508420501981140015/04/64
29428Mardi KholaLahachok28183084205091516007/06/70
30430Seli RiverPhoolbari28140840083058201/01/64omitted
31438Madi KholaShisa Ghat28608414045785808/02/73
32439Marsandi RiverBimalnagar27570842548354
31/03/87
33439.3Khudi KliolaKliudi Bazar28171584214599015104/07/81
34439.7Marsyangdi RiverBimal Nagar27570842548354377431/03/87
35439.8Marsyangdi RiverGopling Ghat275535842942320385001/06/7324/06/88
36440Chepe KholaGarani Besi2834184292344230820/11/63
37445Burhi GandakiAru Ghat28237844859485427028/11/63
38446Phalanku KholaBetrawati275825851115630
24/2/69
39446.8Phalandu KholaBetrawati27582585111563016224/04/69
40447Trisuli RiverBetrawati2758885110600411001/04/67
41448Tadi KliolaTadi Pool, Belkot2751358581847565314/06/68
42450Narayani RiverNarayan Ghat2742308425501803110010/02/62
43460Rapli RiverRajaiya27263084581533257901/01/63
44465Manahari RiverManahari2733084481030542713/06/63
45470Lotliar KliolaLothar2735408443033616930/11/63
46475Kliageri KliolaTikauli2737208430019511801/08/64omitted
47480Kair KliolaJurrpani2740408433402418001/01/64omitted
48485Buri RaptiChitrasari2737084291518918401/01/6420/07/88
49505Bagamati RiverSundarijal2763085271016001707/12/62
50507Nagmati RiverSundarijal27462085261016601301/11/6327/08/92
51510SialmatiShyamdado2746108525101660301/11/6328/08/92
52530Bagmati RiverGaurighat2742308521013006815/11/64
53536.2Bislmumati KliolaBudhanilkantha2746498521321454427/05/6827/08/92
54540Nakliu KholaTika Bhairab27343085185014004323/11/6218/04/88
55550Bagmati RiverChovar273940851750128058508/07/62omitted
56560Thado KholaDarkot- Markhu273620859018301401/01/64omitted
57565Kulekhani KholaLamichaur27361385939151412217/07/7509/12/78
58570Kulekhani KholaKulekhani27351085930148012601/12/6215/11/77
59589Bagamati RiverPandhera Dovan27620852830180270028/01/79
60590Bagmati RiverKamiaiya, Mangalpur27620852830177272021/06/6417/10/84
61600Arun RiverUwa Goan27360872061294
26608
62600.1Arun RiverUwa Gaon273608720612942675011/05/72
63602Sabhaya KholaTumlingtar27182087131530537502/01/74
64604Arun RiverTurkeghat27200871130414
23/05/75
65604.5Arun RiverTurkeghat272008711304142820023/05/75
66606Arun RiverSimie2655308793015230380

67610Bhote KoshiBarabise274710855320840241017/02/65
68620Balaphi KholaJalbire27482085461079362925/12/63
69625Sunkoshi RiverDolalghat28383085430



70627Melanchi KholaHelambu28230853202134


71627.5Melamchi KholaHelambu2823085320213484

72629Indrawati RiverDolalghat273820854230

26559
73630Sun KoshiPachuar Ghat273330854510589492026/03/64
74640Roshi KholaPanauti27345085305014808717/10/63
75647Tama KoshiBusti2738586512849275314/01/70
76650Khimti KhoalRasnalu Village273430861150152031306/04/64
77652Sun KoshiKhurkot2720086004551000001/07/67
78660Likhu KliolaSangutar27201086131054382324/03/64
79665Sunkoshi RiverTokselghat27103086220

20/02/1986
80668.4Taktor KliolaBeni273145863330235087/76
81670Dudli KosliiRabuwa Bazar27160863950460410010/03/64
82680Sun KosliiHampuachuwar2652308649202001760028/06/65
83684Tamur Majliitar
279308742455334076

84690Tamur RiverMulghat265550871945276564011/03/65
85695Sapta KoshiChatara-Kothu26520879301405410001/01/77
86728Mai KholaRajdwil26524587554560937701/01/83
87730Puwa KliolaSajbote Ham2655087544080210718/01/65
88738MaikholaRajdwali265245875545609
30317
89770Kankai Mai RiverChepti264350875230140115021/02/6429/08/74
90795Kankai Mai KholaMainachuli264112875244125114801/05/71

Wednesday, August 8, 2012

Autocad calculation using fields and blocks

While drafting in AutoCAD, sometimes we come to situation where we need to upadate some text based on values of other text (similar to using formulas as in excel). In such case we can use FIELDS of Autocad to do our calculations and update the drawings automatically.


Basics:


The basic method to use field is very easy. Try following steps to get the idea.


>>MTEXT (type some number say 151) and click ok


>>MTEXT>Instert Field (or directly use FIELD command) : a dialog box will appear as shown below



field.PNG


-Select Field category: Objects


-Field names: Formula


-In Formula filed: right click >insert field : this will open new field window (the idea is use field value within another field)


-In this new Filed dialog box choose


-Filed names: Objects


-Objet type:Select the Mtext with the input number


-Property:Contents


-Click Ok



field2.PNG


Now in the original window there will be some value like 151 at the end type *2 so the content will look like 151*2


-Click ok


The new Mtext will change to value showing 302.


-To edit the formula, double click the field.


Now if the first Mtext value is changed to 100 from 151 then after REGENERATEing the drawing. The field will show 200.



For blocks



The fields will work not only in Mtext but also in Block attributes, hence making life easy to create blocks which has multiple values based on some formula of few input parameters. For eg a scale block (as shown below). However, there are few differences. A sample method is given below using example of scale block:



scaleautocad.PNG


- Draw the shapes (lines, hatch etc)


-Define block attributes (name them L1, R1,R2,R3,R4,R5,SCALE) (i made SCALE as hidden so that it will not be visible and will be used for calculation only) also i made all tags prompting to "DO NOT EDIT" as you will see later as these values should be updated automatically).


-Create block using BLOCK command


Now double click the box to change attibute value (say for value of L1).


-in Value field >right click>edit field


Now the field dialog box appears as discussed above.


-Select formula in field name


-in formula right click >Add fileds


New field dialog box appears


-select Object in field names


-select the Block that you had just created in Object type


-all tags will appear in the property (L1, R1,R2,R3,R4,R5,SCALE)


-Chose the tag that you want to use (here SCALE). Click ok


Back in the formula write the required formula using this variable (eg 1000*50)


-Click ok


Close all the dialog box


Now if you change value of SCALE tag and regenerate, the value of L1 will change according to the formula specified.


Repeat the process for all the tags to get required value.



field2.PNG