-
Re: Delete all Rows and add new in Revision table
Artem Taturevych May 14, 2013 7:22 PM (in response to Deepak Gupta)Hi Deepak,
Here is the macro. Please let me know if any questions.
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Dim swSheet As SldWorks.Sheet
Dim swRevTable As SldWorks.RevisionTableAnnotation
Dim swTableAnn As SldWorks.TableAnnotation
Dim REVISION_DATA_TO_ADD As Variant 'values for columns in new revision
Sub main()
'use empty string to skip the column
REVISION_DATA_TO_ADD = Array("Zone1", "", "Test Description", "", "AppByEng")
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
Set swSheet = swDraw.GetCurrentSheet
Set swRevTable = swSheet.RevisionTable
If Not swRevTable Is Nothing Then
Set swTableAnn = swRevTable
Dim i As Integer
For i = swTableAnn.RowCount - 1 To 0 Step -1
Dim revId As Long
revId = swRevTable.GetIdForRowNumber(i)
If revId <> 0 Then
swRevTable.DeleteRevision revId, True
End If
Next
swRevTable.AddRevision "NewA"
For i = 0 To UBound(REVISION_DATA_TO_ADD)
If REVISION_DATA_TO_ADD(i) <> "" Then
swTableAnn.Text(swTableAnn.RowCount - 1, i) = REVISION_DATA_TO_ADD(i)
End If
Next
End If
End Sub
____________________________________________________
Regards,
Artem Taturevych, Application Engineer at Intercad (Australia)
translationXpert – add-in to translate SolidWorks models
-
Re: Delete all Rows and add new in Revision table
Deepak Gupta May 14, 2013 7:32 PM (in response to Artem Taturevych)Thanks Artem a big help, worked like a charm
-
Re: Delete all Rows and add new in Revision table
Duncan Gillis Aug 16, 2017 2:41 AM (in response to Artem Taturevych)Thanks also Artem, just used it today!! worked spot on.
-