0
對於我需要自動化Axlestand設計的項目。Solidworks VBA Axlestand自動化
爲此,我想讓一個零件的長度和直徑變化。現在我發現如何使直徑變化,因爲這只是草圖中的一個值,但似乎無法讓它工作來自動化擠出深度(這是部件的長度)。
所以我的問題是,
我怎樣才能使這部分的長度變量?長度等於擠出深度。
這是我用來製造直徑可變的代碼是這樣的:
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("[email protected]", "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)
Part.EditPart
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("[email protected]@Assem1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
Part.EditSketch
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT", 2.74859513030536E-02, -3.06463363579324E-02, 6.16380172114107E-02, False, 0, Nothing, 0)
Set myDisplayDim = Part.AddDimension2(5.72509941423576E-02, 0, -5.63921816082802E-03)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("[email protected]@[email protected]", "DIMENSION", 0.051312269187431, -3.32967190067487E-02, 5.26236966313736E-02, False, 0, Nothing, 0)
Set myDimension = Part.Parameter("[email protected]@Driepoot.Part")
myDimension.SystemValue = <Insert Diameter here>
Part.ClearSelection2 True
Part.SketchManager.InsertSketch True
Part.EditAssembly
希望有人能回答我的問題! :)
添加