iCAx开思工具箱

标题: SOLIDWORKS2007中用VBA二次开发- 画圆问题 [打印本页]

作者: davisdudong    时间: 2008-10-15 17:40
标题: SOLIDWORKS2007中用VBA二次开发- 画圆问题
为什么画圆的直径不对?圆心位置也不对?
是我的程序有问题吗?
请明人指点。多谢!

Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.SetUserPreferenceToggle swFileExplorerShowSamples, False
Part.SetUserPreferenceIntegerValue swImageQualityWireframe, swWireframeImageQualityCustom
boolstatus = Part.Extension.SelectByID2("前视基准面", "PLANE", -0.06650507042254, 0.05942169014085, 0, False, 0, Nothing, 0)
Part.InsertSketch
Part.ClearSelection2 True
Part.CreateCircle 0, 0, 0, 0, 50 / 2000, 0
Part.CreateCircle 0, 1.3 / 1000, 0, 60 / 2000, 0, 0

End Sub
作者: gneful    时间: 2008-10-30 20:50
SW的API里,统一使用 “米”为单位
作者: linianf    时间: 2009-2-23 14:34
是的啊,楼主把单位搞错了




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3