Dear Sir/Madam,
Hello! I want to change a part in assy using VBA.
For example, I want a Sheet metal part to be dynamically bent in assy. Here is a sheet metal part that I can animate and bend with the following code:
Dim swApp As Object
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim i As Integer
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
For i = 1 To 90 Step 4
Part.Parameter("D4@草图折弯1").SystemValue = i * 3.14 / 180
Part.EditRebuild3
Part.GraphicsRedraw2
Next i
End Sub
But in an assembly, for example, there is a assy in which only a part, how animate folding?
Yours Truly,
Chen
SolidworksApi/macros