I'm trying to write a macro that will insert a general tableinto a drawing. it works great, but I want it to point to a certaintable.
Does anyone know the code to do this?
This is what I got so far.
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.ActiveDoc.ActiveView.FrameState = 1
Dim genTable As Object
Set genTable = Part.InsertTableAnnotation(0.01589136281956,0.2698647964003, 3, 3, 8)
If Not genTable Is Nothing Then
genTable.BorderLineWeight = 0
genTable.GridLineWeight = 0
End If
Part.ClearSelection2 True
End SubSolidworksApi macros





Does anyone know the code to do this?
This is what I got so far.
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.ActiveDoc.ActiveView.FrameState = 1
Dim genTable As Object
Set genTable = Part.InsertTableAnnotation(0.01589136281956,0.2698647964003, 3, 3, 8)
If Not genTable Is Nothing Then
genTable.BorderLineWeight = 0
genTable.GridLineWeight = 0
End If
Part.ClearSelection2 True
End SubSolidworksApi macros

What do you mean by "point to a certain table"?
SA
What you want to do is copy the table from one drawing to anotherdrawing? To do that, you would have to open the drawing with thetable you want to copy, select it, copy it, open the drawing youwant to copy to then paste it. Right now I cannot think of a cleanway to do that. I will have to give it some thought. You wouldprobably have to have both drawings open.
SA
I needed to add the path of the general table to the macro.
Now, I just hit F4 and my table is inserted in the location i want.
Thanks for the help...
Thanks!
Here is what I have, it doesn't work.
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolStatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.ActiveDoc.ActiveView.FrameState = 1
Dim genTable As Object
Set genTable = Part.InsertTableAnnotation2(False, 0, 0, , 3,"V:\SolidWorks\General Table Templates\MISC_ENG_ACCT_TABLE.sldtbt")
If Not genTable Is Nothing Then
genTable.BorderLineWeight = 0
genTable.GridLineWeight = 0
End If
Part.ClearSelection2 True
End Sub
Any ideas?