(defun c:try (/ Dis1 Dis2 pt1 pt2 obj )
(setq old_osm (getvar "OSMODE"))
(setvar "osmode" 0)
(setvar 'cmdecho 0)
(setq PLW (getvar "plinewid"))
(setvar "plinewid" 0)
(initget (+ 1 2 4))
(while (= Dis1 nil)
(setq Dis1 (getreal "\nMin Arc Distance: "))
)
(while (= Dis2 nil)
(setq Dis2 (getreal (strcat"\nMax Arc Distance: <" (rtos Dis1) "> ")))
)
(setq cont T)
(while cont
(setq cont nil)
(initget "Normal / Calligraphic")
(setq kw (getkword "\nRevcloud Style \nSelect option [ Normal / Calligraphic ] <Normal>:"))
(if (not kw) (setq kw "Normal"))
(cond
((= kw "Normal") (C:RV_Normal))
((= kw "Calligraphic") (C:RV_Calligraphic))
)
)
(setq Dis1 nil)
(setq Dis2 nil)
(setvar "plinewid" PLW)
(setvar "cmdecho" cmd1)
)
(defun c:RV_Normal ()
(setq pt1 (getpoint "\nFirst corner of revison cloud: "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "n" "ARC" Dis1 Dis2 "OBJECT" obj "" )
)
(defun c:RV_Calligraphic ()
(setq pt1 (getpoint "\nFirst corner of revison cloud: "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "C" "ARC" Dis1 Dis2 "OBJECT" obj "")
)
(princ)
(initget (+ 2 4))
(while (= Dis1 nil)
(setq Dis1 (getreal (if a (strcat "\nMin Arc Distance <" (rtos a) "> : ") "\nMin Arc Distance :")))
(if (null Dis1) (setq Dis1 a))
)
(while (= Dis2 nil)
(setq Dis2 (getreal (if b (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " <" (rtos b) "> : ") (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " : "))))
(if (null Dis2) (setq Dis2 b))
)
(setq a Dis1 b Dis2)
Replace lines from (initget ...) (while ...) (while ...) with this :Code: [Select](initget (+ 2 4))
(while (= Dis1 nil)
(setq Dis1 (getreal (if a (strcat "\nMin Arc Distance <" (rtos a) "> : ") "\nMin Arc Distance :")))
(if (null Dis1) (setq Dis1 a))
)
(while (= Dis2 nil)
(setq Dis2 (getreal (if b (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " <" (rtos b) "> : ") (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " : "))))
(if (null Dis2) (setq Dis2 b))
)
(setq a Dis1 b Dis2)
(defun c:RV ( / Dis1 Dis2 old_osm cmd1 PLW )
(setq old_osm (getvar "OSMODE"))
(setq cmd1 (getvar "CMDECHO"))
(setq PLW (getvar "plinewid"))
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(setvar "plinewid" 0)
(initget (+ 2 4))
(while (= Dis1 nil)
(setq Dis1 (getreal (if a (strcat "\nMin Arc Distance <" (rtos a) "> : ") "\nMin Arc Distance :")))
(if (null Dis1) (setq Dis1 a))
)
(while (= Dis2 nil)
(setq Dis2 (getreal (if b (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " <" (rtos b) "> : ") (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " : "))))
(if (null Dis2) (setq Dis2 b))
(if (< Dis2 Dis1) (setq Dis2 nil))
)
(setq a Dis1 b Dis2)
(initget "Normal Calligraphic")
(setq kw (getkword "\nRevcloud Style \nSelect option [ Normal / Calligraphic ] <Normal>:"))
(if (not kw) (setq kw "Normal"))
(cond
((= kw "Normal") (C:RV_Normal))
((= kw "Calligraphic") (C:RV_Calligraphic))
)
(setvar "plinewid" PLW)
(setvar "cmdecho" cmd1)
(setvar "osmode" old_osm)
(princ)
)
(defun c:RV_Normal ( / pt1 pt2 obj )
(setq pt1 (getpoint "\nFirst corner of revison cloud : "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "n" "ARC" Dis1 Dis2 "OBJECT" obj "" )
(princ)
)
(defun c:RV_Calligraphic ( / pt1 pt2 obj )
(setq pt1 (getpoint "\nFirst corner of revison cloud : "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "C" "ARC" Dis1 Dis2 "OBJECT" obj "")
(princ)
)
Try this :Code: [Select](defun c:RV ( / Dis1 Dis2 old_osm cmd1 PLW )
(setq old_osm (getvar "OSMODE"))
(setq cmd1 (getvar "CMDECHO"))
(setq PLW (getvar "plinewid"))
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(setvar "plinewid" 0)
(initget (+ 2 4))
(while (= Dis1 nil)
(setq Dis1 (getreal (if a (strcat "\nMin Arc Distance <" (rtos a) "> : ") "\nMin Arc Distance :")))
(if (null Dis1) (setq Dis1 a))
)
(while (= Dis2 nil)
(setq Dis2 (getreal (if b (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " <" (rtos b) "> : ") (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " : "))))
(if (null Dis2) (setq Dis2 b))
(if (< Dis2 Dis1) (setq Dis2 nil))
)
(setq a Dis1 b Dis2)
(initget "Normal Calligraphic")
(setq kw (getkword "\nRevcloud Style \nSelect option [ Normal / Calligraphic ] <Normal>:"))
(if (not kw) (setq kw "Normal"))
(cond
((= kw "Normal") (C:RV_Normal))
((= kw "Calligraphic") (C:RV_Calligraphic))
)
(setvar "plinewid" PLW)
(setvar "cmdecho" cmd1)
(setvar "osmode" old_osm)
(princ)
)
(defun c:RV_Normal ( / pt1 pt2 obj )
(setq pt1 (getpoint "\nFirst corner of revison cloud : "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "n" "ARC" Dis1 Dis2 "OBJECT" obj "" )
(princ)
)
(defun c:RV_Calligraphic ( / pt1 pt2 obj )
(setq pt1 (getpoint "\nFirst corner of revison cloud : "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "C" "ARC" Dis1 Dis2 "OBJECT" obj "")
(princ)
)
M.R.
Another option: dynamic block - see attached dwg
Now I use a custom lisp that checks to see if the block exists, if not, imports it from a "standards" drawing then puts it on the A-Anno-Revs layer. But maybe the dblock can get you started.
jb
Thanks Ron, maybe I should add a Draw Option for Rectangle.
My draw pline is a vertex pick along route method.
I think you may like it. Uploading version 2.9 now which I added the Rectangle Draw option.
Be sure to extract the SLD file to your ACAD search path.
;;; Files Required to be in the ACAD search path
;;; pl2cloud.dcl ; *** note- created by this lisp
;;; rc_normal.sld ; slides are found in the zip file
;;; rc_shadow.sld
;;; rc_length.sld
(defun c:RV ( / Dis1 Dis2 old_osm cmd1 PLW )
(setq old_osm (getvar 'OSMODE ))
(setq cmd1 (getvar "CMDECHO"))
(setq PLW (getvar "plinewid"))
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(setvar "plinewid" 0)
;; thanks to ribarm for fixing this line
(initget (+ 2 4))
(while (= Dis1 nil)
(setq Dis1 (getreal (if a (strcat "\nMin Arc Distance <" (rtos a) "> : ") "\nMin Arc Distance :")))
(if (null Dis1) (setq Dis1 a))
)
(while (= Dis2 nil)
(setq Dis2 (getreal (if b (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " <" (rtos b) "> : ") (strcat "\nMax Arc Distance - must be greater than " (rtos Dis1) " : "))))
(if (null Dis2) (setq Dis2 b))
(if (< Dis2 Dis1) (setq Dis2 nil))
)
(setq a Dis1 b Dis2)
;; until this line as commented by ribarm
(setq cont T)
(while cont
(setq cont nil)
(initget "RN / RC / PN / PC / ?")
(setq kw (getkword "\nRevcloud Style \nSelect option [ RN / RC / PN / PC / ?] <RN>:"))
(if (not kw) (setq kw "RN"))
(cond
((= kw "RN") (C:NOD_RN))
((= kw "RC") (C:NOD_RC))
((= kw "PN") (C:NOD_PN))
((= kw "PC") (C:NOD_PC))
((= kw "?")
(textscr)
(alert
(strcat
"
OPTIONS:
RN : Rectangular Revcloud in Normal Style
RC : Rectangular Revcloud in Calligraphic Style
PN : Polygonal Revcloud in Normal Style
PC : Polygonal Revcloud in Calligraphic Style
")
)
(setq cont T)
)
)
)
(setq Dis1 nil)
(setq Dis2 nil)
(setvar "plinewid" PLW)
(setvar "cmdecho" cmd1)
(setvar 'osmode old_osm)
)
(defun c:NOD_RN ()
(print "Rectangular Revcloud Normal Style Selected")
(setq pt1 (getpoint "\nFirst corner of revison cloud: "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "n" "ARC" Dis1 Dis2 "OBJECT" obj "" )
)
(defun c:NOD_RC()
(print "Rectangular Revcloud Calligraphic Style Selected")
(setq pt1 (getpoint "\nFirst corner of revison cloud: "))
(setq pt2 (getcorner "\nDiagonal corner of revision cloud " pt1))
(command "._RECTANG" pt1 pt2)
(setq obj (entlast))
(command "._revcloud" "style" "C" "ARC" Dis1 Dis2 "OBJECT" obj "")
)
(defun C:NOD_PN ()
(prompt "\nPolygonal Revcloud Normal Style Selected\nPick Starting Point of Polyline and close when done:")
(command "_.PLINE")
(while (= (getvar "CMDNAMES") "PLINE")
(command pause)
)
(command "pedit" "l" "c" "")
(command "._revcloud" "style" "n" "ARC" Dis1 Dis2 "OBJECT" "l" "no")
)
(defun C:NOD_PC ()
(prompt "\nPolygonal Revcloud Calligraphic Style Selected\nPick Starting Point of Polyline and close when done:")
(command "_.PLINE")
(while (= (getvar "CMDNAMES") "PLINE")
(command pause)
)
(command "pedit" "l" "c" "")
(command "._revcloud" "style" "c" "ARC" Dis1 Dis2 "OBJECT" "l" "no")
)
(princ)
because it was the last statement evaluated in the routine
modify toCode - Auto/Visual Lisp: [Select]