Author Topic: Visual DCL to achieve in AutoLisp  (Read 5882 times)

0 Members and 1 Guest are viewing this topic.

nonsmall

  • Guest
Visual DCL to achieve in AutoLisp
« on: April 08, 2010, 10:15:07 PM »
 8-) Hello everyone !
nonsmall works: Visual DCL dialog box automatically connect program.
The program written entirely by AutoLisp. TKS
« Last Edit: April 20, 2010, 02:51:53 AM by nonsmall »

nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #1 on: April 08, 2010, 10:18:13 PM »
show

nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #2 on: April 08, 2010, 10:24:21 PM »
This code can be all generated automatically by the Visual DCL procedures

nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #3 on: April 08, 2010, 10:26:36 PM »
DCL in Lisp

LE3

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #4 on: April 08, 2010, 10:27:42 PM »
don't do any dcl anymore.... looks good.

are you including the application that generates the dcl code?

nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #5 on: April 09, 2010, 08:15:30 AM »
NO, the application is excluded.

not only the whole dcl code,but also the initialized dcl lisp source code is generated by program, automatically.

The above lisp code & dcl code you can download, are all written by the program, no letter by me.
« Last Edit: April 09, 2010, 08:33:38 AM by nonsmall »

LE3

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #6 on: April 09, 2010, 10:07:28 AM »
NO, the application is excluded.

not only the whole dcl code,but also the initialized dcl lisp source code is generated by program, automatically.

The above lisp code & dcl code you can download, are all written by the program, no letter by me.

I see, you are showing a demo then.



Aerdvark

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #7 on: April 10, 2010, 01:44:32 AM »
Hi,

Maybe I am not looking good enough but it seems to me that the code is not to be shared?
Or am I missing a link?

Tnx.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Visual DCL to achieve in AutoLisp
« Reply #8 on: April 12, 2010, 07:37:11 AM »
This was out a little while back on Cadalyst (I think).  It's a paid program,  It never really took off. (Imo)

Here is a link to it on freecadapps

Here it is on Caddepot

It seems there website is MIA
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

aicr317

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #9 on: April 13, 2010, 04:58:55 AM »
8-) Hello everyone !
nonsmall works: Visual DCL dialog box automatically connect program.
The program written entirely by AutoLisp. TKS



不死猫,看来是“孤高和寡”了.......哈哈


nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #10 on: April 16, 2010, 03:05:37 AM »
This was out a little while back on Cadalyst (I think).  It's a paid program,  It never really took off. (Imo)

Here is a link to it on freecadapps

Here it is on Caddepot

It seems there website is MIA

The above'Visual DCL'is not really visual,it has nothing to do with me,I just transform the VB FORM into DCL,all the visualization can come true in the VB  .

nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #11 on: August 16, 2010, 11:55:43 PM »
This is part of my codes

