MLeader text position and justification

MLeader text position and justification

SAPER59
Advocate Advocate
2,137 Views
6 Replies
Message 1 of 7

MLeader text position and justification

SAPER59
Advocate
Advocate

I need to change the text position from one side to the other from  mleader arrow extreme and so must change text point and text justification

I tried with (vla-put-TextJustify   (vla-put-TextRightAttachmentType  (vla-put-TextDirection  but can not get it

I can rotate it with vla-put-TextRotation to align with the line I want to,  but need to put the text from the side the "flow direction" comes 

 

Thanks in advance to any sugestion

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

ВeekeeCZ
Consultant
Consultant

Post a dwg example with states before and after to take a look.

0 Likes
Message 3 of 7

SAPER59
Advocate
Advocate

Here is the file

When goes from one side do it ok and changing the direction, no

Thanks for your time

0 Likes
Message 4 of 7

CodeDing
Advisor
Advisor

@SAPER59,

 

Even with your drawing it is hard to understand what you are asking for. Can you explain more? Have you tried using the MIRROR command?

 

Best,

~DD

0 Likes
Message 5 of 7

SAPER59
Advocate
Advocate

I create the mleader with (vla-AddMLeader ....... so I can not mirror it, and I don't use (command line ...)

I need to represented the "flow" from one end to the other end of the line)

When the flow goes in inverse direction the mleader is created as mirrored respect the other

The point is that I can not positioned the text and small line in the right way

If you have a look in parallel lines is represented both directions one for line, and in one the mleader is OK and in the other no.

Thanks anyway

0 Likes
Message 6 of 7

CodeDing
Advisor
Advisor
Accepted solution

@SAPER59,

 

I am sorry if I still do not fully understand. But it looks like you should be looking into either MIRRTEXT or the vla-Mirror method. I wish I could provide more help for you. Here is some code I was experimenting with.

(vl-load-com)
(defun c:TESTLEADER()
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Define the leader points
    (setq points (vlax-make-safearray vlax-vbDouble '(0 . 5)))
    (vlax-safearray-fill points '(1 1 0
                                  10 10 0
                                 )
    )
  
    ;; Add the mleader object to model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq mLeader (vla-AddMLeader modelSpace points i))

    (setq mp1 (vlax-make-safearray vlax-vbDouble '(0 . 2)))
    (vlax-safearray-fill mp1 '(0 0 0))
    (setq mp2 (vlax-make-safearray vlax-vbDouble '(0 . 2)))
    (vlax-safearray-fill mp2 '(0 1 0))
    (setq mp3 (vlax-make-safearray vlax-vbDouble '(0 . 2)))
    (vlax-safearray-fill mp3 '(-1 0 0))

    (setq mLeader2 (vla-mirror mLeader mp1 mp2))

    (setq mLeader (vla-mirror mLeader2 mp1 mp3))
    (vla-delete mLeader2)

)

Best,

~DD

0 Likes
Message 7 of 7

SAPER59
Advocate
Advocate

Thanks CodeDing

I will use it as a solution.

Even do I will try to find how can it be created from the bigining in that mode, without the trick of mirroring, but yours is a very good solution

 

Thanks again

0 Likes