MultiLeader color and Text fromat in VBA

MultiLeader color and Text fromat in VBA

Anonymous
Not applicable
2,210 Views
3 Replies
Message 1 of 4

MultiLeader color and Text fromat in VBA

Anonymous
Not applicable

I have created multileader in my VBA code. I want to set multileader color . i can set color by changing 'Color' option in General tab  through properties option. but how can i change that in VBA. I tried LeaderLineColor, but it didnt work. I wan to change the text font for mleader text string.

Dim leaderObj As AcadMLeader
   Dim points(0 To 8) As Double
points(0) = x: points(1) = y: points(2) = 0 points(3) = x + 0.5: points(4) = y + 0.5: points(5) = 0 points(6) = x + 0.8: points(7) = y + 0.8: points(8) = 0 Set leaderObj = ThisDrawing.ModelSpace.AddMLeader(points, 0) leaderObj.textString = textString leaderObj.TextHeight = 0.3 leaderObj.TextFrameDisplay = 1 leaderObj.Update ZoomAll
0 Likes
2,211 Views
3 Replies
Replies (3)
Message 2 of 4

Ed__Jobe
Mentor
Mentor

I don't recommend changing the color. You should work with styles and layers. Leave the color ByLayer and change the layer property. To change the color of the leader text, change that in the dim style and set the style by using the StyleName property. e.g.

leaderObject.StyleName = "MyLeaderStyle"

 

The style must exist in the current dwg. If not, you can use the DimStyle.CopyFrom method to copy from a template.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 4

jeremye86
Advocate
Advocate

Thanks Ed, you have helped me so many times

0 Likes
Message 4 of 4

Ed__Jobe
Mentor
Mentor

You're welcome.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes