有关图层内元素复制的问题
<P>我想把图层中的元素复制到新建的 "Temp" 层上</P><P>但我的代码实现的效果却是把图层中的元素剪切到"Temp"层.</P>
<P>大家能帮我看看问题在哪儿吗?</P>
<P>Dim layerObj As AcadLayer<BR> Set layerObj = ThisDrawing.Layers.Add("Temp")<BR> <BR> Dim pStr As String</P>
<P> Dim sset As AcadSelectionSet<BR> Set sset = ThisDrawing.SelectionSets.Add("SS1")</P>
<P> sset.SelectOnScreen</P>
<P> Dim entry As AcadEntity</P>
<P> For Each entry In sset<BR> entry.layer = "Temp"<BR> entry.Update<BR> Next</P>
<P> sset.Delete</P> <P>dim CopyObj as object</P>
<P>For Each entry In sset</P>
<P>set CopyObj =entry .copy<BR> CopyObj .layer = "Temp"<BR> CopyObj .Update<BR> Next</P> <P>谢谢这位大哥</P>
<P>本人初学 VBA ,不胜感激</P>
页:
[1]