本帖最后由 zyf0732 于 2015-6-30 09:18 编辑
感谢楠大侠回复,我有一个整合的宏,需要程序给自动加边界框,所有问了一下,我试了,用录制出来的,完全可以自动加,代码如下
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("实体", "BDYFOLDER", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("实体", "BDYFOLDER", 0, 0, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("实体", "BDYFOLDER", 0, 0, 0, False, 0, Nothing, 0)
Part.Extension.Create3DBoundingBox
End Sub
而且我估计 只要生成了3d边界框,就等于在实体上建立一个边界方程式,可以随便命名属性名称,带入那个边界方程应该就可以了 |