Sub CopyTest() Dim Spoint(2) As Point3d Spoint(0) = Point3dZero Spoint(1) = Point3dFromXYZ(0, 10, 0) Spoint(2) = Point3dFromXYZ(-5, 0, 0) Dim S1 As ShapeElement Dim S2 As ShapeElement Set S1 = Application.CreateShapeElement1(Nothing, Spoint) Set S2 = ActiveModelReference.CopyElement(S1) End Sub
想实现复制功能,没有添加绘制命令,使用.CopyElement会将原图形绘制出来,是什么原因,如何避免?
Topics: MVBA microstation
CopyElement就是复制元素后添加到模型中的,从MSV8XM(即8.9)开始,只要添加到模型中的元素就会被立刻绘制出来。
所以,如果仅想复制而不添加,可调用Clone方法。