spring 发表于 2003-7-13 22:47:00

請大俠幫我寫一個螺絲繪製的程序!

請大俠幫我寫一個螺絲繪製的程序

;;;______________________
spring:dialog{
:row{
:text{label="螺絲大小";}
:popup_list{list="M8";fixed_width=true;}
:text{label="螺絲長度";}
:popup_list{list="40";fixed_width=true;}
}
:text{}
:row{
: column {
:text{label= "加工模板";}
:popup_list{list="下模板(DIE)";width=15;}
}
: column {
:text{label= "加工孔類型";}
:popup_list{list="頭部通孔";width=15;}
}
: column {
:text{label= "加工孔大小";}
:edit_box{}
}
}
:text{}
ok_cancel;
}

前生 发表于 2003-7-14 09:19:00

都是现成的东西



这些都是模具设计上比较成熟的东西了.还这么费劲的写.没什么意思了.让公司里买上一套二套的就可以了!

spring 发表于 2003-7-14 12:22:00

前生大俠,那你能貼出來嗎!!!

前生大俠,那你能貼出來嗎!!!
我的Email有沒有收到,前兩天發的.

spring 发表于 2003-7-15 18:35:00

經過兩天的努力,終於有了點進展.

經過兩天的努力,終於有了點進展,現在的難題是如何取得對話框的值,現在的
(defun TES ()
(setq cir_size 4.5)
(setq cir_size1 7)
(while
    (setq p1 (getpoint "\nInsert point"))
   (MAKECIR p1 cir_size)
   (MAKECIR p1 cir_size1)
)
)
是固定了的
;;;____________________________
(DEFUN QQQ ()
(START_IMAGE "hsc")
(FILL_IMAGE 0 0 (DIMX_TILE "hsc") (DIMY_TILE "hsc") -2)
(END_IMAGE)
(START_IMAGE "hsc")
(SLIDE_IMAGE 0 0 (DIMX_TILE "hsc") (DIMY_TILE "hsc") "h_sc")
(END_IMAGE)
)
(defun QQ ()
(setq fi "pl_list")
(if (findfile (strcat fi ".dat"))
    (progn
      (setq fil (findfile (strcat fi ".dat")))
      (setq fel (list))
      (setq pe (open fil "r"))
      (setq en T)
      (while (/= en nil)
        (progn (setq en (READ-LINE pe))
             (setq fel (cons en fel))
        )
      )
      (close pe)
      (setq kic (reverse (cdr fel)))
    )
)
)
(defun QQ1 ()
(setq fi "ho_list")
(if (findfile (strcat fi ".dat"))
    (progn
      (setq fil (findfile (strcat fi ".dat")))
      (setq fel (list))
      (setq pe (open fil "r"))
      (setq en T)
      (while (/= en nil)
        (progn (setq en (READ-LINE pe))
             (setq fel (cons en fel))
        )
      )
      (close pe)
      (setq kic1 (reverse (cdr fel)))
    )
)
)
(defun QQ2 ()
(setq fi "sc_size")
(if (findfile (strcat fi ".dat"))
    (progn
      (setq fil (findfile (strcat fi ".dat")))
      (setq fel (list))
      (setq pe (open fil "r"))
      (setq en T)
      (while (/= en nil)
        (progn (setq en (READ-LINE pe))
             (setq fel (cons en fel))
        )
      )
      (close pe)
      (setq kic2 (reverse (cdr fel)))
    )
)
)
(defun PL_LIS ()
(start_list "pl_list1" 3)
(mapcar (quote add_list) kic)
(end_list)
(start_list "pl_list2" 3)
(mapcar (quote add_list) kic)
(end_list)
(start_list "pl_list3" 3)
(mapcar (quote add_list) kic)
(end_list)
(start_list "pl_list4" 3)
(mapcar (quote add_list) kic)
(end_list)
(start_list "pl_list5" 3)
(mapcar (quote add_list) kic)
(end_list)
)
(defun HO_LIS ()
(start_list "ho_list1" 3)
(mapcar (quote add_list) kic1)
(end_list)
(start_list "ho_list2" 3)
(mapcar (quote add_list) kic1)
(end_list)
(start_list "ho_list3" 3)
(mapcar (quote add_list) kic1)
(end_list)
(start_list "ho_list4" 3)
(mapcar (quote add_list) kic1)
(end_list)
(start_list "ho_list5" 3)
(mapcar (quote add_list) kic1)
(end_list)
)
(defun SC_SIZE ()
(start_list "sc_size" 3)
(mapcar (quote add_list) kic2)
(end_list)
)
(defun MAKECIR (p1 cir_size / eli)
(setq        eli (list (cons 0 "CIRCLE")
                  (cons 10 p1)
                  (cons 40 cir_size)
          )
)
(entmake eli)
)
(defun TES ()
(setq cir_size 4.5)
(setq cir_size1 7)
(while
    (setq p1 (getpoint "\nInsert point"))
   (MAKECIR p1 cir_size)
   (MAKECIR p1 cir_size1)
)
)
(defun c:h_sc ()
(QQ)
(QQ1)
(QQ2)
(setq dh (load_dialog "h_sc.dcl"))
(setq what_next 2)
(setq cnt 1)
(while (>= what_next 2)
    (if        (null (new_dialog "h_sc" dh))
      (exit)
    )
    (action_tile "accept" "(done_dialog 4)")
    (action_tile "cancel" "(done_dialog 0)")
    (action_tile "pl_list1" "(setq pl1 $value)")
    (PL_LIS)
    (HO_LIS)
    (SC_SIZE)
    (QQQ)
    (setq what_next (start_dialog))
    (cond
      ((= what_next 4)
       (TES)
      )
      ((= what_next 0)
       (prompt "\n***EXIT***")
      )
    )
)
(unload_dialog dh)
(princ)
)
;;;___________________________________
                                        ;(setq pl1oi (atoi pl1))
                                        ;(if (/= pl1oi nil)
                                        ;(setq pl1o (- 1 pl1oi))
                                        ;)
                                        ;(setq pl1_kic(nth pl1o kic))
