UNknown number of points in mleader command

UNknown number of points in mleader command

kpennell
Collaborator Collaborator
1,196 Views
6 Replies
Message 1 of 7

UNknown number of points in mleader command

kpennell
Collaborator
Collaborator

A recent previous post I created, managed to get solved, asking how to modify the qleader settings.

Following some testing, it is very boggish, if you're not working in  paper space, some dimensions and leaders do need to be in model space.

One of the recommendations were to look at mleader, and I think it's a viable option, as it's come a long way.  One of the things I'm struggling with now though, is that the following bit of code works, if the user picks two points:

(command "_Mleader" pause pause pause "FLUSH\\P(TYP)")

But if the user picks more than two points, I don't get the text to populate in the drawing next to the leader, but the user is then prompted.

I'm thinking a long way around this, is to create a leader, retrieve the points, delete it, then rebuild it based on the number of points of the original.

The command is still active, so the while function and looking at the cmdactive variable won't work here I don't think.

Thanks,

KP

0 Likes
Accepted solutions (1)
1,197 Views
6 Replies
Replies (6)
Message 2 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

@kpennell wrote:

 

... But if the user picks more than two points, I don't get the text to populate in the drawing next to the leader, but the user is then prompted.

I'm thinking a long way around this, is to create a leader, retrieve the points, delete it, then rebuild it based on the number of points of the original....


 

Hmm, this is always complicated, having n-inputs in the middle. 

This works, but requires 2 different styles, one without text, the second with.

 

(setvar 'CMLEADERSTYLE "MLeaderStyleNoneContent")
(command-s "_.MLEADER")
(vla-put-StyleName (vlax-ename->vla-object (entlast)) "MLeaderStyleWithMtext")
(vla-put-TextString (vlax-ename->vla-object (entlast))  "FLUSH\\P(TYP)")

 

Or use a polyline to draw the figure. People do that too.

0 Likes
Message 3 of 7

kpennell
Collaborator
Collaborator

Worked like a charm..... thank you.

0 Likes
Message 4 of 7

kpennell
Collaborator
Collaborator

I'm certainly going to roll this out to the team, but I'm wondering if you had any thoughts on the following behavior.

 

If the leader goes from left to right, the text will be justified left.

If the leader goes from right to left, the text is still justified left, until the user moves the 'mtext' entity, and then it changes to justified right.  Is there any way we can have justified right initially?

 

Edit: I tried the screencast option for the video, but it said 'Not a Screencast URL' Uploaded the file instead.

0 Likes
Message 5 of 7

ВeekeeCZ
Consultant
Consultant

Dunno. Obviously, our workaround has some side effects.

But we should be able to fix it, ehm?! 

 

(if (minusp (- (cadr (assoc 10 (entget (entlast)))) (cadr (assoc 110 (entget (entlast))))))
  (vla-put-TextJustify (vlax-ename->vla-object (entlast)) acAttachmentPointMiddleLeft))
0 Likes
Message 6 of 7

kpennell
Collaborator
Collaborator

Hmmm, sorry to report, that version not working for me.

 

Thanks though, it's really appreciated.

0 Likes
Message 7 of 7

ВeekeeCZ
Consultant
Consultant

Not going to try. Post a dwg with the wrong one and the correct one.

0 Likes