在照明設(shè)計(jì)中,通常要計(jì)算照度,作為設(shè)計(jì)的依據(jù)。照度計(jì)算并不復(fù)雜,通過簡單的計(jì)算給出設(shè)計(jì)照度實(shí)際值。本文介紹使用Visual Lisp和Visual Studio實(shí)現(xiàn)照度計(jì)算并生成圖紙的方法。
1、照度計(jì)算依據(jù)
照度計(jì)算依據(jù)DLT5390-2014《發(fā)電廠和變電站照明設(shè)計(jì)技術(shù)規(guī)定》的附錄B:計(jì)算平均照度,對于點(diǎn)光源的計(jì)算,一般用的少,不單獨(dú)計(jì)算:
B.0.1 應(yīng)用利用系數(shù)法計(jì)算平均展讀應(yīng)按下式進(jìn)行
式中:Ec為工作面的平均照度(1x);Φ為光源光通量(1m);N為光源數(shù)量 ;K為燈具維護(hù)系數(shù),取決于房間的污穢等級、房間和燈具的清掃周期,可按本規(guī)定表7.0.4的規(guī)定取值;A為工作面面積(mm2);CU為利用系數(shù),取決于室形指數(shù)和房間的反射情況,由燈具制造廠提供。。
2、Visual Lisp實(shí)現(xiàn)照度計(jì)算
①Lisp 由于用戶界面不是很靈活,數(shù)據(jù)取自excel表或直接從圖紙中取。
對于這個(gè)照度計(jì)算,數(shù)據(jù)只能取自圖紙,首先人工填入相關(guān)數(shù)據(jù):
相關(guān)的基礎(chǔ)數(shù)據(jù)填入表格。
②計(jì)算程序:
(setq list_TQ nil)
(setq Get_Text1 nil) ;;;;;長
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 91) 0))
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 84) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_Long0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 84) 0)) ;;;;寬
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 77) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_Width0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 77) 0)) ;;;;高
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 70) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_Hihg0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 70) 0)) ;;;;被照面
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 63) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_hfe0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 63) 0)) ;;;;燈具高度
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 56) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_hre0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 56) 0)) ;;;;燈具數(shù)量
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 49) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_sum0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 49) 0)) ;;;;光通量
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 42) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_lm0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 42) 0)) ;;;功率
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 35) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_pw0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 35) 0)) ;;;;利用系數(shù)
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 28) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_cu0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Point_list01 (list (* TK_Scale2 60) (* TK_Scale2 28) 0)) ;;;;維護(hù)系數(shù)
(setq Point_list02 (list (* TK_Scale2 110) (* TK_Scale2 21) 0))
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_k0 (get_Text_1 Point_list Point_Base0 ))
(setq list_TQ (cons Get_Text1 list_TQ))
(setq list_TQ (list (reverse list_TQ)))
(setq Get_Long1 (atof Get_Long0))
(setq Get_Width1 (atof Get_Width0))
(setq Get_Hihg1 (atof Get_Hihg0))
(setq Get_hfe1 (atof Get_hfe0))
(setq Get_hre1 (atof Get_hre0))
(setq Get_sum1 (atof Get_sum0))
(setq Get_lm1 (atof Get_lm0))
(setq Get_pw1 (atof Get_pw0))
(setq Get_cu1 (atof Get_cu0))
(setq Get_k1 (atof Get_k0))
(setq Ec (/ (* Get_lm1 Get_sum1 Get_cu1 Get_k1) (* Get_Long1 Get_Width1)))
(setq RI (/ (* Get_Long1 Get_Width1) (* Get_hre1 (+ Get_Long1 Get_Width1))))
(setq PowerD (/ (* Get_sum1 Get_pw1 ) (* Get_Long1 Get_Width1)))
(setq Get_obj_B1 nil)
(setq Point_list01 (list (* TK_Scale2 110) (* TK_Scale2 14) 0)) ;;;平均照度
(setq Point_list02 (list (* TK_Scale2 60) (* TK_Scale2 21 ) 0))
(setq Point_list nil)
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_obj_B1 (get_obj_1 Point_list Point_Base0 ))
(vla-put-TextString Get_obj_B1 (rtos Ec 2 2))
(setq Get_obj_B1 nil)
(setq Point_list01 (list (* TK_Scale2 110) (* TK_Scale2 7) 0)) ;;;室型指數(shù)
(setq Point_list02 (list (* TK_Scale2 60) (* TK_Scale2 14 ) 0))
(setq Point_list nil)
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_obj_B1 (get_obj_1 Point_list Point_Base0 ))
(vla-put-TextString Get_obj_B1 (rtos RI 2 2))
(setq Get_obj_B1 nil)
(setq Point_list01 (list (* TK_Scale2 110) (* TK_Scale2 0) 0)) ;;;功率密度
(setq Point_list02 (list (* TK_Scale2 60) (* TK_Scale2 7 ) 0))
(setq Point_list nil)
(setq Point_list (append (list Point_list01) (list Point_list02)))
(setq Get_obj_B1 (get_obj_1 Point_list Point_Base0 ))
(vla-put-TextString Get_obj_B1 (rtos PowerD 2 2))
因?yàn)槿?shù)據(jù)設(shè)計(jì)圖紙的比例,因此計(jì)算相對比較復(fù)雜。
③計(jì)算結(jié)果:
計(jì)算后結(jié)果填入表格相關(guān)位置。
3、C#的實(shí)現(xiàn)方法
①C#通過視圖界面輸入數(shù)據(jù):
②計(jì)算數(shù)據(jù):
double HightB = House_Hith - House_HithB;
Ec = (Light_Number * Light_lm * Factor_CU * Factor_K) / (House_Length * House_weith);
Factor_K2 = (House_Length * House_weith) / (HightB * (House_Length + House_weith));
Power_D = (Light_Number* Light_Power)/(House_Length * House_weith);
③添加圖紙:
AcadApp.ActiveDocument.Utility.Prompt("給定插入點(diǎn):");
insertionPoint = (double[])AcadApp.ActiveDocument.Utility.GetPoint();
Function_CAD.InsertBlock(AcadApp, insertionPoint, "照度計(jì)算塊_100");
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] +8550 , House_Length.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700* 1 , House_weith.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 2, House_Hith.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 3, House_HithB.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 4, HightB.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 5, Light_Number.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 6, Light_lm.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 7, Light_Power.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 8, Factor_CU.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 9, Factor_K.ToString(), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 10, Ec.ToString("f2"), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 11, Factor_K2.ToString("f2"), 400, 0);
Function_CAD.DrawText(AcadApp, insertionPoint[0] + 8110, insertionPoint[1] + 8550 - 700 * 12, Power_D.ToString("f2"), 400, 0);
④運(yùn)行結(jié)果:
和Lisp計(jì)算的結(jié)果完全相同。
4、小結(jié)
對應(yīng)復(fù)雜的運(yùn)行和涉及大量原始數(shù)據(jù)的運(yùn)算,使用Visual Studio具有明顯的優(yōu)勢。直接取數(shù)計(jì)算,結(jié)果添加到圖形塊中,非常簡單。
相關(guān)閱讀
◆識別簡單標(biāo)識選購符合光生物安全的學(xué)生LED燈