zyq_dummy 发表于 2006-5-3 15:30:00

请问真正高手:关于CAD里面选择集过滤器的使用

Dim sobj As AcadObject<BR>&nbsp;&nbsp; Dim ssetObj As AcadSelectionSet<BR>&nbsp; Dim GpCode(0 to 1) As Integer<BR>&nbsp;&nbsp;&nbsp; Dim DataValue(0 to 1) As Variant<BR>&nbsp;&nbsp; Set ssetObj = ThisDrawing.SelectionSets.Add("SSET" + CStr(Rnd(1)))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GpCode(0) = 0<BR>&nbsp;&nbsp;&nbsp; DataValue(0) = "Line"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GpCode(1) = 8<BR>&nbsp;&nbsp;&nbsp; DataValue(1) = "0"<BR>&nbsp;&nbsp; Mode = acSelectionSetAll<BR>&nbsp;ssetObj.Select Mode, , , GpCode, DataValue<BR>上面可以选择0图层里面的所有线<BR>怎么选择0图层里面的所有块?<BR>&nbsp;用以下都不行:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GpCode(0) = 0<BR>&nbsp;&nbsp;&nbsp; DataValue(0) = "Block"<BR>or<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GpCode(0) = 0<BR>&nbsp;&nbsp;&nbsp; DataValue(0) = "BlockRef"<BR>

雪山飞狐_lzh 发表于 2006-5-3 19:02:00

DataValue(0) = "Insert"

ZKSJLL 发表于 2006-5-15 14:25:00

<P>雪山飞狐 老大,请问如何将几个不同块名的块添加到一个选择<STRONG>集???</STRONG></P>
<P>Dim sobj As AcadObject<BR>&nbsp;&nbsp; Dim ssetObj As AcadSelectionSet<BR>&nbsp; Dim GpCode(0 to 1) As Integer<BR>&nbsp;&nbsp;&nbsp; Dim DataValue(0 to 1) As Variant<BR>&nbsp;&nbsp; Set ssetObj = ThisDrawing.SelectionSets.Add("SSET" + CStr(Rnd(1)))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GpCode(0) = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataValue(0) = "Line"</P>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GpCode(1) =&nbsp;2</P>
<P>&nbsp;&nbsp;&nbsp; DataValue(1) = "z1,z2,z3"</P>
<P><BR>&nbsp;&nbsp; Mode = acSelectionSetAll<BR>&nbsp;ssetObj.Select Mode, , , GpCode, DataValue<BR>上面可以选择块名为z1,z2,z3的所有块</P>
<P>请问:</P>
<P>如何以 OR&nbsp;的关系分别选择??</P>
<P>&nbsp;DataValue的值可否为空??</P>
<P>可否用一小结构??</P>
<P>GpCode(1) =&nbsp;-4<BR>&nbsp;DataValue(1) = "&lt; or"</P>
<P>IF *** THEN </P>
<P>&nbsp;GpCode(2) =&nbsp;2<BR>&nbsp;DataValue(2) = "Z1"</P>
<P>END IF</P>
<P>IF *** THEN </P>
<P>&nbsp;GpCode(3) =&nbsp;2<BR>&nbsp;DataValue(3) = "Z2"</P>
<P>END IF</P>
<P>IF *** THEN </P>
<P>&nbsp;GpCode(4) =&nbsp;2<BR>&nbsp;DataValue(4) = "Z3"</P>
<P>END IF</P>
<P>GpCode(5) =&nbsp;-4<BR>&nbsp;DataValue(5) = " or &gt;"</P>
<P><BR>&nbsp;</P>
页: [1]
查看完整版本: 请问真正高手:关于CAD里面选择集过滤器的使用