Results 1 to 3 of 3

Thread: Revision Rectangular Annotative Cloud

  1. #1
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Revision Rectangular Annotative Cloud

    I found a code that makes a revision rectangle

    I also found a code that supposedly annotates cloud arcs to the appropriate scale (haven't tested it yet)


    Code:
    (setq a (getvar "cannoscalevalue"))
    (setq ss (
    	  cond
    	   ((= a (/ 1.0 192.0)) 50.0) 		;1/16th scale sets arc length to 50
    	   ((= a (/ 1.0 128.0)) (/ 135.0 4.0))	;3/32th scale sets arc length to 33.75
    	   ((= a (/ 1.0 96.0)) 25.0)		;1/8th scale sets arc length to 25
    	   ((= a (/ 1.0 64.0)) (/ 75.0 4.0))	;3/16th scale sets arc length to 18.75
    	   ((= a (/ 1.0 48.0)) (* 25.0 0.5))	;1/4 scale sets arc length to 12.5
    	   ((= a 1.0) (/ 1.0 4.0))		;1:1 scale sets arc length to .25
    	   ((= a (/ 1.0 240.0)) 75.0)		;1:20 scale sets arc length to 75
    	   ((= a (/ 1.0 480.0)) 100.0)		;1:40 scale sets arc length to 100
    	 )
    )
    Code:
    (prompt "Loading CLOUD1....")
     ;
     (defun C:Cloud1 (/ ds plw pt1 pt2 p1 p2 xdist ydist spcsx spcsy ent1 ent2
     nxt info bulge data)
     (setq #exlyr (getvar "clayer"))
     (if (null (tblsearch "layer" "RevCloud"))
     (command "-layer" "m" "RevCloud" "c" "1" "" ""))
     (command "-layer" "s" "RevCloud" "")
     (setq oldplinewid (getvar"plinewid")) ;get old Plinewidth
     setting
     (setq OldPlineType (getvar "Plinetype")) ;get old
     Plinetype setting
     (setvar "Plinetype" 0) ;set Plinetype
     to R13 setting
    
     (setvar "cmdecho" 0)
     (setq ds (getvar "LTSCALE")
     plw (* 0.00 ds)
     oer *error*
     bm (getvar "blipmode"))
    
     (defun *error* (s) ;start error routine
     (setvar "blipmode" bm) ;reset blipmode
     (princ (strcat "\Exit..." s)) ;type error message
     (if oer (setq *error* oer))
     (princ))
    
     (SETQ PT1 (GETPOINT "Pick lower left corner of window: ")) (terpri)
     (setq pt2 (getcorner pt1 "Pick upper right corner of window: "))
     (setvar "blipmode" 0)
     (setq p1 (car pt1) p2 (car pt2) ;find x distances
     xdist (- p2 p1))
     (setq p1 (cadr pt1) p2 (cadr pt2) ;find y distances
     ydist (- p2 p1))
    
     ;******TO ADJUST SPACING OF ARCS CHANGE THE NUMBER 2 IN THE NEXT TWO
     LINES*****
     (setq spcsx (/ (abs xdist) (/ ds 4)) ;X spacing
     spcsy (/ (abs ydist) (/ ds 4))) ;Y spacing
    
     (if (= spcsx (fix spcsx)) (setq spcsx (fix spcsx)) (setq spcsx (+ 1 (fix
     spcsx))))
     (if (= spcsx 1) (setq spcsx 2)) ;min of 2 spaces
     (if (= spcsy (fix spcsy)) (setq spcsy (fix spcsy)) (setq spcsy (+ 1 (fix
     spcsy))))
     (if (= spcsy 1) (setq spcsy 2)) ;min of 2 spaces
    
     (setq xdist (/ xdist spcsx) ydist (/ ydist spcsy)) ;set distances
    
     (setq p1 pt1) ;set polyline start point
    
     (command "PLINE" p1 "W" plw "") ;start polyline command
     (repeat spcsx ;draw bottom line segments
     (setq p1 (polar p1 0.0 (abs xdist)))
     (command p1))
     (repeat spcsy ;draw right line segments
     (setq p1 (polar p1 (/ pi 2) (abs ydist)))
     (command p1))
     (repeat spcsx ;draw top line segments
     (setq p1 (polar p1 pi (abs xdist)))
     (command p1))
     (repeat (- spcsy 1) ;draw left line segments
     (setq p1 (polar p1 (* pi 1.5) (abs ydist)))
     (command p1))
     (command "C") ;Close polyline
    
     (setq ent1 (entlast) ;get entity
     ent2 (entget ent1) ;get entity info
     ;******TO ADJUST THE ARC SIZE ADJUST THE 0.7 BELOW*******
     bulge (list (cons 42 0.5)) ;build cloud arcs
     nxt (cdr (assoc -1 ent2)) ;set for lookup
     nxt (entnext nxt) ;get next one
     plw (list (cons 41 plw))) ;build cloud width
    
     (while nxt ;start loop
     (setq info (entget nxt) ;get exist. info
     info (append info bulge) ;set bulge
     info (append info plw) ;set width
     ) ;end of setq
     (entmod info) ;modify entity
     (setq nxt (entnext nxt)) ;get next segment
     ) ;end of while
     (entupd ent1) ;update entity
    
     (setvar "blipmode" bm) ;reset blipmode
     (setvar "cmdecho" 1) ;turn command echo on
     (gc) (princ) ;print blank line
     (setvar "Plinetype" OldPlineType) ;set Plinetype
     setting back
     (setvar "Plinewid" OldPlinewid)
     (setvar "clayer" #exlyr)
     ) ;End program

    Would anyone be willing to assist and combine the two into one if there is not already a lisp available that does this same task???

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: Revision Rectangular Annotative Cloud

    Have a think about a much simpler method

    Code:
    ; draw your pline
    (setq obj (car (entsel "pick pline")))
    ;or if you have just drawn the pline
    ;(setq obj  (entlast))
    
    (setq a (getvar "cannoscalevalue"))
    (setq al (
    	  cond
    	   ((= a (/ 1.0 192.0)) 50.0) 		;1/16th scale sets arc length to 50
    	   ((= a (/ 1.0 128.0)) (/ 135.0 4.0))	;3/32th scale sets arc length to 33.75
    	   ((= a (/ 1.0 96.0)) 25.0)		;1/8th scale sets arc length to 25
    	   ((= a (/ 1.0 64.0)) (/ 75.0 4.0))	;3/16th scale sets arc length to 18.75
    	   ((= a (/ 1.0 48.0)) (* 25.0 0.5))	;1/4 scale sets arc length to 12.5
    	   ((= a 1.0) (/ 1.0 4.0))		;1:1 scale sets arc length to .25
    	   ((= a (/ 1.0 240.0)) 75.0)		;1:20 scale sets arc length to 75
    	   ((= a (/ 1.0 480.0)) 100.0)		;1:40 scale sets arc length to 100
    	 )
    )
    
    (command "Revcloud" "A" al al "O" obj)

  3. #3
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Re: Revision Rectangular Annotative Cloud

    thank you..............
    Last edited by mbrandt5; 2015-07-27 at 05:43 PM.

Similar Threads

  1. Annotative Revision Cloud
    By robinsonmd in forum AutoLISP
    Replies: 11
    Last Post: 2011-11-17, 02:43 AM
  2. Revision Cloud
    By rhayes.99001 in forum ACA General
    Replies: 9
    Last Post: 2010-06-21, 04:56 PM
  3. Rectangular revision clouds
    By SSGRichDAV in forum ACA General
    Replies: 1
    Last Post: 2010-05-22, 06:04 PM
  4. Revision cloud properties in cloud sketch
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2009-02-01, 07:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •