TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jbuzbee on May 06, 2008, 11:28:49 AM

Title: Mleader & Annotation
Post by: jbuzbee on May 06, 2008, 11:28:49 AM
AutoCAD 2009

ActiveX Help for MLEADER Objects:
Quote
Any annotation attached to the end of the leader line is associated with the MLeader object and can be found using the Annotation property.

Oh no there isn't:
Quote
ActiveX Server returned the error: unknown name: Annotation

I'm trying to change over some Qleader stuff to use Mleader, BUT; The Mtext Editor doesn't come up when Content is set to Mtext. :-o

I'd just as well go back and use Qleader, but AutoCAD warns: (From the Qleader Help)
Quote
It is recommended that you use the workflow available through the MLEADER command to create leader objects.

So now I'm scared . . .  :lol:

What's everyone else doing???    Thanks.
Title: Re: Mleader & Annotation
Post by: jbuzbee on May 06, 2008, 12:02:03 PM
Calling the mleader command, with the mleader style's content to be mtext, the mtext editor is shown.

Calling the mleader command, with the mleader style's content set to none, then using the command line option to set it to mtext the mtext editor is shown.

Calling mleader from Lisp won't show the mtext editor, only command line text.

Calling this macro from a toolbar button,
Code: [Select]
^C^C_mleader _o _l _s _c _m _x won't show the mtext editor, only command line text.

Is there a system variable that controls this?  Niether (initdia) or cmddia work.

If this is by design then it sucks  :x
Title: Re: Mleader & Annotation
Post by: Crank on May 08, 2008, 10:56:44 PM
I get the MTEXT editor. Notice that the options for MTEXT are now on the Ribbon.

If you want to see the old toolbar, you need to set the variable MTEXTTOOLBAR to 1.
Title: Re: Mleader & Annotation
Post by: jbuzbee on May 09, 2008, 10:12:29 AM
MTEXTTOOLBAR is set to 1.

If mleader is called from either lisp or button macro no mtext editor is displayed.  If I could figure out how to get the mtext object linked to a mleader I could write a work-around.
Title: Re: Mleader & Annotation
Post by: Crank on May 09, 2008, 01:19:30 PM
Maybe you can try something like this:
Code: [Select]
(defun c:DrawMleader (/ cc_echo cc_ss cc_texteval CL)
(command ".undo" "begin")
(setq CL (getvar "CLAYER"))
; (LoadMLstyle)
; (set-ML-layer)
(setq cc_texteval (getvar "texteval"))
(setvar "texteval" 1)
(setq cc_echo (getvar "cmdecho"))
(setvar "cmdecho" 1)
; (command "_.acad_dim.mleader")
; (while (= (logand (getvar "cmdactive") 1) 1)
; (command pause)
; )

(command "_.acad_dim.mleader" pause pause "")

(setvar "cmdecho" cc_echo)
(setvar "texteval" cc_texteval)
(setq cc_ss (entlast))
(if (= (vla-get-ContentType (vlax-ename->vla-object cc_ss)) 2) ;check availability of mtext content
(command "_.ddedit" cc_ss "") ;edit text and exit command
)
(setvar "CLAYER" CL)
(command ".undo" "end")
(princ)
)
Title: Re: Mleader & Annotation
Post by: jbuzbee on May 09, 2008, 01:57:28 PM
Wow  :-o  that is EXACTLY what I needed.

Where in the heck did you find _.acad_dim.mleader ???
Title: Re: Mleader & Annotation
Post by: Crank on May 09, 2008, 04:30:29 PM
Shhhh....

That's confidential information (not supported of course ;) ).
Title: Re: Mleader & Annotation
Post by: cmwade77 on May 13, 2008, 01:25:08 PM
What adavantage is there to using  _.acad_dim.mleader over using ._mleader ?

and what is the ._acad_dim stuff anyway?
Title: Re: Mleader & Annotation
Post by: Crank on May 13, 2008, 06:06:40 PM
What adavantage is there to using  _.acad_dim.mleader over using ._mleader ?

and what is the ._acad_dim stuff anyway?
_.acad_dim.mleader is one of the many build in commands of autocad. I wrote this when I was testing a very early build of Spago.
So, there is no adavantage. Both commands do the same, but only ._mleader is official (and supported).