CAD/CAM discussion forum > CAD > fail to load linetypes by VBA (solved)

fail to load linetypes by VBA (solved)

Rank: 1

westabra3914

Newbie

posts: 7

Registered: 2013-6-6

Message 1 of 7

 fail to load linetypes by VBA (solved)
23-10-2013 12:38 . pm | View his/her posts only
Dear all!
How load linetype in ZWCad
Method:
ThisDrawing.Linetypes.Load "CONTINUOUS", "acad.lin"do not properly

Rank: 9Rank: 9Rank: 9

Jenny

Manager

posts: 481

Registered: 2013-5-6

Message 2 of 7

24-10-2013 05:21 . pm | View his/her posts only
Reply 1# westabra3914

hi, "CONTINUOUS" is ZWCAD+ default existing linetype, to avoid conflict, please try with other, such as "Center"

ThisDrawing.Linetypes.Load "Center", "acad.lin"

Please make sure to add the path of "acad.lin" into ZWCAD+ Support File Search Path.

Rank: 1

westabra3914

Newbie

posts: 7

Registered: 2013-6-6

Message 3 of 7

25-10-2013 03:03 . pm | View his/her posts only
Okey
Method:
ThisDrawing.Linetypes.Load "user_line", "ZWCADiso.lin" run refectly, if loading simple linetype, but if linetype consist of user font reference appear errors. example:
*border_map,border_map___ . ___ . ___ .
A,5.0,-0.75,[CIRC1,ltypeshp.shx,x=0.0,s=0.07],-0.75
if I loading this linetype from standart application method all okey, but if I load from code appear mistake!

Rank: 9Rank: 9Rank: 9

Jenny

Manager

posts: 481

Registered: 2013-5-6

Message 4 of 7

28-10-2013 11:49 . am | View his/her posts only
Reply 3# westabra3914

hi, I tested with attached sample, it can load your linetype by code. Load_LineType.rar (3.49 KB)
Only one problem on my side, when load for the second time, there will be a wrong message:"Metho ‘Load ’of object ‘IZcadLineTypes’ failed", which is not supposed to be. (ID:T8028)

Could you attach your code here and tell me every steps to reproduce the problem?

Rank: 1

westabra3914

Newbie

posts: 7

Registered: 2013-6-6

Message 5 of 7

28-10-2013 01:56 . pm | View his/her posts only
Hi , unfortunatly Yours code is not open in my ZWCAD VBA editor. Appear message "error loading DLL", may by conflict with another language version. Load_LineType_Replay.rar (6.72 KB)

Rank: 9Rank: 9Rank: 9

Jenny

Manager

posts: 481

Registered: 2013-5-6

Message 6 of 7

28-10-2013 02:51 . pm | View his/her posts only
Reply 5# westabra3914

here it is:
Sub test()
ThisDrawing.Linetypes.Load "border_map", "custom.lin"
End Sub

Rank: 1

westabra3914

Newbie

posts: 7

Registered: 2013-6-6

Message 7 of 7

28-10-2013 02:57 . pm | View his/her posts only
Reply 6# Jenny_ZWCAD
Thanks Jenny. I try this.Westabra{:3_41:}
See also