大家好,我是空调冷却技术员。
大约两年来,我一直在尝试学习 autolisp 并编写一个 autolisp 程序。我的程序是关于风管计算和绘图的。我将风道路线绘制为一条线。我在空气扩散器的地方写了空气流量。程序计算各部分的空气流量,根据等摩擦法调整大小,绘制模型空间。我希望用户能够为绘图选择一些参数。我为此创建了一个 DCL。零件编号(toogle),图层(popup_list)颜色(popup_list)文本高度(edit_box)。用户应该能够从这里设置他想要打印的文本的属性(图层、颜色、文本高度)。我想做的是:
1- 图层弹出列表应该是活动图形中的图层列表。
2- 颜色弹出列表应该类似于属性工具栏中的弹出窗口。
我会感谢任何可以提供帮助的人。谢谢你。
我的 dcl 代码:
- Cizparam : dialog {
- label ="Çizim Parametreleri";
- width = 30;
- height = 20 ;
- : boxed_column {
- label ="Yazdırma Seçenekleri";
- :row {
- : column {
- : row { : toggle { key = "Pndim_tog"; label = "Parça Numarası " ; alignment = centered ;}}
- : row { : toggle { key = "Kndim_tog"; label = "Kanal Ebadı " ; alignment = centered ;}}
- : row { : toggle { key = "AFdim_tog"; label = "Hava Debisi " ; alignment = centered ;}}
- : row { : toggle { key = "Padim_tog"; label = "Basınc Kaybı " ; alignment = centered ;}}
- : row { : toggle { key = "Vldim_tog"; label = "Hava Hızı " ; alignment = centered ;}}
- : row { : toggle { key = "Ftdim_tog"; label = "Fittings Adı " ; alignment = centered ;}}
- }
- : column {
- : row { : popup_list { label = "Layer:" ; key = "PnoLay_lst"; alignment = centered ; value = "1" ;}}
- : row { : popup_list { label = "Layer:" ; key = "KnELay_lst"; alignment = centered ; value = "0" ;}}
- : row { : popup_list { label = "Layer:" ; key = "AflLay_lst"; alignment = centered ; value = "0" ;}}
- : row { : popup_list { label = "Layer:" ; key = "PamLay_lst"; alignment = centered ; value = "0" ;}}
- : row { : popup_list { label = "Layer:" ; key = "VelLay_lst"; alignment = centered ; value = "0" ;}}
- : row { : popup_list { label = "Layer:" ; key = "FttLay_lst"; alignment = centered ; value = "0" ;}}
- }
- : column {
- : row { : popup_list { label = "Color:" ; key = "PnoClr_lst"; alignment = centered ; value = "8" ;}}
- : row { : popup_list { label = "Color:" ; key = "KnEClr_lst"; alignment = centered ; value = "8" ;}}
- : row { : popup_list { label = "Color:" ; key = "AflClr_lst"; alignment = centered ; value = "8" ;}}
- : row { : popup_list { label = "Color:" ; key = "PamClr_lst"; alignment = centered ; value = "8" ;}}
- : row { : popup_list { label = "Color:" ; key = "VelClr_lst"; alignment = centered ; value = "8" ;}}
- : row { : popup_list { label = "Color:" ; key = "FttClr_lst"; alignment = centered ; value = "8" ;}}
- }
- : column {
- : row { : edit_box { key = "Pno_eb"; label = "Yazı Yüksekliği :" ; edit_width = 3; fixed_width = true; allow_accept = false; alignment = centered ;}}
- : row { : edit_box { key = "KnE_eb"; label = "Yazı Yüksekliği :" ; edit_width = 3; fixed_width = true; allow_accept = false; alignment = centered ;}}
- : row { : edit_box { key = "Afl_eb"; label = "Yazı Yüksekliği :" ; edit_width = 3; fixed_width = true; allow_accept = false; alignment = centered ;}}
- : row { : edit_box { key = "Pam_eb"; label = "Yazı Yüksekliği :" ; edit_width = 3; fixed_width = true; allow_accept = false; alignment = centered ;}}
- : row { : edit_box { key = "Vel_eb"; label = "Yazı Yüksekliği :" ; edit_width = 3; fixed_width = true; allow_accept = false; alignment = centered ;}}
- : row { : edit_box { key = "Ftt_eb"; label = "Yazı Yüksekliği :" ; edit_width = 3; fixed_width = true; allow_accept = false; alignment = centered ;}}
- }
- }
- : row { width = 50; fixed_width = true; alignment = centered ;
- : button { key = "Accept"; label = "Tamam"; width = 15; fixed_width = true; alignment = left; is_default = true; is_cancel = false; mnemonic = "T"; }
- : button { key = "Cancel"; label = "Iptal"; width = 15; fixed_width = true; alignment = left; is_default = false; is_cancel = true; mnemonic = "I"; }
- : button { key = "Hlp"; label = "Yardım"; width = 15; fixed_width = true; alignment = left; is_default = false; mnemonic = "Y"; }
- }
- }
- } // dialog end.
还有下面的这个程序。 - (defun c:Cpr ( / LayL ClrL Dclid_Cp CzPar)
-
- (setq LayL (list "MK-HV Kanal SUPPLY" "MK-HV Kanal FRESH" "MK-HV Kanal RETURN" "MK-HV Kanal EGZOST" "MK-HV Kanal YAZI")
- ClrL (list "ByLayer" "ByBlock" "1 Red" "2 Yellow" "3 Green" "4 Cyan" "5 Blue" "6 Magenta" "7 White" "Select Color..."))
-
- (setq Dclid_Cp (load_dialog "DrwParam.DCL"))
- (if (not (new_dialog "Cizparam" Dclid_Cp))(exit)
- (progn
- (start_list "PnoLay_lst")(mapcar 'add_list LayL)(end_list) ; Parça numarası yazısı layeri ( Part Number Text Layer)
- (start_list "PnoClr_lst")(mapcar 'add_list ClrL)(end_list) ; Parça numarası yazı rengi ( Part number text layer color)
- (start_list "KnELay_lst")(mapcar 'add_list LayL)(end_list) ; Parça Ebadı yazısı ( Part Dimension Text Layer)
- (start_list "KnEClr_lst")(mapcar 'add_list ClrL)(end_list) ; Parça Ebadı yazı rengi ( Part Dimension text layer color)
- (start_list "AflLay_lst")(mapcar 'add_list LayL)(end_list) ; Hava debisi yazısı ( Airvolume Text Layer)
- (start_list "AflClr_lst")(mapcar 'add_list ClrL)(end_list) ; Hava debisi yazı rengi ( Airvolume text layer color)
- (start_list "PamLay_lst")(mapcar 'add_list LayL)(end_list) ; Basınc kaybı yazısı ( Pressure lose Text Layer)
- (start_list "PamClr_lst")(mapcar 'add_list ClrL)(end_list) ; Basınc kaybı yazı rengi ( Pressure lose text layer color)
- (start_list "VelLay_lst")(mapcar 'add_list LayL)(end_list) ; Hava hızı yazısı ( AirVelocity Text Layer)
- (start_list "VelClr_lst")(mapcar 'add_list ClrL)(end_list) ; Hava hızı yazı rengi ( AirVelocity text layer color)
- (start_list "FttLay_lst")(mapcar 'add_list LayL)(end_list) ; Fitingsno yazısı ( Fittings Number Text Layer)
- (start_list "FttClr_lst")(mapcar 'add_list ClrL)(end_list) ; Fitingsno yazı rengi ( Fittings Number text layer color)
-
- (action_tile "Accept" "(done_dialog 1)")
- (action_tile "Cancel" "(done_dialog 0)")
- (setq CzPar (start_dialog))
- (unload_dialog Dclid_Cp)
- (if (= CzPar 1) (alert "Çizim Parametreleri Kaydedildi.!!"))
- (if (= CzPar 0) (alert "Çizim Parametreleri Kaydedilmedi.!!"))
- )
- )
- )
|