cs3617 发表于 2008-5-18 17:00:00

vb 判断CAD线型是否已加载的函数问题

<p><font color="#369636">Public Function Findlt(LineTypeName As String) As Boolean<br/>Findlt = False<br/>For Each entry In acadDoc.Linetypes<br/>&nbsp;&nbsp;&nbsp; If StrComp(entry.Name, LineTypeName) = 0 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Findlt = True '标志为已找到线型<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For '退出循环<br/>&nbsp;&nbsp;&nbsp; End If<br/>Next entry '结束循环<br/>End Function</font></p><p><font color="#0909f7">For Each entry In acadDoc.Linetypes</font>&nbsp;<font color="#ff0000"> '这句有要求对象的错误</font></p>

xxxtttxxx 发表于 2008-5-18 17:28:00

<p>定义entry了吗?dim entry as object</p><p>另外一般好像习惯用entity或者element等。</p><p></p>

cs3617 发表于 2008-5-18 17:40:00

<font color="#ff0033">定义了,也不行啊,再帮我看看啊</font>

xxxtttxxx 发表于 2008-5-18 23:03:00

<p>换种方法吧,</p><p>for i =0 to x</p><p>linetypes.item(i)</p><p>next</p>
页: [1]
查看完整版本: vb 判断CAD线型是否已加载的函数问题