我也不太会DCL 。试着弄了下 应该可以用了
- (defun c:tt()
- (setvar "cmdecho" 0)
- (setq osm (getvar "osmode"))
- (setvar "osmode" 0)
- (princ "\n选择要做外切或内接正多边形的圆:")
- (setq p1 (getpoint))
- (setq p2 (getcorner p1))
- (if (> (car p1) (car p2))
- (setq ss (ssget "c" p1 p2))
- (setq ss (ssget "w" p1 p2))
- )
- (setq side (getint "\n正多边形的变数<5>:"))
- (if (= side nil)
- (setq side 5)
- )
- (SETQ DCL_ID(LOAD_DIALOG "圆变多边形.DCL"))
- (NEW_DIALOG "yu" DCL_ID)
- (ACTION_TILE "bb1" "(setq ttype 0)(done_dialog)(UNLOAD_DIALOG DCL_ID)")
- (ACTION_TILE "bb2" "(setq ttype 1)(done_dialog)(UNLOAD_DIALOG DCL_ID)")
- (START_DIALOG)
- (COND
- ((= ttype 0) (setq ttype "I"))
- ((= ttype 1) (setq ttype "C"))
- (T (setq ttype "I"))
- )
- (setq n 0)
- (repeat (sslength ss)
- (setq ent (ssname ss n))
- (setq ent_data (entget ent))
- (setq ent_type (cdr (assoc 0 ent_data)))
- (if (= ent_type "CIRCLE")
- (progn (setq r (cdr (assoc 40 ent_data)))
- (setq pc (cdr (assoc 10 ent_data)))
- (command "polygon" side pc ttype r)
- )
- )
- (setq n (1+ n))
- )
- (setvar "osmode" osm)
- (princ)
- )
|