求助!后绑定问题?
<P>小弟做cad二次开发时遇到一个问题,请高手帮帮忙!</P><P>我是用vb调用cad做的,为了将来生成的程序能在不同版本之间运行,在开始没有引用cad库,采用了后绑定方式。用了很多命令很正常,但是在用布尔运算对实体进行编辑操作时发现了问题。用实体1减实体2,结果不论用求并集,交集还是1减2,结果都是交集。但是引用cad库后就能得出正常的结果了。怎么才能在后绑定状态(不引用cad库)下正常使用布尔运算?程序段如下:</P>
<P>Private Sub buer()<BR>Dim sliceobj(1 To 1000) As Object<BR> Dim length As Double<BR> Dim width As Double<BR> Dim height As Double<BR> Dim center(0 To 2) As Double<BR> center(0) = 4.5: center(1) = 4.5: center(2) = 4.5<BR> length = 9: width = 9: height = 9#<BR> <BR> ' 在模型空间中创建长方体 (3DSolid) 对象<BR> Set sliceobj(1) = moSpace. _<BR> AddBox(center, length, width, height)<BR> ' 对立方体进行开挖<BR>' Define the cylinder<BR> Dim cylinderObj As Object<BR> Dim aaa As Object<BR> Dim cylinderCenter(0 To 2) As Double<BR> Dim cylinderRadius As Double<BR> Dim cylinderHeight As Double<BR> cylinderCenter(0) = 4.5: cylinderCenter(1) = 4.5: cylinderCenter(2) = 0#<BR> cylinderRadius = 3#<BR> cylinderHeight = 20#<BR> <BR> ' Create the Cylinder (3DSolid) object in model space<BR> <BR> Set cylinderObj = moSpace.AddCylinder(cylinderCenter, cylinderRadius, cylinderHeight)</P>
<P> ' 对立方体进行开挖 </P>
<P>sliceobj(1).Boolean acSubtraction, cylinderObj</P>
<P>'acadDoc.Regen True<BR>acadDoc.Application.ZoomExtents<BR>End Sub</P>
<P>请高手帮帮忙,十分感谢!</P> <P>sliceobj(1).Boolean acSubtraction, cylinderObj</P>
<P>改为</P>
<P>sliceobj(1).Boolean 2, cylinderObj</P> <P>谢谢版主,你太厉害了,以后哦还有向你多多学习请教啊!呵呵</P>
页:
[1]