nalsur8 发表于 2022-7-5 23:24:58

命令行输入更改为D

此处编码命令行输入
可以帮助我使用DCL对话框进行更改
 

 
(defun c:bll (/ a b c d num pt ds lg p1 p2 ang p3 ht cd p4 pt5)
;;    Tharwat 26. Jan. 2014      ;;
;; edited by nalsur8 11/02/2014
;;===== add 12022014 ======
(setq os (getvar "osmode"))
(setvar "osmode" 512)
(if (not job#)
   (setq job# (getstring "\nJob Number :"))
   (setq job# job#)
)                                        ;if

(if (= (setq ds (getvar "dimscale")) 0.0)
   (setq ds 1.)
)
(setq lg (+ (* ds (getvar "dimasz")) 3))

(if (not num)
   (setq num (getint "\n Starting Item #: "))
   (setq num num)
)                                        ;if
(setq split (getstring "\nSaparate Plate? Y,N :"))
(if (= split "Y")
   (progn
   (initget 1 "A B C D")
   (setq plate# (getkword "Plate A,B,C,D <A>:"))
   )                                        ;progn
   (setq plate# "")
)                                        ;if
(while (and (setq p1 (getpoint "\n Leader Start Point: "))
      (setq p2 (getpoint p1 "\n Leader Ending Point: "))
)

   (if        (< num 10)
   (setq num1 "-0")
   (setq num1 "-")
   )
   (setq ang (angle p1 (list (car p2) (cadr p1))))
   (setq p3 (polar p2 ang lg))
   (setq ht (* ds (getvar "dimtxt")))
   (setq cd (/ (* (getvar "dimtxt") ds) 0.4))
   (setq p4 (polar p3 ang (/ cd 2.)))

   (command "_.leader"        "_none"        p1 "_none" p2 "_none" p3 "" "" "n")
   (setq a (polar p4 (+ ang (* pi 0.5)) (/ cd 2.)))
   (setq b (polar a ang 52.))                ;(distance p2 p3))); change long slot
   (setq c (polar b (+ ang (* pi 1.5)) cd))
   (setq d (polar c (+ pi ang) 52.))        ;(distance p2 p3))); change long slot

   (entmakex (list '(0 . "LWPOLYLINE")
          '(100 . "AcDbEntity")
          '(100 . "AcDbPolyline")
          '(90 . 4)
          '(70 . 1)
          (cons 10 a)
          (cons 10 b)
          '(42 . -1)
          (cons 10 c)
          (cons 10 d)
          '(42 . -1)
      )
   )
;;;       (command "circle" p4 "d" 3"");p=============
   (entmakex
   (list
'(0 . "TEXT")
(cons 10
      (setq pt (mapcar '(lambda (p q) (/ (+ p q) 2.))
                     (mapcar '(lambda (p q) (/ (+ p q) 2.)) a b)
                     (mapcar '(lambda (p q) (/ (+ p q) 2.)) d c)
             )
      )
)
(cons 11 pt)
(cons 40 ht)
(cons 1 (strcat job# num1 (itoa num) plate#))
                                ;edit here for text
(cons 50 0.)
'(41 . 1.0)
(cons 7 (getvar 'textstyle))
'(71 . 0)
'(72 . 4)
'(73 . 0)
   )
   )
   (setq num (+ num 1))
)                                        ;while
(setq plate# nil)
;;;);if
(princ)
(setvar "osmode" os)
)
 
DCL
ballon_slot : dialog{
label="Ballon Slot";
:row{
:boxed_column{label="Setting";
:column{
fixed_width=true;
:row{
:text{label="Job Number (Prefix)";}
:edit_box{key="jobno";fixed_width=true;}
}
:row{
:text{label="Plate Stage (Suffix)";}
:toggle{key="?????";}
:edit_box{key="suffix";fixed_width=true;}
}
:row{
:text{label="Start No";}
:edit_box{key="start_no";fixed_width=true;}
}
}
}
:column{
:button{label="OK";key="accept";is_default=true;}
:button{label="Cancel";key="cancel";is_cancel=true;}
:text{}
:text{}
:text{}
:text{}
}
}
}

MSasu 发表于 2022-7-5 23:43:16

Nalsur8,请编辑您的帖子以正确格式化代码;似乎它在粘贴到此处时丢失了新行,因此显示为单行。想要帮助您的人必须首先注意将代码拆分为其原始语句。

nalsur8 发表于 2022-7-5 23:54:00

对不起,已经用正确的格式编辑了

nalsur8 发表于 2022-7-6 00:10:35

有什么理想可以解决的吗
 
tq公司

Snownut 发表于 2022-7-6 00:14:38

在这里搜索一下,上周我发布了一个简单的计算器DCL函数,它显示了DCL中可用的许多操作。(见下文)
 
这里还有许多其他例子。
 
http://www.cadtutor.net/forum/showthread.php?84928-学习DCL&p=583191&viewfull=1#post583191

nalsur8 发表于 2022-7-6 00:32:01

展示螺母:
 
非常感谢。
页: [1]
查看完整版本: 命令行输入更改为D