下面时我录的部分,应该由另外的语句记录了角度之类的参数, 接着是执行这个动作。
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.ActiveDoc.ActiveView.FrameState = 1
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("拉伸1", "SOLIDBODY", -0.008353456370571, 0.009631396338079, 0.01000000000005, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("上视基准面", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", -0.01463440088054, 0.02764117647052, 0.006059731040523, True, 0, Nothing, 0)
Dim Component As Object
Dim FeatureData As Object
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("拉伸1", "SOLIDBODY", -0.008353456370571, 0.009631396338079, 0.01000000000005, False, 1, Nothing, 0)
Set Feature = Part.FeatureManager.InsertMoveCopyBody2(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, False, 1)
Set FeatureData = Feature.GetDefinition
boolstatus = Part.Extension.SelectByID2("上视基准面", "PLANE", 0, 0, 0, False, 1, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "FACE", -9.338235294118E-04, 0.02764117647059, 0.005, True, 1, Nothing, 0)
FeatureData.AddMate Empty, 6, 1, 0, 0.8901179185171, longstatus
Feature.ModifyDefinition FeatureData, Part, Component
End Sub |