Author Topic: MLeader Bubble LISP?  (Read 3311 times)

0 Members and 1 Guest are viewing this topic.

trogg

  • Bull Frog
  • Posts: 255
MLeader Bubble LISP?
« on: January 27, 2011, 06:50:17 PM »
I am looking for a LISP that uses MLeaders and creates a circle (bubble) and/rectangle around the text or #s.
I have looked here (the swamp), Augi, AutoDesk forums... CadTutor is currently down, so I haven't been able to check there.
I have tried about 20 different leaders that create (or so they claim) circles or rectangles but they all tend to act weird.
Some of the problems are: they disregard the letter or # and fill in a zero. Create the letter/#, arrow way too small.  :realmad:

Too bad Andrea's DiLeader doesn't work for any computer I have tried it on, because it has a geometry option that I don't know what it does...

Any help would be appreciated.


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: MLeader Bubble LISP?
« Reply #1 on: January 27, 2011, 06:57:04 PM »
There's this by Luis, I don't think it uses MLeaders though  :|

trogg

  • Bull Frog
  • Posts: 255
Re: MLeader Bubble LISP?
« Reply #2 on: January 27, 2011, 08:02:38 PM »
Thanks Lee,
But like the rest, It doesn't work. It just makes lines.

trogg

  • Bull Frog
  • Posts: 255
Re: MLeader Bubble LISP?
« Reply #3 on: January 27, 2011, 09:01:32 PM »
OK,
I just found out about the option of attaching a block to the MLeader.

This would explain why their aren't many Lisps out there to do this. or many MLeader LISPs in general.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: MLeader Bubble LISP?
« Reply #4 on: January 28, 2011, 06:51:06 AM »
 :-D

lfe011969

  • Guest
Re: MLeader Bubble LISP?
« Reply #5 on: January 28, 2011, 06:51:15 AM »
Here's one I put together a while ago so I'm sure the code can be improved.  In fact this only works if the mleader block already exists in the drawing (not a problem currently as the block is already inserted in the templates we use).  I think I might see if I can improve on it today.

Code: [Select]
(defun c:findno ( / findno oldlay oldosmode str )

  ;; © Lee Mac 2010
  (defun *error* (/ msg)
    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n ** Error: " msg " **"))
    )
    (princ)
  )

  (setq oldlay (getvar "clayer"))
  (setq oldosmode (getvar "osmode"))
  (if (= (tblsearch "layer" "ANNOTATION") nil)
    (command "-layer"  "m" "ANNOTATION"     "C"
    "cyan"    "" "LW"   "0.25"    ""
    "L"       "Continuous"   ""     ""
   )
    (setvar "clayer" "ANNOTATION")
  )
  (setq findno (getstring "\nEnter Find Number: "))
  (setq str (getstring T "\nEnter any extra comments: "))
  (if (= (tblsearch "BLOCK" "bubble") nil)
    (alert "Find number block not found!")
    (command "_mleader"       "o" "a" "y"  "0.18"
    "c"      "b"      "bubble" "x" pause  pause
    findno   str
   )
  )
  (setvar "clayer" oldlay)
  (setvar "osmode" oldosmode)
  (princ)
)

trogg

  • Bull Frog
  • Posts: 255
Re: MLeader Bubble LISP?
« Reply #6 on: January 28, 2011, 09:51:16 AM »
Hey  lfe011969,
Thanks for sharing this routine.
I'm going to make a block that goes along with this and try it.
Does this fill in attributes in the block? And if so, do the attributes have to have a certain Tag Name?
& What size does the block (circle) need to be?
~Greg

trogg

  • Bull Frog
  • Posts: 255
Re: MLeader Bubble LISP?
« Reply #7 on: January 29, 2011, 01:08:08 PM »
I have done it again...
I asked for a LISP routine to do what AutoCAD already has built in to it. :ugly:
There is a tab on the Tool Palette called "Leaders" of all things. And guess what kind of options these leaders have?...
...The exact options I was hoping to accomplish through a LISP routine.
I was stoked to find this today, I hope that you guys find these helpful too.
~Greg