取图元颜色和线型有大问题?????
AcadSelectionSet 取图元颜色和线型 <IFRAME marginWidth=0 marginHeight=0 src="/mcfile/google180.htm" frameBorder=0 width=180 scrolling=no height=150></IFRAME><P>AcadSelectionSet 取图元颜色和线型,在不同图层内,只以取到256这个值</P>
<P>代码如下:</P>
<P>Sub main()<BR> Dim sets As AcadSelectionSet<BR> Dim i As Integer<BR> Set sets = ThisDrawing.SelectionSets.Add("Select")<BR> sets.SelectOnScreen<BR> For i = 0 To sets.Count - 1<BR> MsgBox "当前颜色值为:" & sets.Item(i).color<BR> Next i<BR> sets.Delete<BR>End Sub<BR></P>
<P>谢谢!!!</P> <P>Sub main()<BR> Dim sets As AcadSelectionSet<BR> Dim i As Integer<BR> Set sets = ThisDrawing.SelectionSets.Add("Select")<BR> sets.SelectOnScreen<BR> For i = 0 To sets.Count - 1<BR> If sets.Item(i).color = 256 Then<BR> MsgBox "当前颜色值为:" & ThisDrawing.Layers.Item(sets.Item(i).Layer).TrueColor.ColorIndex<BR> Else<BR> MsgBox "当前颜色值为:" & sets.Item(i).color<BR> End If<BR> <BR> <BR> Next i<BR> sets.Delete<BR>End Sub</P>
<P>这样解决行吗</P>
页:
[1]