能否根据直线坐标框选位于该直线上下的文字?
<FONT face=宋体>能否根据直线坐标框选位于该直线上下的文字?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT><FONT face=宋体> 我是初学vba的新手,特别是在用选择集时遇到很多难题.我想请教各位高手,用选择集是否能实现<o:p></o:p></FONT>
<FONT face=宋体>利用已知直线的两端点坐标,计算出文本选择框,然后分别在框1,框2内选出框内文字进入选择集,<o:p></o:p></FONT>
<FONT face=宋体>见我的附图.<o:p></o:p></FONT>
<FONT face=宋体>C:\Documents and Settings\rliu\桌面\rein8.wmf<o:p></o:p></FONT> 啊,天哪!!! 我的rein8.wmf图像(附图)怎么传不到,不知别人的图是怎么粘上去的?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>因为我是新手,有那位高手帮我解决这个问题?不胜感激!!!</o:p> 首先通过直线坐标构建一个选择区域,然后采用
Dim sss As Object, Myss As Object, mode As Integer, en As AcadEntity<BR> Dim myRec As AcadLine<BR> Set sss = AcadDoc.SelectionSets<BR> Set Myss = sss.Add("my7ss")<BR> mode = acSelectionSetWindow<BR> Dim point(0 To 2) As Double, point2(0 To 2) As Double
'point,point2为直线的两个端点坐标<BR> point(0) = InsPnt(0) - 2: point(1) = InsPnt(1) - 1<BR> point2(0) = InsPnt(0) + 3: point2(1) = InsPnt(1) + 10
'加减的值是查找文字的范围,根据实际需要确定<BR> Myss.Select mode, point, point2<BR> '-------------------------------------------------------------<BR> For Each en In Myss<BR> 'en包含范围内所有对象,然后针对其中的文本进行处理即可<BR> Next<BR> Myss.Delete<BR> 精辟!!多谢hangc高手无私的帮忙! hangc高手,又要麻烦你了,我拿你的原码来调试,在( 'point,point2为直线的两个端点坐标 point(0) = InsPnt(0) - 2: point(1) = InsPnt(1) - 1)这句出现错误:编译错误--inspnt位置显亮,"子过程或函数未定义",是否还要引用别的函数?麻烦你指教.
页:
[1]