Code: [Select]
(defun VB-DCL(export_mode view_code view_form frm_path dcl_path lsp_path /
; *h_scale *w_scale add_num all_list be control dcl_id del dialog_all dialog_h
; dialog_info dialog_key dialog_label dialog_w dialog_x dialog_y end end_string
; err_value f file frame_h frame_key frame_label frame_typ frame_w frame_x frame_y
; get get_be get_end go h i info is_cancel key key_word label layout lst lst_left
; lst_new_column lst_new_row max_range maxh maxw minx minx_info miny miny_info n
; old_range other path re return s sort_lst space str tmp typ w x y
 )
(setq path "D:\\Lisp_开发研究\\visual DCL\\")
(setq f (open frm_path "r"))
(setq key_All nil ok_cancel nil Sort_Times 0)
(setq *w_scale 100.0 *h_scale 200.0)
(read-line f)
(setq dialog_key (last (non_string_to_list (vl-string-trim " " (read-line f)) " ")))
(setq dialog_label (GetLast (read-line f)))
(setq dialog_H (/ (read (GetLast (read-line f))) *h_scale))
(setq dialog_X (/ (read (GetLast (read-line f))) *w_scale))
(setq dialog_Y (/ (read (GetLast (read-line f))) *h_scale))
(setq dialog_W (/ (read (GetLast (read-line f))) *w_scale))
(setq dialog_info (list dialog_X dialog_Y dialog_W dialog_H dialog_key dialog_label))
(while (not (vl-string-search "Begin" (setq str (read-line f)))))
(setq go 1 All_list nil dialog_all nil label "" other nil)
(while (/= go 0)
(cond
((= "End" (vl-string-trim " " str))
(setq go (1- go))
(if (= 1 go)
(setq dialog_all (append dialog_all (list (list x y w h key label typ other))) label "" other nil)
)
)
((vl-string-search "Begin VB.Frame" str)
(setq dialog_all (append dialog_all (list (OpenFrame str))) label "" other nil)
)
((vl-string-search "Begin VB." str)
(setq go (1+ go))
(setq key (last (setq tmp (non_string_to_list (vl-string-trim " " str) " "))))
(setq typ (last (non_string_to_list (cadr tmp) ".")))
)
((or (= "Tag" (GetFirst str)) (= "Caption" (GetFirst str)) (= "Text" (GetFirst str)))
(setq label (GetLast str))
)
((= "Height" (GetFirst str))
(setq h (/ (read (GetLast str)) *h_scale))
)
((= "Width" (GetFirst str))
(setq w (/ (read (GetLast str)) *w_scale))
)
((= "Left" (GetFirst str))
(setq x (/ (read (GetLast str)) *w_scale))
)
((= "Top" (GetFirst str))
(setq y (/ (read (GetLast str)) *h_scale))
)
((= "MultiSelect" (GetFirst str))
(setq other (GetLast str))
)
)
(setq str (read-line f))
)
(close f)
(setq sort_lst (sort_with_column "COLUMN" dialog_all));排出来Row+控件表+控件表 +....
(setq Space 4 Add_Num 0);增加空格Space 增加次数Add_Num
(setq get (Broken sort_lst));得到前后两段源码
(setq End_String (append (car get) (cadr get)))
(if (not ok_cancel) (setq key_All (append key_All (list (list "accept" "button" "确认") (list "cancel" "button" "取消")))))

(cond
((= export_mode "unite")
(write_Dcl_in_Lsp lsp_path frm_path)
(if (= view_code "1")(startapp "notepad" lsp_path))
)
((= export_mode "alone")
(write_dcl_only dcl_path frm_path)
(write_lsp_only lsp_path dcl_path)
(if (= view_code "1")(startapp "notepad" dcl_path))
(if (= view_code "1")(startapp "notepad" lsp_path))
)
((= export_mode 3)
(write_dcl_only dcl_path)
(write_lsp_Net lsp_path)
)
)
(if (= view_form "1")
(progn
(load lsp_path)
(c:tt)
)
)
)
« Last Edit: August 17, 2010, 08:22:47 AM by CAB »

nonsmall

  • Guest
Re: Visual DCL to achieve in AutoLisp
« Reply #12 on: August 16, 2010, 11:56:46 PM »
initget

