I recorded a macro to do the following.
Add a Revision
Change Revision to "REL"
In Describtion type "RELEASED"
In Approved type "MDJ"
This macro does all of that but it also changes the row height. Howwould I write a macro that does all of the above and doesn't changethe row height.
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.3065965048768, 0.2655622007571, 0, False, 0,Nothing, 0)
Dim currentSheet As Object
Dim myRevisionTable As Object
Set currentSheet = Part.GetCurrentSheet()
Set myRevisionTable = currentSheet.RevisionTable
longstatus = myRevisionTable.AddRevision("")
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.2982784283223, 0.2616111143937, 0, False, 0,Nothing, 0)
Dim myTable As Object
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(2, 0) = "REL"
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.3203213311917, 0.2620270182214, 0, False, 0,Nothing, 0)
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.3203213311917, 0.2620270182214, 0, False, 0,Nothing, 0)
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(2, 1) = "RELEASED"
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.404333904392, 0.2614031624799, 0, False, 0,Nothing, 0)
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(2, 3) = "MDJ"
End Sub
SolidworksApi macros


Add a Revision
Change Revision to "REL"
In Describtion type "RELEASED"
In Approved type "MDJ"
This macro does all of that but it also changes the row height. Howwould I write a macro that does all of the above and doesn't changethe row height.
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.3065965048768, 0.2655622007571, 0, False, 0,Nothing, 0)
Dim currentSheet As Object
Dim myRevisionTable As Object
Set currentSheet = Part.GetCurrentSheet()
Set myRevisionTable = currentSheet.RevisionTable
longstatus = myRevisionTable.AddRevision("")
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.2982784283223, 0.2616111143937, 0, False, 0,Nothing, 0)
Dim myTable As Object
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(2, 0) = "REL"
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.3203213311917, 0.2620270182214, 0, False, 0,Nothing, 0)
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.3203213311917, 0.2620270182214, 0, False, 0,Nothing, 0)
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(2, 1) = "RELEASED"
boolstatus = Part.Extension.SelectByID2("DetailItem351@Sheet1","REVISIONTABLE", 0.404333904392, 0.2614031624799, 0, False, 0,Nothing, 0)
Set myTable = Part.SelectionManager.GetSelectedObject5(1)
myTable.Text(2, 3) = "MDJ"
End Sub
SolidworksApi macros