Jump to content

Need lisp for Rev cloud with tag


dreams

Recommended Posts

Hi all,

I am new to this forum...

 

Is it possible to create lisp for Revision cloud with tag?

 

currently i am using Revision cloud in tool palettes with below mentioned command strings:-

 

Single Text cloud - ^C^Ctcircle \\0.25 ^PR ^PV ^C^Crevcloud ^PO ^PL ^PN

Window revision cloud - ^C^Crectangle \\Revcloud ^PO ^PL ^PN

 

FYI... Revision cloud layer will be "0" & color in "Red"

 

I have attached block for Revision number tag...

 

Can anyone combine these commands in single lisp?

 

It will be very helpful if it is possible...

Rev# Block.dwg

Link to comment
Share on other sites

Try something simple like:

 

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

   (setq bn "Rev# Block") ;; 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)

Link to comment
Share on other sites

Thanks Lee Mac...I heard about you lot that you are genius in Lisp programs...

 

I tried this lisp....its good... but.... Is it possible to change lisp using above mentioned command strings? it will be great..

 

The Rev cloud will be come automatically to each word separate If we select single word or more words....

^C^Ctcircle \\0.25 ^PR ^PV ^C^Crevcloud ^PO ^PL ^PN

 

or if we make window select (Rectangle) 2 or more words...

 

^C^Crectangle \\Revcloud ^PO ^PL ^PN

 

I have attached image file..

Sample.JPG

Edited by dreams
Link to comment
Share on other sites

Hi SLW210.. Thanks for your suggestion about CODE POSTING GUIDELINES..I have already edited my post...i have requested some changes needed in lisp...sorry for my English..I am not very well in English..

Link to comment
Share on other sites

Hi

I am not very well in English (sorry)...I don't know about macros or visual lisp....can any one help me to change below macros for revision cloud with tag?

 

I got this old macro in this cadtutor forum from another useful post..but i have edited some changes as per my requirements with my knowledge..

 

^C^C(setq a(getvar "clayer"));-layer;M;DETAIL;;^C^Crectangle \\Revcloud ^PO ^PL ^PN;;\;-Insert;"Rev_Tri.dwg";\1;1;0;-layer;S;!a;;

 

Its working fine but is it possible to scale up or down for "Rev_Tri.dwg" as per my required layout area like scale 1/2 or 1/4 or 1/8...

 

FYI..currently Revision triangle "Rev_Tri.dwg" scale is 1/4.. triangle text height will be 4-1/2" inches...

 

Can anyone help me?

Rev_Tri.dwg

Rev.JPG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...