皇上快溜 发表于 2016-10-21 16:09:59

请问这个程序的时间限制代码包含哪些?

(defun c:pun(/ os pot pot1 pot2 pot3 pot4 pot5 pot6 pot7 pot8 pot9
pot10 pot11 pot12 pot0 w hdd_str b_str a_str
do_what potx poty d_dd tot1 tot2 tot3 tot4 tex1 tex2)
(setq cdat (atoi (rtos (getvar "cdate"))))
(if (> cdat 20171231)
   (progn
(setvar "cmdecho" 0)
(setvar "dimzin" 8)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(setq pot (getpoint "\nplease give a point for positions"))
(setq dcl_id (load_dialog "pun"))
(if (not (new_dialog "pun" dcl_id)) (exit))
(setq w (dimx_tile "ima_pun") x2 (1- w))
(setq h (dimy_tile "ima_pun") y2 (1- h))
(start_image "ima_pun")
(vector_image 0 0 x2 0 5)
(vector_image x2 0 x2 y2 5)
(vector_image x2 y2 0 y2 5)
(vector_image 0 y2 0 0 5)
(slide_image 0 0 w h "pun")
(end_image)
(if (null d_str) (setq d_str 5.0))
(if (null dd_str) (setq dd_str 3.0))
(if (null b_str) (setq b_str 10.0))
(if (null a_str) (setq a_str 50.0))
(set_tile "d_str" (rtos d_str 2 2))
(set_tile "dd_str" (rtos dd_str 2 2))
(set_tile "b_str" (rtos b_str 2 2))
(set_tile "a_str" (rtos a_str 2 2))
(action_tile "d_str" "(setq d_str (check $key))")
(action_tile "dd_str" "(setq dd_str (check $key))")
(action_tile "b_str" "(setq b_str (check $key))")
(action_tile "a_str" "(setq a_str (check $key))")
(setq do_what (start_dialog))
(unload_dialog dcl_id)
(if (= do_what 1)
   (progn
(setq   potx (car pot) poty (cadr pot)
   d_dd (- a_str (* 2 (/ (- d_str dd_str) 2)) 5 b_str)
   pot1 (polar pot pi (+ 1 (/ d_str 2)))
   pot2 (list (+ potx (+ 1 (/ d_str 2))) (- poty 5))
   pot3 (polar pot2 pi (+ 1 d_str))
   pot4 (polar pot3 (/ (* 3 pi) 2) d_dd)
   pot12 (polar pot4 0 d_str)
   pot10 (polar pot (/ (* 3 pi) 2) a_str)
   pot6 (polar pot10 pi (/ dd_str 2))
   pot5 (polar pot6 (/ pi 2) b_str)
   pot7 (polar pot6 0 dd_str)
   pot8 (polar pot5 0 dd_str)
   pot9 (polar pot10 (/ (* 3 pi) 2) dd_str)
   pot11 (polar pot9 (/ (* 3 pi) 2) d_str)
   pot0 (polar pot (/ pi 2) d_str)
   tot1 (polar pot7 (* 1.75 pi) 7)
   tot2 (polar pot8 (* 1.75 pi) 7)
   tot3 (polar pot4 pi 5)
   tot4 (polar pot1 (* 1.4 pi) (/ a_str 2))
)
(command "rectang" pot1 pot2)
(command "rectang" pot3 pot12)
(command "line" pot5 pot6 "")
(command "line" pot7 pot8 "")
(command "arc" pot5 "e" pot4 "d" 90 "")
(command "arc" pot8 "e" pot12 "d" 90 "")
(command "arc" pot6 "e" pot9 "d" 270 "")
(command "arc" pot7 "e" pot9 "d" 270 "")
(command "line" pot0 pot11 "")
(setq ent (ssget "l"))
(command "chprop" ent "" "lt" "center2" "c" "cyan" "")
(setq tex1 (strcat "%%c" (rtos dd_str)))
(setq tex2 (strcat "%%c" (rtos d_str)))
(command "DIMLINEAR" pot6 pot7 "t" tex1 tot1)
(command "DIMLINEAR" pot4 pot12 "t" tex2 tot2)
(command "DIMLINEAR" pot6 pot5 "t" (rtos b_str 2 2) tot3)
(command "DIMLINEAR" pot6 pot1 "t" (rtos a_str 2 2) tot4)
   );;;do_what
)
(setvar "osmode" os)
   )
(prompt "对不起!试用期巳过,请安装正版!")
)
);;;defun
;;;
;;;
(defun check (number)
(set_tile "error" "")
(if (< (distof (get_tile number)) 0)
   (progn
    (set_tile "error" "error value")
    (mode_tile number 2)
    (mode_tile number 3)
    nil
   )
   (distof (get_tile number))
)
)




除了下面这些,,,还有哪谢???

(setq cdat (atoi (rtos (getvar "cdate"))))
(if (> cdat 20171231)
   (progn



(prompt "对不起!试用期巳过,请安装正版!")
)
);;;


