create new mleader style in Visual basic

create new mleader style in Visual basic

Anonymous
Not applicable
1,093 Views
5 Replies
Message 1 of 6

create new mleader style in Visual basic

Anonymous
Not applicable

hi

i need create new mleader style. somebody can helpme?

 

set style_mleader=autocad.application.ActiveDocument.????????. add("New style").......????

 

0 Likes
Accepted solutions (1)
1,094 Views
5 Replies
Replies (5)
Message 2 of 6

norman.yuan
Mentor
Mentor

AcadMLeaderStyle is stored in AcadDocument.Dictionaries (named dictionaries of the drawing database). AutoCAD VBA help document provides a code sample of how to access/ccreate it:

 

Go to AutoCAD VBA Editor, open Object Browser, select "AcadMLeaderStyle", then click "?" button on top of the Object Browser. This opens VBA Help Document on the topic of "MLeader Style". In the article, there is a link to a code sample.

 

HTH

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

thanks norman.juan for reply....

 

i tried that....

 

 c.jpg

 

 

 

 

 

0 Likes
Message 4 of 6

norman.yuan
Mentor
Mentor

In the red-highlighted line of code, you need to remove the bracket

 

xxxx.AddObject "ccccc", "ddddd"

 

Or you add Call at beginning:

 

Call xxxx.AddObject("cccc", "dddd"),

 

Or if you want to refer the returned object in the code following, you need:

 

Dim myMLealerStyle as Object

Set myMleaderStyle=xxxx.AddObject("cccc","dddd")

 

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 6

norman.yuan
Mentor
Mentor
Accepted solution

In the red-highlighted line of code, you need to remove the bracket

 

xxxx.AddObject "ccccc", "ddddd"

 

Or you add Call at beginning:

 

Call xxxx.AddObject("cccc", "dddd"),

 

Or if you want to refer the returned object in the code following, you need:

 

Dim myMLealerStyle as Object

Set myMleaderStyle=xxxx.AddObject("cccc","dddd")

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 6 of 6

Anonymous
Not applicable

I added that and worket:

 

Dim myMLealerStyle as Object

Set myMleaderStyle=xxxx.AddObject("cccc","dddd")

 

 

thank you very much 

0 Likes