mayuezxl 发表于 2005-7-21 22:50:00

如何用vba获取CAD图形中的文字及对应的坐标

求救,如何用vba获取CAD图形中的文字及对应的坐标,谢谢各位了

my_computer 发表于 2005-7-22 10:23:00

text.InsertionPoint

mayuezxl 发表于 2005-7-22 12:02:00

<P>谢谢你的指点,能否再说的详细点,多谢了</P>

pphhbb1234 发表于 2006-7-28 19:39:00

<P>如何能够得到一个未知的AUTOCAD文件中的所有文字的坐标那?前提是文字不是通过该AUTOCAD VBA程序导入的.请各位大虾好的程序.AUTOCAD帮助里面都是先输入文字然后得到它的坐标,这对上面的问题是没用的.</P>

fjfhgdwfn 发表于 2006-7-30 09:57:00

<P>sub main()&nbsp;</P>
<P>Dim ssetObj As AcadSelectionSet<BR>&nbsp;&nbsp;&nbsp; Dim ssobj As AcadSelectionSet<BR>&nbsp;&nbsp;&nbsp; Dim CONUT As Integer<BR>&nbsp;&nbsp;&nbsp; CONUT = 0<BR>&nbsp;&nbsp;&nbsp; Count = ThisDrawing.SelectionSets.Count<BR>&nbsp;&nbsp;&nbsp;&nbsp; For i = 0 To Count - 1 '删除所有的选择集<BR>&nbsp;&nbsp;&nbsp; Set ssetObj = ThisDrawing.SelectionSets.Item(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssetObj.Delete<BR>&nbsp;&nbsp;&nbsp; Next i<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; Dim sjx &nbsp;As AcadSelectionSet<BR>&nbsp; <BR>&nbsp;&nbsp; Dim FilterType(1) As Integer<BR>&nbsp;&nbsp; Dim FilterData(1) As Variant<BR>&nbsp;&nbsp; Set sjx = ThisDrawing.SelectionSets.Add("sjx")<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; FilterType(0) = 0<BR>&nbsp;&nbsp; FilterData(0) = "text" '是圆</P>
<P>&nbsp;&nbsp; 'FilterType(1) = 62<BR>&nbsp;&nbsp; 'FilterData(1) = 10&nbsp; '颜色是3</P>
<P>&nbsp;&nbsp; FilterType(1) = 8<BR>&nbsp;&nbsp; FilterData(1) = "shuju"&nbsp; '图层是0<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; Dim mode As Integer<BR>&nbsp;&nbsp; mode = acSelectionSetAll<BR>&nbsp; sjx.Select mode, , , FilterType, FilterData</P>
<P>&nbsp;Dim entry As AcadEntity</P>
<P>&nbsp; Dim point As Variant</P>
<P>For Each entry In sjx</P>
<P>point = entry.InsertionPoint</P>
<P>msgbox point(0)</P>
<P>......</P>
<P>next entry</P>
<P>end sub</P>
<P>&nbsp;</P>

pphhbb1234 发表于 2006-7-30 13:45:00

<P>经过<A name=88409><FONT color=#000066><B>fjfhgdwfn</B></FONT></A>大虾的程序测试,发现有不匹配的问题出现,point = entry.InsertionPoint提示MISPATCH,而且选择集程序中FILTER等都不明白具体含义?大虾能介绍一下吗?</P>

fjfhgdwfn 发表于 2006-7-30 14:22:00

应不会吧.我在用啊.我使用了过滤选择,留下QQ交流下了.我也是一个初学都.实际上帮助里都有的.多看看一般问题都可以解决的.

pphhbb1234 发表于 2006-7-30 15:51:00

<P>太好了,<A name=88414><FONT color=#000066><B>fjfhgdwfn</B></FONT></A>,我的QQ是48272190,我非常喜欢研究autocad vba</P>
<P>&nbsp;</P>
页: [1]
查看完整版本: 如何用vba获取CAD图形中的文字及对应的坐标