weekendor 发表于 2005-11-11 11:57:00

[求助]怎样读AcadEntity类型的值?

<P>&nbsp;&nbsp;&nbsp; Dim entry As AcadEntity<BR>&nbsp;&nbsp;&nbsp; Dim x&nbsp;As Double<BR>&nbsp;&nbsp;&nbsp; For Each entry In ThisDrawing.ModelSpace<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If entry.ObjectName = "AcDbLine" Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '...<BR>&nbsp;&nbsp;&nbsp; Next<BR>&nbsp;&nbsp;&nbsp; '...<BR>&nbsp;&nbsp;&nbsp; x =&nbsp;entry.StartPoint(0)</P>
<P>程序目的:把entry定义成AcadEntity类型开来搜索图中所有实体,如果得到为直线类型时,想取得它的X坐标值。<BR>出现问题:执行entry.StartPoint(0)这句时,出现错误:“property let过程未定义,property get过程未返回对象”</P>
<P>想请教:能有什么办法可以不把entry赋给另一直线类型的变量、而直接读出它里面StartPoint(0)的值(我在监视窗口中看到它已变了IAcadLine类型,且具有StartPoint值)??</P>

雪山飞狐_lzh 发表于 2005-11-11 15:36:00

<P>pnt=entry.StartPoint</P>
<P>x=pnt(0)</P>

weekendor 发表于 2005-11-11 16:01:00

<P>明白! 十分感谢! :)</P>
页: [1]
查看完整版本: [求助]怎样读AcadEntity类型的值?