必强工具箱
本帖最后由 1291500406 于 2019-1-22 08:55 编辑http://bbs.mjtd.com/thread-178920-1-1.html
先分享我的词库给大家使用 命令ccv
我的工具箱还没完成,所有就没分享出来
本帖最后由 1291500406 于 2019-1-13 17:05 编辑
孤云寒霜 发表于 2018-12-16 13:09
楼主我也想做一个类似工具箱的东西把零散的lisp整合在一起请问你有相关的教程没
;这个面版比较适合你们整合lisp
;这些是我这三个月来自学lisp的总结
;其他的面板需了解 百度一下rowcolumn button keylabelboxed_columnimageimage_button action_tilestart_dialog等等
; 启动面板命令bb --> (defun c:bb() )
(defun c:bb()
(mai_make_panel
(list
(list "选择线型"
(list "时间1" "time1")
(list "山海不可平" "bbb")
(list "380V:LJ-25" "bbqg380")
(list "380V:BLV-25" "bbqg380b")
(list "380V:JKLYJ-50" "bbqg380g")
(list "220V:LGJ-16" "bbqg220")
(list "220V:BLV-16" "bbqg220b")
(list "220V:JKLYJ-35" "bbqg220g")
(list "JKLYJ-10/240" "bbq240")
(list "JKLGYJ-240" "bbq240g")
(list "YJV22/10" "bbq10dl")
(list "JKLYJ-10/150" "bbq10")
(list "JKLGYJ-10/150" "bbq10g")
(list "JKLYJ-10/95" "bbq109")
(list "JKLGYJ-10/95" "bbq109g")
(list "JKLYJ-10/70" "bbq107")
(list "JKLGYJ-10/70" "bbq107g")
(list "JKLYJ-1/150" "bbq150")
(list "JKLYJ-1/70" "bbq70")
(list "BS1-JKLYJ-4*120" "bbq12j")
(list "BS1-JKLYJ-4*70" "bbq70j")
)
(list "必强程序"
(list "线长叠加" "ww")
(list "交点断线" "bbqba")
(list "边线延伸" "bbqbal")
(list "线长录入" "bbqbb")
(list "线长列数" "bbqbb1")
(list "等分标注" "bbqbc")
(list "单一标注" "bbqbcl")
(list "连续标注" "bbqbcc")
(list "标注对齐" "bbqdqq")
(list "画线标注" "bbqpll")
(list "记忆复制" "bbqbd")
(list "动态复制" "arr")
(list "自由复制" "bbqvv")
(list "复制旋转" "bbqbv")
(list "线转多段" "bbqll")
(list "信息查询" "bbqk")
(list "英文词典" "bbqfy")
(list "点读机" "bbqwd")
(list "文字避让" "bbqwz")
(list "必强工具箱" "bbqnn")
(list "贱人工具箱" "y")
)
(list "材料统计"
(list "计算器" "bbqbaf")
(list "线长分层计算" "bbqqql")
(list "线长求和" "bbqqw")
(list "公式计算" "bbqqe")
(list "精细求和" "bbqqr")
(list "统计图块" "bbqqq")
(list "快速选择" "bbqkx")
(list "线型查找" "bbqxz")
(list "高压km公式" "bbq10k")
(list "高压m公式" "bbq10m")
(list "低压km公式" "bbq380k")
(list "低压m公式" "bbq380m")
(list "下户线公式" "bbq220")
(list "电缆拉管公式" "bbqlgk")
(list "电缆排管公式" "bbqpgk")
(list "xls -> 显" "bbqexx")
(list "txt -> 显" "bbqtxx")
(list "cad -> xls" "bbqcxe ")
(list "cad <- xls" "bbqexc")
(list "cad -> txt" "bbqcxt ")
(list "cad <- txt" "bbqtxc")
)
(list "绘图程序"
(list "画点" "POINT")
(list "画直线" "LINE")
(list "画多段线" "PLINE")
(list "画射线" "XLINE")
(list "多线" "MLINE")
(list "样条曲线" "SPLINE")
(list "正多边形" "POLYGON")
(list "矩形" "RECTANGLE")
(list "画圆" "CIRCLE")
(list "圆弧" "ARC")
(list "圆环" "DONUT")
(list "椭圆" "ELLIPSE")
(list "圆弧" "ARC")
(list "圆弧" "ARC")
(list "格式刷" "MATCHPROP")
(list "标注" "DIMALIGNED")
(list "移动" "MOVE")
(list "删除" "ERASE")
(list "复制" "COPY")
(list "旋转" "ROTATE")
(list "打断" "BREAK")
)
(list "系统工具"
(list "我的电脑" "bbqbqdn")
(list "文字查找" "bbqcz")
(list "炸开" "EXPLODE")
(list "修剪" "TRIM")
(list "拉伸" "STRETCH")
(list "正交" "ORTHO")
(list "置层" "DRAWORDER")
(list "平移" "PAN")
(list "阵列" "ARRAY")
(list "镜像" "MIRROR")
(list "窗口" "ZOOM")
(list "单位" "DDUNITS")
(list "文字样式" "DDSTYLE")
(list "捕捉全开" "bbq0")
(list "光栅图像" "Imageattach")
(list "图像裁剪" "IMAGECLIP")
(list "显示特性" "bbq7")
(list "连接交线" "CHAMFER")
(list "修改交点" "CHANGE")
(list "文件路径" "gcm")
(list "选项设置" "PREFERENCES")
)
(list "文本编辑"
(list "文本编辑" "bbqdtx")
(list "快速写字" "bbqzt")
(list "文本对齐" "bbqdq")
(list "文本左对齐" "bbqw1")
(list "文本居中" "bbqw2")
(list "文本右对齐" "bbqw3")
(list "对齐高度" "bbqw4")
(list "标注改高度" "bbqbgg")
(list "文字改高度" "bbqtgg")
(list "刷内容" "bbqsnr")
(list "文字垂直" "bbqwc")
(list "Y轴垂直排版" "bbqwcl")
(list "阵列递增" "bbqbhh")
(list "修改文字" "bbqbg")
(list "文字加框" "bbqwzk")
(list "文字打散" "bbqwds")
(list "文字合并" "bbqwhb")
(list "文字互换行" "bbqwzh")
(list "文字换角度" "bbqwjd")
(list "Ab互转" "bbqwzk")
(list "修改内容" "bbqgw")
)
(list "专一工具"
(list "专选标注" "bbqx1")
(list "专选标注并x" "bbqx2")
(list "专选 mt并x" "bbqx3")
(list "专选dt字体" "bbqzxt")
(list "专选直线" "bbqzxl")
(list "专选圆" "bbqzxc")
(list "按颜色选择" "bbqysx1")
(list "相同字选字" "bbqxz2")
(list "颜色且相同字" "bbqysx2")
(list "模糊选字" "bbqxz")
(list "专删直线" "bbqqx")
(list "专删图块" "bbqqk")
(list "专删点" "bbqqd")
(list "专删标注" "bbqqz")
(list "专删椭圆" "bbqqty")
(list "专删圆" "bbqqy")
(list "专删 dt字" "bbqqdt")
(list "专删 mt字" "bbqqmt")
(list "专删圆弧" "bbqqyh")
(list "专删样条曲线" "bbqqyt")
(list "专删重复线" "bbqqcf")
)
(list "图层管理"
(list "单关图层" "bbqdgg")
(list "单开图层" "bbqdkk")
(list "全开图层" "bbqqkk")
(list "单开置当前" "bbqtcsq")
(list "所选置0" "bbqtcy0")
(list "单锁图层" "bbqtcds")
(list "单解锁图层" "bbqtcdj")
(list "解锁全部" "bbqtcjd")
(list "单冻图层" "bbqtcdd")
(list "解冻全部" "bbqbaq")
(list "解锁解冻全开" "bbqtcqjs")
(list "ABBS裁剪" "abbs")
(list "圆中线裁剪" "bbqbcj")
(list "PU清理" "bbqql")
(list "画线裁剪" "bbqjq")
(list "模糊圈字" "bbqxz1")
(list "引线备注" "bbqsty")
(list "动态拉伸" "bbqls")
(list "最近连线" "bbqblx")
(list "画射线" "bbqhsx")
(list "画折线" "bbqlzd")
)
)
)
(princ)
)
(defun mai_make_panel ( menulist / n num_nobut num_button nn nnn menuname val_lst add_dclrow tt order_lst in num_image)
(defun add_dclrow ( dstr / ) (if dstr (setq val_lst (cons dstr val_lst))))
(setq menuname (strcat (vl-filename-mktemp) "temp_pannel.dcl"))
(add_dclrow "curbutton:button{width=10;vertical_margin=none;vertical_margin=none;}")
(add_dclrow "curimage:image{width=10;height=0.2;vertical_margin=none;vertical_margin=none;}")
(add_dclrow "curpanel:dialog{label=\"必强工具箱 作者:石必强 一花一世界一木一追寻QQ:1291500406\";alignment=centered;vertical_margin=none;horizontal_margin=none;")
(add_dclrow ":row{")
(setq len (apply 'max (mapcar 'length menulist))
order_lst (apply 'append (mapcar 'cdr menulist))
num_button 0
num_nobut 0
in 0
num_image 0
)
(foreach nn menulist
(setq in 0)
(add_dclrow (strcat " : boxed_column{label=\"" (car nn) "\";vertical_margin=none; horizontal_margin=none;"))
(foreach nnn (cdr nn)
(setq num_button (1+ num_button)
in (1+ in)
num_image (1+ num_image)
tt (car nnn)
tt (if tt tt "")
)
(add_dclrow (strcat ":curbutton{label=\"" tt "\";key=\"but" (itoa num_button) "\";}"))
(if (= 4 in)
(progn (add_dclrow (strcat ":curimage{key=\"ima" (itoa num_image) "\";color=18;}"))
(setq in 0)
)
)
)
(repeat (- len (length nn))
(setq num_nobut (1+ num_nobut)
in (1+ in)
num_image (1+ num_image)
)
(add_dclrow (strcat " : curbutton{key=\"butno" (itoa num_nobut) "\";color=-2;}"))
(if (= 4 in)
(progn (add_dclrow (strcat ":curimage{key=\"ima" (itoa num_image) "\";}"))
(setq in 0)
)
)
)
(add_dclrow "spacer;}")
)
(add_dclrow "}:button{label=\"关闭程序\";key=\"cancel\";is_cancel=true;width=10;fixed_width=true;alignment=centered;}}")
(vl-file-delete menuname)
(setq nn (open menuname "w"))
(foreach n (reverse val_lst) (write-line n nn))
(close nn)
(setq nnn (load_dialog menuname))
(if (not (new_dialog "curpanel" nnn)) (exit))
(setq n 0)
(repeat num_nobut (mode_tile (strcat "butno" (itoa num_nobut)) 1) (setq num_nobut (1- num_nobut)))
(foreach nn menulist
(foreach nnn (cdr nn)
(setq n (1+ n)
tt (car nnn)
tt (if tt tt "")
)
(if (= tt "")
(mode_tile (strcat "but" (itoa n)) 1)
(action_tile (strcat "but" (itoa n)) (strcat "\(done_dialog " (itoa n) "\)"))
)
)
)
(setq nn (start_dialog))
(unload_dialog nnn)
(vl-file-delete menuname)
(if (> nn 0)
(progn (setq tt (cadr (nth (1- nn) order_lst)))
(princ "\n")
(if (= (eval (read (strcat "(type c:" tt ")"))) 'SUBR)
(eval (read (strcat "(c:" tt ")")))
(vl-cmdf tt)
)
)
)
)
; (list "按钮名称" "命令")
; 启动命令bbb --> (defun c:bbb () )
(defun c:bbb ()
(alert (strcat " 夕岚分彩翠,高树藏莺声\n乍向风中看,花落更分明 \n徘徊觉露冷,清宵月影横\n泠泠砭肌发,疑是晓寒生\n 一望可相见,一步如重城\n所爱隔山海,山海不可平\n所思隔云端,奈何凡肉身\n愚公不复见,精卫长泣鸣\n天神犹降怜,谁可恨终生\n海有舟可渡,山有路可行\n此爱翻山海,山海俱可平\n可平心中念,念去无自唏\n但可寻所爱,永不弃已心 ")
))
;复制其他程序
本帖最后由 1291500406 于 2019-1-19 16:07 编辑
hn10183051 发表于 2019-1-12 09:23
面板有了,怎么把LSP或者vlx 、fas等代码加入进去呢?
lsp 才是代码 ,vlx fas 并非是代码,你想把lsp加到面板很简单,要看你使用的是哪种面板,老迈的面板 加lsp到面板,只要改list 名称 命令 ,其他面板 需要用 改 key = 按钮label = 名称 再 (action_tile "按钮" "(done_dialog 3)") 再(setq bb (START_DIALOG)) (if (= bb 3) (c:命令))
vlx fas 并非是代码,只能用调用加载方式加入你的面板,来启动这个vlx
(defun y()(setq a (findfile "y.vlx")) (if a (load "y.vlx"))(c:y) (princ))
还有一种方法是 fasvlx 反编译为 lsp盗取源码到是能 整合 成一个vlx 那样做就太不尊重作者了 能分享源码不:lol 天下逍遥 发表于 2018-12-14 19:42
能分享源码不
发布了一个语音报时源码 做的很漂亮,期待你的好作品!!!不过个人感觉下面的大按钮颜色有点怪怪的 本帖最后由 1291500406 于 2018-12-14 22:00 编辑
liwen888888 发表于 2018-12-14 20:25
做的很漂亮,期待你的好作品!!!不过个人感觉下面的大按钮颜色有点怪怪的
我再调整调整,谢谢你的建议 liwen888888 发表于 2018-12-14 20:25
做的很漂亮,期待你的好作品!!!不过个人感觉下面的大按钮颜色有点怪怪的
我调整好了:lol,来欣赏一下吧 本帖最后由 1291500406 于 2018-12-18 10:44 编辑
liwen888888 发表于 2018-12-14 20:25
做的很漂亮,期待你的好作品!!!不过个人感觉下面的大按钮颜色有点怪怪的
按钮怪怪的原因是用了CAI值,没有用RGB值 看着还不错啊 看着还不错,功能不少 还行吧,我三年前就达到楼主这个程度了,加油搞,楼主