如何根据xdata来构造选择集
<P>如何根据实体的xdata来构造选择集,选择出xdata具有某特征的实体</P> <A href="http://discussion.autodesk.com/thread.jspa?messageID=429442" target="_blank" >http://discussion.autodesk.com/thread.jspa?messageID=429442</A> <P>转载如下:</P><P>'加入扩展数据</P>
<P>Public Function AddXDATA()<BR>Dim returnObj As AcadObject<BR>ReDim xtype(0 To 1) As Integer<BR>ReDim xdata(0 To 1) As Variant<BR>Dim basePoint(0 To 2) As Double<BR><BR>ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"<BR>xtype(0) = 1001: xdata(0) = "AAA"<BR>xtype(1) = 1000: xdata(1) = "888"<BR>returnObj.SetXDATA xtype, xdata<BR>End Function<BR></P>
<P>'建选择集</P>
<P>Public Function FindEntByXData()<BR>Dim tempsset1 As AcadSelectionSet Dim filterType1(1) As Integer<BR>Dim filterData1(1) As Variant<BR>filterType1(0) = 1001: filterData1(0) = "AAA"<BR>filterType1(1) = 1000: filterData1(1) = "888"<BR>Set tempsset1 = acadDoc.SelectionSets.Add("SSet")<BR>tempsset1.Clear<BR>tempsset1.Select acSelectionSetAll, , , filterType1, filterData1<BR>tempsset1.Delete<BR>End Function<BR></P> 除了轻量级多段线外,1000码不能做为过滤条件 谢谢楼上各位
页:
[1]