tian4185tt 发表于 2011-10-9 21:04:49

[求助】 帮忙修改个填充LSP

麻烦版主 帮我将 这个LSP的填充时,在这个LSP里每次都提示输入比例因子,每更换一次比例因子,图纸的全局比例跟着变化,很麻烦,麻烦版主能不能帮忙改下这个LSP,能将每次比例因子提示输入去掉,谢谢
;-----------------------------------------------------------------------
;-----------------------------------------------------------------------
(DEFUN C:EH    () (hpnn "钢筋混凝土")    (hh))
;;;---------------------------------------------------------------
(DEFUN C:RH   ()(scale) (hpnn "钢筋混凝土")    (hhh))
;;;---------------------------------------------------------------
(defun hh ()
    (setvar "cmdecho" 0)
    (setq blipm (getvar "blipmode"))
    (setvar "blipmode" 0)
    (setq pp1 (getpoint "getpoint :"))
    (setq pp2 (getcorner pp1"nextpoint :"))
    (if (or (= pp1 nil) (= pp2 nil)) ""
      (progn
      (setq osn (getvar "osmode"))
      (command "undo" "group")
      (setvar "osmode" 0)
      (setq ppa (list (car pp2)(cadr pp1)))
      (setq ppb(list (car pp1) (cadr pp2)))
      (setq ptlist ( list pp1 ppa pp2 ppb))
      (setq plw(getvar "plinewid"))
      (setvar "plinewid" 0)
      (command "pline" pp1 ppa   pp2ppb "c")
      (setvar "plinewid" plw)
      (setq eedel(entlast))
      (if (tblsearch "layer" "PUB_HATCH") ""
            (command "layer" "New" "PUB_HATCH" "c" "8" "PUB_HATCH" "")
      );end if
      (command "hatch" TA XX4 Agle "l" "")
      (command "change" (entlast) "" "P" "la" "PUB_HATCH" "")
      (entdel eedel)
      (setvar "blipmode" blipm)
      (setq redent(ssget "f" ptlist))
      (if (= redent nil)""
            (progn
            (setq i 1)
            (setq rden (ssname redent 0))
                (while rden
                (redraw rden)
                (setq rden (ssname redent i))
                (setq i (+ i 1))
                );end while
            );; progn
      ) ;;end if
);end progn
      );end if
    (setvar "osmode" osn)
    (command "undo" "end")
);end defun
;;;----------------------------------------------------------------
(defun hhh()
(setq *error*ff_err)
(if (= (getvar "hpname") "")
(prompt "   NO hatch pattern selected: ")
(progn
(command "undo" "group")
(setvar "cmdecho" 0)
(setq blipm(getvar "blipmode"))
(setvar "blipmode" 0)
(setq pt0 (getpoint "get first point : "))
(if pt0
(progn
(setq ptlist nil)
(setq pt1 pt0)
(setq osm(getvar "osmode"))
(setvar "osmode" 0)
(command ".pline" pt0 pt1 "")
(setvar "osmode" osm)
(setq pl0(entlast))
(while pt0
(setq ptlist(cons pt0 ptlist))
(setq ptn pt0)
(setq pt0(getpoint pt0 "next point: "))
(if (or (equal pt0 pt1) (= pt0 nil))
(setq pt0 nil) ""
)         
(ifpt0
(progn
   (setvar "osmode" 0)
   (command ".pline" ptn pt0 "")
   (setvar "osmode" osm)
   (setq pln(entlast))
   (command "pedit" pl0 "j" pln "" "")
   (setq pl0(entlast))
   (redraw pl0 3)
)
(progn
(command ".pline" ptn pt1 "")
(command "pedit" pl0 "j" (entlast) "" "")
)
) ;; end if
) ;;end while
(setq pl0(entlast))
(command "hatch" TA XX4 Agle "l" "")
(entdel pl0)
    (if (tblsearch "layer" "PUB_HATCH") ""
      (command "layer" "New" "PUB_HATCH" "c" "8" "PUB_HATCH" "")
    )
    (command "change" (entlast) "" "P" "la" "PUB_HATCH" "")
(setq i 0)
(if (setq obj(ssget "f" ptlist))
   (repeat (sslength obj)
   (redraw (ssname obj i) )
   (setq i(+ i 1))
   )
   ""
)
) (prompt "cancel") )
(setvar "blipmode" blipm)
(command "undo" "end")
)
))
(PRINC "Start with Va or Wa")
;;;----------------------------------------------------------------
(DEFUN hpnn(xx)
   (IF(= xx "钢筋混凝土")   (PROGN(SETQ Bly 10)(SETQ Agle 0.00)(SETQ TA xx)))
   (setq XX4 (* bscal Bly))
)

页: [1]
查看完整版本: [求助】 帮忙修改个填充LSP