.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MLeader how to get the total scale of a mleader?

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
anikakramer2006
971 Views, 11 Replies

MLeader how to get the total scale of a mleader?

Hello alltogether,

 

how to set the total scale of a mleader in C#?

In German it's called: Gesamtskalierung

 

I had no Problem with this....

 

_mLeader.LandingGap = 6;

_mLeader.TextHeight = 60;

_mLeader.MLeaderStyle = _mleaderStyleId;

 

but the total scale is also very important for me....

 

I try to add a picture with a red frame so you

can see what I' missing.

 

Anika

 

 

11 REPLIES 11
Message 2 of 12

Anika, i would help if we new what version your using. For those reading, in the english verstion, it's "Overall Scale", under misc, controls the scale for non-annotative mleaders. I have not the time to test currently, but here's what little i found:

in VS 2012 for acad 2014, there's Mleader.Scale property, but this does not exist in VS 2010 for acad 2013.

Message 3 of 12

Oh, I'm so sorry. It was a busy day.

We use AutoCAD 2013 and AutoCAD Architecture 2013.

 

Greetings from Germany,

Anika

Message 4 of 12

...and I'm using Visual Studio 2010.... if this helps.
Anika
Message 5 of 12

Yes it does, thank you. I'm suspecting its something that may not be exposed to the API for 2013. If anyone can confirm this? If so, you may have to scale the mleader object after creating it. I'll try and find some time to play with this later today, hopefully someone else will figure it out before then. 🙂

Message 6 of 12

thank you for trying. I also try to find something about this.

Until now I found this one:http://www.theswamp.org/index.php?topic=31861.msg386494#msg386494

but as you said... "that may not be exposed to the API for 2013"...

let's see what we've got tomorrow...

Smiley Happy

Message 7 of 12

...hm, seems like nobody else has an answer to this...
and _mleader.scale... is not working .... :O(
Message 8 of 12

I think what you found with the interop is probably the way. Although perhaps looking into LISP might yield better/easier results?

Message 9 of 12

 

Anika, heres a quick LISP for you to look at:

 

(vl-load-com)
(defun c:mltest	(/ a1 ap mlap mlap1 line)
  (setq ap (mlcheck))
  (if (/= ap T)
    (mlblk)
    (princ)
  )
  (setvar "cmleaderstyle" "MKA Arrow Leader - Plan")
  (initcommandversion 2)
  (command "mleader")
  (while (= 1 (getvar "cmdactive"))
    (command pause)
    (setq mlap1 (entlast))
  )
  (setq mlap (vlax-ename->vla-object mlap1))
  (vlax-put-property mlap 'TextLineSpacingStyle 2)
  (vlax-put-property mlap 'TextLineSpacingFactor 1.0)
  (vlax-put-property mlap 'ScaleFactor 2.0)
  (vlax-release-object mlap)  
  (princ)
)

 So the "(vlax-put-property mlap 'ScaleFactor 2.0)" is the line your looking for, currently static value, but could be changed for user input or other.. I took this from one of our existing LISP's so please change things as needed.

Message 10 of 12
Anonymous
in reply to: anikakramer2006

Please try this:

 

_mLeader.Scale = 1;

Message 11 of 12
jeff
in reply to: Anonymous

It was added for 2014 API

 

mleaderscale.PNG

 

You can also find your answers @ TheSwamp
Message 12 of 12
anikakramer2006
in reply to: jeff

Thank you so much for helping me.

I got the total scale of the mleaer by the mleaderstyle

and I also set the frame into the right position with

MLeader.LandingGap = 0.5;

... so now all of my framed MLeaders are fine!

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost