Author Topic: Revision cloud with revision triangle  (Read 1882 times)

0 Members and 1 Guest are viewing this topic.

notredave

  • Newt
  • Posts: 140
Revision cloud with revision triangle
« on: February 29, 2016, 04:21:48 PM »
To whomever can help me out,
Is there a way to make attached lisp to be able to use scale of current drawing and attached dwg to be the current scale of drawing? It works perfect on 1:1 drawings but when I use it on enlarged plans at different scales, it comes in at 1:1. I apologize for any inconvenience this might cause but would love to have this lisp work with scaled drawings.

Thanks in advance,
David

(defun c:rv ( / *error* ar bn cm el fn rv )

    (setq bn "REVTAG") ;; Rev Cloud Attributed Block
   
    (defun *error* ( msg )
        (if cm (setvar 'cmdecho cm))
        (if ar (setvar 'attreq ar))
        (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))
            (princ (strcat "\nError: " msg))
        )
        (princ)
    )

    (setq cm (getvar 'cmdecho)
          ar (getvar 'attreq)
    )
    (cond
        (   (not
                (or (tblsearch "BLOCK" bn)
                    (and
                        (setq fn (findfile (strcat bn ".dwg")))
                        (progn
                            (setvar 'cmdecho 0)
                            (command "_.-insert" fn nil)
                            (setvar 'cmdecho cm)
                            (tblsearch "BLOCK" bn)
                        )
                    )
                )
            )
            (princ (strcat "\n" bn ".dwg not found."))
        )
        (   (zerop (logand 2 (cdr (assoc 70 (tblsearch "BLOCK" bn)))))
            (princ (strcat "\n" bn " not attributed."))
        )
        (   (setq *rev*
                (cond
                    (   (= "" (setq rv (getstring t (strcat "\nSpecify Revision" (if *rev* (strcat " <" *rev* ">: ") ": ")))))
                        *rev*
                    )
                    (   rv   )
                )
            )                     
            (command "_.revcloud")
            (while (= 1 (logand 1 (getvar 'cmdactive))) (command "\\"))
            (setvar 'cmdecho 0)
            (setvar 'attreq  0)
            (setq el (entlast))
            (princ "\nSpecify Point for Revision Block: ")
            (command "_.-insert" bn "_S" 1.0 "_R" 0.0 "\\")
            (if (not (eq el (setq el (entlast))))
                (progn
                    (setq el (entget (entnext el)))
                    (if (entmod (subst (cons 1 *rev*) (assoc 1 el) el))
                        (entupd (cdr (assoc -1 el)))
                    )
                )
            )
            (setvar 'attreq  ar)
            (setvar 'cmdecho cm)
        )
    )   
    (princ)
)
(princ)

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Revision cloud with revision triangle
« Reply #1 on: February 29, 2016, 05:02:59 PM »
Welcome to The Swamp :-)

The block scale is given on this line:
Code - Auto/Visual Lisp: [Select]
  1. (command "_.-insert" bn "_S" 1.0 "_R" 0.0 "\\")

Are you looking for the block scale to match CANNOSCALEVALUE or maybe DIMSCALE?

If so, simply change the above line to:
Code - Auto/Visual Lisp: [Select]
  1. (command "_.-insert" bn "_S" (getvar 'dimscale) "_R" 0.0 "\\")



Aside, original code source: http://www.cadtutor.net/forum/showthread.php?71289-Need-lisp-for-Rev-cloud-with-tag&p=487526&viewfull=1#post487526
(I'd recognise my own code anywhere :wink:)



[ Formatting code in your posts ]

notredave

  • Newt
  • Posts: 140
Re: Revision cloud with revision triangle
« Reply #2 on: February 29, 2016, 05:22:28 PM »
yes sir Lee Mac, I used your code. Thank you very much!