加载线形时失败[求助]
本帖最后由 作者 于 2003-4-9 12:55:02 编辑您好,我用以下方法加载线形时失败不知何故??
' 从acadiso.lin文件中加载线型“ACAD_ISO02W100”
ThisDrawing.Linetypes.Load "ACAD_ISO02W100", "acadiso.lin"
Set line = ThisDrawing.ModelSpace.AddLine(p1, p2)
line.Linetype = "ACAD_ISO02W100"
line.Update
我用的是acad2000
按你的说法没有问题,注意线型不能重复加载,如重复加载会出错
Sub SetLineType()On Error Resume Next
Dim LT As AcadLineType
Set LT = ThisDrawing.Linetypes("ACAD_ISO02W100")
If Err Then ThisDrawing.Linetypes.Load "ACAD_ISO02W101", "acadiso.lin"
Dim p1(0 To 2) As Double
Dim p2(0 To 2) As Double
Dim line As AcadLine
p1(0) = 0
p1(1) = 0
p1(2) = 0
p2(0) = 100
p2(1) = 100
p2(2) = 0
Set line = ThisDrawing.ModelSpace.AddLine(p1, p2)
line.Linetype = "ACAD_ISO02W100"
line.Update
End Sub
页:
[1]