本帖最后由 黑洞—杜明智 于 2013-3-13 13:38 编辑
经过一段时间的学习,终于弄出个小东西来,来明经回馈一下,很多知识都是明经学来的。
一个图层内复制,移动,删除的小工具。
听从楼下建议附上源码,作为一个新手来供大家批评指导。(英文水平限制,用了大量的拼音)
- //dcl.dcl
- dcl_settings:default_dcl_settings {audit_level = 3;}
- chlayer : dialog {
- label = "图层对象操作";
- : row {
- : boxed_radio_column {
- label = "执行操作";
- key="Guolv";
- : radio_button {
- label = "转层(&1)";
- key = "Change";
- value = "1";
- }
- : radio_button {
- label = "复制(&2)";
- key = "Copy";
- value = "0";
- }
- : radio_button {
- label = "移动(&3)";
- key = "Move";
- value = "0";
- }
- : radio_button {
- label = "删除(&4)";
- key = "Delete";
- value = "0";
- }
-
- }
- ////////////////////////
- : column {
- : boxed_column {
- label = "图层设置";
- :row{
- :button{
- label="源图层<";
- key="YuanTuCeng";
- width=8;
- fixed_width=true;
- }
- :popup_list {
- key="YTC";
- edit_width =14;
- fixed_width=true;
- list="0" ;
- }
-
- }
- :row{
- :button{
- label="目标层<";
- key="MuBiaoCeng";
- width=8;
- fixed_width=true;
- }
- :popup_list {
- key="MBTC";
- edit_width =14;
- fixed_width=true;
- list="0" ;
- }
- }
- }
- : boxed_column {
- label="操作范围";
- : toggle {
- label = " 对源图层<全部对象>操作";
- key = "All";
- value = "0";
-
- }
- }
- }
- ///////////////////////
- }
- : boxed_column {
- : concatenation {
- : text_part {
- label = "使用帮助:";
- width=9;
- fixed_width=true;
- }
- : text_part {
- label = "QQ:307170606!";
- key = "DuiXiang";
- width=22;
- fixed_width=true;
- }
- : text_part {
- label = "";
- key = "CaoZuo";
- width=12;
- fixed_width=true;
- }
- }
- }
- ok_cancel;
- }
- ;;utils.lsp
- (vl-load-com)
- (setq *AObject* (vlax-get-Acad-Object))
- (setq *ADocument* (vla-get-ActiveDocument *AObject*))
- (setq *ModelSpace* (vla-get-ModelSpace *ADocument*))
- ;;draw.LSP
- (defun CHlayer_draw ()
- (WHILE (= SS NIL)
- (if (= 1 All_i)
- (setq ss (ssget "X" (list (cons 8 YTC_str))))
- (setq ss (ssget (list (cons 8 YTC_str))))
- )
- )
- (cond
- ((= guolv_str "Change")
- (vl-cmdf "_.change" ss "" "p" "la" MBTC_str "")
- )
- ((= guolv_str "Copy")
- (vl-cmdf "_.copy" ss "" "@" "@" "_.change" ss "" "p" "la" MBTC_str
- "")
- )
- ((= guolv_str "Move") (vl-cmdf "_.MOVE" ss ""))
- ((= guolv_str "Delete") (vl-cmdf "_.ERASE" ss ""))
- )
- (PRINC)
- )
|