Code: [Select]
(defun c:q( / dcl_id Dialog_Return key keys Dcl_File)
(setq reg_path "HKEY_LOCAL_MACHINE\\SOFTWARE\\Autodesk\\VB-Dcl")
(setq dcl_id (load_dialog (setq Dcl_File (Write_VB_Dcl))));对话框加载
(vl-file-delete Dcl_File)
(setq keys '("frm_path" "frm_sel" "dcl_path" "dcl_sel" "lsp_path" "lsp_sel" "unite" "alone" "view" "code" "accept" "cancel" "info"));列表全部控件名称
(foreach key keys
(set (read (strcat key "_bak")) (vl-registry-read reg_path (strcat key "_bak")))
)
(setq Dialog_Return 2)
(while (> Dialog_Return 0) ;循环控制对话框是否结束
(new_dialog "Form1" dcl_id);建立窗体
;-->-->-对话框初始化->-->--
(foreach key keys;全部控件的初始化
(if (eval (read (strcat key "_bak"))) (set_tile key (eval (read (strcat key "_bak")))));控件内容
(action_tile key "(Action_Form_Keys $key $value)");点击动作
)
;--<--<-对话框初始化完成-<--<--
(setq Dialog_Return (start_dialog));开启对话框(用户可见)
)
(unload_dialog dcl_id);退出时卸载对话框
(princ);防止函数回显
)
(defun Action_Form_Keys (key value) ;全部控件的点击动作触发
(cond
((= key "accept") ;{确认按钮}
(foreach key '("frm_path" "dcl_path" "lsp_path")
(set (read key) (get_tile key))
)
(foreach key '("unite" "alone" "dcl" "all")
(if (= (get_tile key) "1")
(setq export_mode key)
)
)
(setq view_code (get_tile "code"))
(setq view_form (get_tile "view"))
(Get_Form_Date)
(VB-DCL export_mode view_code view_form frm_path dcl_path lsp_path)
)
((= key "cancel") ;{取消按钮}
(done_dialog 0);对话框退出返回主函数 传递给Dialog_Return独立0
)
((= key "frm_sel") ; {"选择"} (按钮)
(if (vl-file-directory-p (vl-filename-directory (get_tile "frm_path")))
(setq old_path (strcat (vl-filename-directory (get_tile "frm_path")) "\\"))
(setq old_path "")
)
(if (setq path (getfiled "请选择需要转换的Frm文件" old_path "frm" 0))
(set_tile "frm_path" path)
)
)
((= key "dcl_sel") ; {"选择"} (按钮)
(if (vl-file-directory-p (vl-filename-directory (get_tile "dcl_path")))
(setq old_path (strcat (vl-filename-directory (get_tile "dcl_path")) "\\"))
(setq old_path "")
)
(if (setq path (getfiled "请确认转换后保存的Dcl文件名" old_path "dcl" 1))
(set_tile "dcl_path" path)
)
)
((= key "lsp_sel") ; {"选择"} (按钮)
(if (vl-file-directory-p (vl-filename-directory (get_tile "lsp_path")))
(setq old_path (strcat (vl-filename-directory (get_tile "lsp_path")) "\\"))
(setq old_path "")
)
(if (setq path (getfiled "请确认转换后保存的Lsp文件名" old_path "lsp" 1))
(set_tile "lsp_path" path)
)
)
((= key "info") ; {"说明"} (按钮)
(alert
(strcat
"程序作者: nonsmall \n"
"联系方式: QQ43797405 \n"
"Email : nonsmall@163.com"
)
)
)
)
)
(defun Get_Form_Date( / key)
(foreach key keys
(vl-registry-write reg_path (strcat key "_bak") (get_tile key))
)
)
(defun Write_VB_Dcl( / Dcl_File file str)
(setq Dcl_File (vl-filename-mktemp nil nil ".Dcl"))
(setq file (open Dcl_File "w"))
(foreach str '(
"/*nonsmall 作品: Visual DCL*/"
"//本代码全部由Visual DCL程序自动生成"
""
"Form1:dialog"
"{"
" label = \"Visual Dcl 全自动制作程序 V1.0\";"
"    :column"
"    {"
"        :boxed_column"
"        {"
"         key = \"Frame1\" ;"
"         label = \"路径选择\" ;"
"            :row"
"            {"
"                :edit_box"
"                {"
"                    key = \"frm_path\" ;"
"                    label = \"Frm窗体路径:\" ;"
"                    width = 76.95 ;"
"                    height = 0.9375 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"                :button"
"                {"
"                    key = \"frm_sel\" ;"
"                    label = \"选择\" ;"
"                    width = 9.75 ;"
"                    height = 1.875 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"            }"
"            :row"
"            {"
"                :edit_box"
"                {"
"                    key = \"dcl_path\" ;"
"                    label = \"输出DcL路径:\" ;"
"                    width = 76.95 ;"
"                    height = 0.9375 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"                :button"
"                {"
"                    key = \"dcl_sel\" ;"
"                    label = \"选择\" ;"
"                    width = 9.75 ;"
"                    height = 1.875 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"            }"
"            :row"
"            {"
"                :edit_box"
"                {"
"                    key = \"lsp_path\" ;"
"                    label = \"输出Lsp路径:\" ;"
"                    width = 76.95 ;"
"                    height = 0.9375 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"                :button"
"                {"
"                    key = \"lsp_sel\" ;"
"                    label = \"选择\" ;"
"                    width = 9.75 ;"
"                    height = 1.875 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"            }"
"        }"
"        :boxed_column"
"        {"
"         key = \"Frame2\" ;"
"         label = \"输出文件类型选择\" ;"
"            :row"
"            {"
"                :radio_button"
"                {"
"                    key = \"unite\" ;"
"                    label = \"Dcl+Lsp整合\" ;"
"                    width = 13.35 ;"
"                    height = 1.275 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"                :radio_button"
"                {"
"                    key = \"alone\" ;"
"                    label = \"Dcl+Lsp独立文件\" ;"
"                    width = 16.95 ;"
"                    height = 1.275 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"                :toggle"
"                {"
"                    key = \"view\" ;"
"                    label = \"完成后预览窗体\" ;"
"                    width = 15.75 ;"
"                    height = 1.275 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"                :toggle"
"                {"
"                    key = \"code\" ;"
"                    label = \"完成后查看源码\" ;"
"                    width = 15.75 ;"
"                    height = 1.275 ;"
"                    fixed_height = true ;"
"                    fixed_width = true ;"
"                }"
"            }"
"        }"
"        :row"
"        {"
"            :text"
"            {"
"                key = \"Label1\" ;"
"                width = 13.35 ;"
"                height = 1.875 ;"
"                fixed_height = true ;"
"                fixed_width = true ;"
"            }"
"            :button"
"            {"
"                key = \"accept\" ;"
"                label = \"Just Do It !\" ;"
"                width = 19.35 ;"
"                height = 1.875 ;"
"                fixed_height = true ;"
"                fixed_width = true ;"
"                is_default = true ;"
"            }"
"            :button"
"            {"
"                key = \"cancel\" ;"
"                label = \"退出\" ;"
"                width = 16.95 ;"
"                height = 1.875 ;"
"                fixed_height = true ;"
"                fixed_width = true ;"
"                is_cancel = true ;"
"            }"
"            :button"
"            {"
"                key = \"info\" ;"
"                label = \"说明\" ;"
"                width = 16.95 ;"
"                height = 1.875 ;"
"                fixed_height = true ;"
"                fixed_width = true ;"
"            }"
"            :text"
"            {"
"                key = \"Label2\" ;"
"                width = 15.75 ;"
"                height = 1.875 ;"
"                fixed_height = true ;"
"                fixed_width = true ;"
"            }"
"        }"
"    }"
"}"
)
(write-line str file))
(close file)
Dcl_File
)
« Last Edit: August 17, 2010, 08:23:24 AM by CAB »

highflyingbird

  • Bull Frog
  • Posts: 415
  • Later equals never.
Re: Visual DCL to achieve in AutoLisp
« Reply #13 on: August 17, 2010, 04:24:27 AM »
Code: [Select]
error: no function definition: NON_STRING_TO_LIST
OK,it's a good idea. Linking the VB form and DCL together,you did a good job.

Nonsmall,looks you have put them togther in real time--WYSWYG? wonderful!
I am a bilingualist,Chinese and Chinglish.