.NET

.NET

Reply
Active Contributor
anikakramer2006
Posts: 29
Registered: ‎03-23-2011
Message 1 of 12 (321 Views)
Accepted Solution

MLeader how to get the total scale of a mleader?

321 Views, 11 Replies
09-09-2013 07:57 AM

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

 

 

 

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.

Mentor
conormccartney3897
Posts: 187
Registered: ‎08-18-2010
Message 2 of 12 (311 Views)

Re: MLeader how to get the total scale of a mleader?

09-09-2013 09:16 AM in reply to: anikakramer2006

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.

Active Contributor
anikakramer2006
Posts: 29
Registered: ‎03-23-2011
Message 3 of 12 (306 Views)

Re: MLeader how to get the total scale of a mleader?

09-09-2013 10:38 AM in reply to: anikakramer2006

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

We use AutoCAD 2013 and AutoCAD Architecture 2013.

 

Greetings from Germany,

Anika

Active Contributor
anikakramer2006
Posts: 29
Registered: ‎03-23-2011
Message 4 of 12 (305 Views)

Re: MLeader how to get the total scale of a mleader?

09-09-2013 10:39 AM in reply to: anikakramer2006
...and I'm using Visual Studio 2010.... if this helps.
Anika
Mentor
conormccartney3897
Posts: 187
Registered: ‎08-18-2010
Message 5 of 12 (299 Views)

Re: MLeader how to get the total scale of a mleader?

09-09-2013 10:46 AM in reply to: anikakramer2006

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. :smileyhappy:

Active Contributor
anikakramer2006
Posts: 29
Registered: ‎03-23-2011
Message 6 of 12 (292 Views)

Re: MLeader how to get the total scale of a mleader?

09-09-2013 11:22 AM in reply to: conormccartney3897

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...

:smileyhappy:

Active Contributor
anikakramer2006
Posts: 29
Registered: ‎03-23-2011
Message 7 of 12 (263 Views)

Re: MLeader how to get the total scale of a mleader?

09-11-2013 05:07 AM in reply to: anikakramer2006
...hm, seems like nobody else has an answer to this...
and _mleader.scale... is not working .... :smileysurprised:(
Mentor
conormccartney3897
Posts: 187
Registered: ‎08-18-2010
Message 8 of 12 (255 Views)

Re: MLeader how to get the total scale of a mleader?

09-11-2013 08:15 AM in reply to: anikakramer2006

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

Mentor
conormccartney3897
Posts: 187
Registered: ‎08-18-2010
Message 9 of 12 (244 Views)

Re: MLeader how to get the total scale of a mleader?

09-11-2013 04:01 PM in reply to: conormccartney3897

 

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.

Member
HONGBINREN
Posts: 3
Registered: ‎09-11-2013
Message 10 of 12 (234 Views)

Re: MLeader how to get the total scale of a mleader?

09-11-2013 07:53 PM in reply to: anikakramer2006

Please try this:

 

_mLeader.Scale = 1;

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.