Bubbleinc.lsp is not working in AMEP 2014

Bubbleinc.lsp is not working in AMEP 2014

Gartner13205
Explorer Explorer
608 Views
4 Replies
Message 1 of 5

Bubbleinc.lsp is not working in AMEP 2014

Gartner13205
Explorer
Explorer

This is a great incremental tagging routine but it has stopped working properly for me now that I am using AutoCAD MEP 2014.  It worked in AutoCAD MEP 2012 but now it will not increment.  I have created the BUBBLE multi leader style as required and it works right up until it is supposed to automatically number the tag.

 

Thanks for any help you can offer.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

0 Likes
Accepted solutions (2)
609 Views
4 Replies
Replies (4)
Message 2 of 5

CADaSchtroumpf
Advisor
Advisor
Accepted solution

Perhaps...

Put system variable ATTDIA to 0 before using your code , or make this in the code.

Message 3 of 5

Gartner13205
Explorer
Explorer

That worked!  Thank you so much.  I would like to put this in the code but I am code-challenged.  Would you be able to tell me where to put it and exactly what I should type? 

 

Thanks again, this is fabulous!

0 Likes
Message 4 of 5

CADaSchtroumpf
Advisor
Advisor
Accepted solution

Quickly,

(defun c:BI (/ *error* _toLayer style layer cmd sty attd pt lst)
  ;; Bubble Increment (MLeader style required)
  ;; Alan J. Thompson, 12.04.11

  (setq style "BUBBLE" ; MLeader style (with single attribute block)
        layer nil ; layer to place MLeader objects on (optional, nil for current layer)
  )

  (vl-load-com)

  (defun *error* (msg)
    (and cmd (setvar 'CMDECHO cmd))
    (and sty (setvar 'CMLEADERSTYLE sty))
    (and attd (setvar 'ATTDIA attd))
    (and *AcadDoc* (vla-endundomark *AcadDoc*))
    (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,")))
      (princ (strcat "\nError: " msg))
    )
  )

  (setq _toLayer
         (eval
           (list
             'lambda
             '(e / d)
             (if (and layer (snvalid layer))
               '(entupd
                 (cdr (assoc -1 (entmod (subst (cons 8 layer) (assoc 8 (setq d (entget e))) d))))
                )
             )
           )
         )
  )

  (vla-startundomark
    (cond (*AcadDoc*)
          ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
    )
  )

  (setq cmd (getvar 'CMDECHO)
        sty (getvar 'CMLEADERSTYLE)
        attd (getvar 'ATTDIA)
  )
  (setvar 'CMDECHO 0)
  (setvar 'ATTDIA 0)

  (cond ((not (vl-catch-all-error-p (vl-catch-all-apply 'setvar (list 'CMLEADERSTYLE style))))
         (initget 6)
         (setq *BI:Inc* (cond ((getint (strcat "\nSpecify starting number <"
                                               (itoa (cond (*BI:Inc*)
                                                           ((setq *BI:Inc* 1))
                                                     )
                                               )
                                               ">: "
                                       )
                               )
                              )
                              (*BI:Inc*)
                        )
         )

         (while (if lst
                  (progn (initget "Undo") (setq pt (getpoint "\nSpecify starting point [Undo]: ")))
                  (setq pt (getpoint "\nSpecify starting point: "))
                )
           (if (eq pt "Undo")
             (progn (entdel (car lst)) (setq *BI:Inc* (1- *BI:Inc*)) (setq lst (cdr lst)))
             (progn
               (princ "\nSpecify other point: ")
               (vl-cmdf "_.mleader" "_non" pt PAUSE)
               (if (eq (logand 1 (getvar 'CMDACTIVE)) 1)
                 (progn (vl-cmdf *BI:Inc*)
                        (setq *BI:Inc* (1+ *BI:Inc*)
                              lst      (cons (entlast) lst)
                        )
                        (_toLayer (car lst))
                 )
               )
             )
           )
         )
        )
        ((alert (strcat style " multileader style not loaded!")))
  )

  (*error* nil)
  (princ)
)

 

Message 5 of 5

Gartner13205
Explorer
Explorer

Perfect!  You have saved me big time.

 

Thank you for your help and expertise!

 

0 Likes