;;;_______________________________________
h_sc:dialog{label="h_sc";
:row{
:text{label="螺絲大小";}
:popup_list{key="sc_size";fixed_width=true;}
:text{label="螺絲長度";}
:popup_list{list="40";fixed_width=true;}
}
:text{}
:row{
: column {
:row{
: column {
:text{label= "加工模板";}
:popup_list{key="pl_list1";width=25;is_default=true;}
:popup_list{key="pl_list2";width=25;is_default=true;}
:popup_list{key="pl_list3";width=25;is_default=true;}
:popup_list{key="pl_list4";width=25;is_default=true;}
:popup_list{key="pl_list5";width=25;is_default=true;}
}
: column {
:text{label= "加工孔類型";}
:popup_list{key="ho_list1";width=25;is_default=true;}
:popup_list{key="ho_list2";width=25;is_default=true;}
:popup_list{key="ho_list3";width=25;is_default=true;}
:popup_list{key="ho_list4";width=25;is_default=true;}
:popup_list{key="ho_list5";width=25;is_default=true;}
}
: column {
:text{label= "加工孔大小";}
:edit_box{key="ho_size1";width=20;is_default=true;}
:edit_box{key="ho_size2";width=20;is_default=true;}
:edit_box{key="ho_size3";width=20;is_default=true;}
:edit_box{key="ho_size4";width=20;is_default=true;}
:edit_box{key="ho_size5";width=20;is_default=true;}
}
}
}
:image{key="hsc";height = 10;width = 30;color = -2;}
}
:text{}
ok_cancel;
}
;;;_____________________________
頭部通孔
頭部沉頭孔
通孔
螺紋孔


;;;______________________________
M2
M3
M4
M5
M6
M8
M10
M12
M14
M16
M18
M20


spring 发表于 2003-7-15 18:38:00

附件

页: [1]
查看完整版本: 請大俠幫我寫一個螺絲繪製的程序!