改了这部分 (if (> cdat 20171231)还不能用,,,报 (prompt "对不起!试用期巳过,请安装正版!"),,,不知悬机在哪里?

cabinsummer 发表于 2016-10-21 17:09:14

障眼法而已…………

皇上快溜 发表于 2016-10-23 15:31:08

xxxyyyzzz 发表于 2016-10-23 13:00
缺少dcl的那些东西吧

你好,请问,下面这个程序DLC衔接那里,出了什么问题?

(DEFUN C:FTT (/ ce ss se la listt selt)
(setvar "cmdecho" 0)
(setq ss (ssget))
(if (not (null ss))
(mpct)
)
       (princ)
)
;;;
(defun mpct (/ w lay sslay dcl_id do_what value tbl
lenth layer clayer num a b no tem_list cood)
(SETQ W (TBLNEXT "LAYER" T))
(WHILE (/= NIL W)
(SETQ LAY (CDR (ASSOC 2 W)))
(if (/= (STRCASE lay) "DEFPOINTS")
(SETQ SSLAY (append SSLAY (list LAY)))
)
(SETQ W (TBLNEXT "LAYER"))
)
(setq dcl_id (load_dialog "ctt.dcl"))
      "ctt:dialog{"
         "label="图层复制";"
         ":list_box{"
                " label="层名:";"
"      key="listt";"
"      height=40;"
                "      fixed_width_font=true;"
"      multiple_select=true;"
"      //allow_accept=true;"
"      }"
         ":button{"
"      label="所有层";"
"      key="selallt";"
"      //fixed_width=true;"
"      }"
         "ok_only;"
         "}"
(setq do_what 3)
    (while (> do_what 1)
(if (not (new_dialog "ctt" dcl_id)) (exit))
(mode_tile "listt" 2)
(start_list "listt" 2)
(mapcar 'add_list SSLAY)
(end_list)
(action_tile "selt" "(done_dialog 2)")
(action_tile "selallt" "(selallct)")
(action_tile "listt" "(setq value $value)")
(action_tile "accept" "(setq value (get_tile \"listt\"))(done_dialog 1)")
(setq do_what (start_dialog))
(if (= 2 do_what)
   (setq ss (ssget))
)
    )
(unload_dialog dcl_id)
(if (= 1 do_what)
   (progn
(str_no value)
(setq lenth -1)
(setq pot1 (list sx sy sz)
   pot2 (list ex ey ez)
)
(repeat (length tem_list)
   (setq lenth (1+ lenth)
    layer (nth lenth tem_list)
    clayer (nth layer sslay)
   )
   (setq tbl (tblsearch "layer" clayer))
   (if (not (null tbl))
   (progn
    (command "copy" ss "" "0,0,0" "0,0,0")
                  (command "_chprop" ss "" "la" clayer "")
   )
   )
)

   )
)
(princ)
)
;;;
(defun selallct ()
(setq num (length sslay)
a 0
)
(while (< a num)
(if (null b)(setq b ""))
(setq b (strcat b (rtos a 2 0) " ") )
(setq a (1+ a))
)
(set_tile "listt" b)
)
;;;
(defun str_no (str)
(while (setq no (read str))
   (setq tem_list (append tem_list (list no)))
   (setq str (substr str (+ 2 (strlen (itoa no)))))
   tem_list
)
)

皇上快溜 发表于 2016-10-24 16:04:06

xxxyyyzzz 发表于 2016-10-24 08:10
ctt.dcl在哪里呢?需要这个文件的

这段就是,手工编辑进去的
         "label="图层复制";"
          ":list_box{"
               " label="层名:";"
   "      key="listt";"
   "      height=40;"
               "      fixed_width_font=true;"
   "      multiple_select=true;"
   "      //allow_accept=true;"
   "      }"
          ":button{"
   "      label="所有层";"
   "      key="selallt";"
   "      //fixed_width=true;"
   "      }"
          "ok_only;"
          "}"

mikewolf2k 发表于 2016-10-21 16:26:15

不大懂lisp,瞎猜猜
(getvar "cdate")是取得当前日期吧,把取当前日期改为固定的一个过去日期的字符串就可以了。
(if (> cdat 20171231)是判断日期跟20171231吧,把大于改成小于,结果不就互换了,过期变不过期。

皇上快溜 发表于 2016-10-21 16:34:55

mikewolf2k 发表于 2016-10-21 16:26
不大懂lisp,瞎猜猜
(getvar "cdate")是取得当前日期吧,把取当前日期改为固定的一个过去日期的字符串就可 ...

谢谢,改了也没用,,

我甚至把
(setq cdat (atoi (rtos (getvar "cdate"))))
(if (> cdat 20171231)
    (progn

   (prompt "对不起!试用期巳过,请安装正版!")
)
)

删了,重新启动cad,重新加载,,结果:命令: pun ; 错误: quit / exit abort

皇上快溜 发表于 2016-10-21 18:43:06

cabinsummer 发表于 2016-10-21 17:09
障眼法而已…………

请你指点一下好吗,谢谢

vectra 发表于 2016-10-21 19:20:20

(if t
    (progn

皇上快溜 发表于 2016-10-21 19:34:49

vectra 发表于 2016-10-21 19:20


谢谢你,,没找到,这两段啊,,它与那些功能性函数混合在一起吗?

它这两段有什么作用?

xxxyyyzzz 发表于 2016-10-23 13:00:57

缺少dcl的那些东西吧

xxxyyyzzz 发表于 2016-10-24 08:10:10

ctt.dcl在哪里呢?需要这个文件的
页: [1] 2
查看完整版本: 请问这个程序的时间限制代码包含哪些?