TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: notredave on March 01, 2016, 10:27:22 AM

Title: Revision cloud using calligraphy arcs
Post by: notredave on March 01, 2016, 10:27:22 AM
To whomever can help me out,

Using Mr. Lee Mac's code and I appreciate it very much, but can someone edit code to use the fancy calligraphy arcs instead of the regular arcs? My lisp routine will be complete then. I am using Autocad 2015.
 
Thanks in advance,
David

Code - Auto/Visual Lisp: [Select]
  1. (defun c:rv ( / *error* ar bn cm el fn rv )
  2.  
  3.     (setq bn "REVTAG") ;; Rev Cloud Attributed Block
  4.    
  5.     (defun *error* ( msg )
  6.         (if cm (setvar 'cmdecho cm))
  7.         (if ar (setvar 'attreq ar))
  8.         (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))
  9.             (princ (strcat "\nError: " msg))
  10.         )
  11.         (princ)
  12.     )
  13.  
  14.     (setq cm (getvar 'cmdecho)
  15.           ar (getvar 'attreq)
  16.     )
  17.     (cond
  18.         (   (not
  19.                 (or (tblsearch "BLOCK" bn)
  20.                     (and
  21.                         (setq fn (findfile (strcat bn ".dwg")))
  22.                         (progn
  23.                             (setvar 'cmdecho 0)
  24.                             (command "_.-insert" fn nil)
  25.                             (setvar 'cmdecho cm)
  26.                             (tblsearch "BLOCK" bn)
  27.                         )
  28.                     )
  29.                 )
  30.             )
  31.             (princ (strcat "\n" bn ".dwg not found."))
  32.         )
  33.         (   (zerop (logand 2 (cdr (assoc 70 (tblsearch "BLOCK" bn)))))
  34.             (princ (strcat "\n" bn " not attributed."))
  35.         )
  36.         (   (setq *rev*
  37.                 (cond
  38.                     (   (= "" (setq rv (getstring t (strcat "\nSpecify Revision" (if *rev* (strcat " <" *rev* ">: ") ": ")))))
  39.                         *rev*
  40.                     )
  41.                     (   rv   )
  42.                 )
  43.             )                    
  44.             (command "_.revcloud")
  45.             (while (= 1 (logand 1 (getvar 'cmdactive))) (command "\\"))
  46.             (setvar 'cmdecho 0)
  47.             (setvar 'attreq  0)
  48.             (setq el (entlast))
  49.             (princ "\nSpecify Point for Revision Block: ")
  50.             (command "_.-insert" bn "_S" 1.0 "_R" 0.0 "\\")
  51.             (if (not (eq el (setq el (entlast))))
  52.                 (progn
  53.                     (setq el (entget (entnext el)))
  54.                     (if (entmod (subst (cons 1 *rev*) (assoc 1 el) el))
  55.                         (entupd (cdr (assoc -1 el)))
  56.                     )
  57.                 )
  58.             )
  59.             (setvar 'attreq  ar)
  60.             (setvar 'cmdecho cm)
  61.         )
  62.     )    
  63.     (princ)
  64. )
Title: Re: Revision cloud using calligraphy arcs
Post by: ChrisCarlson on March 01, 2016, 10:58:35 AM
Should just need to pass an "S" and "C"

Code - Auto/Visual Lisp: [Select]
  1. (command "_.revcloud" "S" "C")
Title: Re: Revision cloud using calligraphy arcs
Post by: notredave on March 01, 2016, 12:15:36 PM
ChrisCarlson,
I am not sure where to change that. Can you tell me exactly where to put that command or edit the one above please?
Title: Re: Revision cloud using calligraphy arcs
Post by: notredave on March 01, 2016, 12:20:37 PM
ChrisCarlson,
Nevermind, I figured it out and works like a champ!
Thank you very much
Title: Re: Revision cloud using calligraphy arcs
Post by: notredave on March 01, 2016, 03:58:12 PM
Lee Mac, if you're out there, please help me or someone else,
While looking around the web, I saw this:
(command "revcloud" "A" (* 0.3125 (getvar "DIMSCALE")) "")

That works great on scaled drawings, my question is where can I incorporate that into Lee Mac's lisp code to make it work.

Thanks in advance,
David
Title: Re: Revision cloud using calligraphy arcs
Post by: Lee Mac on March 01, 2016, 06:12:44 PM
You can incorporate it as part of the REVCLOUD command call, i.e:
Code - Auto/Visual Lisp: [Select]
  1. (command "_.revcloud" "_A" (* 0.3125 (getvar 'dimscale)) "" "_S" "_C")

PS: Please edit your post and enclose your code with code tags:

[code]Your code here[/code]
Title: Re: Revision cloud using calligraphy arcs
Post by: JohnK on March 01, 2016, 08:15:46 PM
In addition to using the code tags in your initial post I would also like to ask you to please also attach any header Lee had on his original code. Also, you may receive more help if you address other members of this forum--instead of just Lee (many people may be able to help and I'm sure Lee is often busy).
Title: Re: Revision cloud using calligraphy arcs
Post by: ChrisCarlson on March 02, 2016, 09:20:50 AM
If you are putting revision clouds into model space, why not just make the revision block annotative?