Satishrajdev,
所以我试着应用你的方法,它似乎对我不起作用,我百分之百肯定,因为我做得不对。
您将看到,我已经注释掉了请求radius的原始代码,并尝试了您的方法。我显然做得不对。。。
- ;;; JMPR.lsp
- ;;;
- ;;; Description
- ;;; Jumper will auto-create the radius jump for pipe crossings.
- ;;;
- ;;; Author: Lee Mac (CADTutor)
- ;;; Date: 03/25/10
- ;;;
- ;;; Revision: 1
- ;;; Revision Date: 10/30/15
- ;;; Description - Modified by David Prontnicki
- ;;; Added the ability to select your radius at the beginning of the command.
- ;;; Changed interface verbage
- ;;;
- ;;; Command: JMPR
- ;;; -----------------------------------------------------------------------------;
- (defun c:jmpr (/ *error* A AENT B1 B2 BDISA BDISB BENT DOC ENT OV P1 P2 UFLAG VL O W)
- ;(setq bDis (getreal "\n Enter new value for Jump Radius: ")) ; Modified by David Prontnicki
- (setq bDisa bDisb)
- (setq bDisb (getreal (strcat "\n Enter new value for Jump Radius "
- (if (not bDisa)
- ": "
- (strcat "<" (itoa bDisa) ">: ")
- )
- )
- )
- )
- (if (and (not bDisb) bDisa)
- (setq bDisb bDisa)
- )
- (defun *error* (msg)
- (and uFlag (vla-EndUndoMark doc))
- (and ov (mapcar (function setvar) vl ov))
- (and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
- (princ (strcat "\n** Error: " msg " **"))))
- (princ))
- (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))
- vl '("PEDITACCEPT" "CMDECHO" "OSMODE") ov (mapcar (function getvar) vl))
- (setvar "PEDITACCEPT" 1)
- (while (and (setq uFlag (not (vla-StartUndoMark doc)))
- (mapcar (function setvar) (cdr vl) '(0 32))
- (setq p1 (getpoint "\nPick the crossing intersection: ")) ; Modified by David Prontnicki
- (setq ent (entsel "\nSelect the line to break: "))) ; Modified by David Prontnicki
- (setq p2 (osnap (cadr ent) "_nea")
- b1 (polar p1 (setq a (angle p1 p2)) bDisb)
- b2 (polar p1 (+ pi a) bDisb))
-
- (setvar "OSMODE" 0)
- (command "_.break" b1 b2)
- (setq bEnt (entlast))
- (if (> a (/ pi 2.))
- (command "_.arc" b2 "_E" b1 "_A" 180.)
- (command "_.arc" b1 "_E" b2 "_A" 180.))
- (setq aEnt (entlast))
- (if (eq "LWPOLYLINE" (cdr (assoc 0 (entget (setq ent (car ent))))))
- (progn
- (setq w (vla-get-ConstantWidth (setq o (vlax-ename->vla-object ent))))
- (command "_.pedit" "_M" bEnt aEnt ent "" "_J" "" "")
- (vla-put-ConstantWidth (vlax-ename->vla-object (entlast)) w)))
- (setq uFlag (vla-EndUndoMark doc)))
- (*error* nil)
- (princ))
提前谢谢! |