API inset hole table
API inset hole table
(OP)
I've written a macro that insterts a hole table as part of a bigger program that I'm working on.
The issue is I want to hide the table after it is inserted but have the origin shown.
I can't seem to find the code to do that.
Below is the code to insert the table any help would be appreciated.
The issue is I want to hide the table after it is inserted but have the origin shown.
I can't seem to find the code to do that.
Below is the code to insert the table any help would be appreciated.
CODE
Sub test_table()
Dim swapp As SldWorks.SldWorks
Dim swView As SldWorks.View
Dim swmodel As SldWorks.ModelDoc2
Dim swselmgr As SldWorks.SelectionMgr
Dim swHoleTable As SldWorks.HoleTableAnnotation
Set swapp = CreateObject("SldWorks.Application")
Set swmodel = swapp.ActiveDoc
Set swselmgr = swmodel.SelectionManager
Set swView = swselmgr.GetSelectedObjectsDrawingView(1)
Set swHoleTable = swView.InsertHoleTable(0, 0.036051, 0.082461, 1, "C:\SolidWorks2008\SolidWorks\lang\english\standard hole table--numbers.sldholtbt")
End Sub
Dim swapp As SldWorks.SldWorks
Dim swView As SldWorks.View
Dim swmodel As SldWorks.ModelDoc2
Dim swselmgr As SldWorks.SelectionMgr
Dim swHoleTable As SldWorks.HoleTableAnnotation
Set swapp = CreateObject("SldWorks.Application")
Set swmodel = swapp.ActiveDoc
Set swselmgr = swmodel.SelectionManager
Set swView = swselmgr.GetSelectedObjectsDrawingView(1)
Set swHoleTable = swView.InsertHoleTable(0, 0.036051, 0.082461, 1, "C:\SolidWorks2008\SolidWorks\lang\english\standard hole table--numbers.sldholtbt")
End Sub






RE: API inset hole table
CODE
Set swDatumOrigin = swHoleTable.HoleTable.DatumOrigin
swHoleTable.GetAnnotation.Visible = swAnnotationHidden
swDatumOrigin.GetAnnotation.Visible = swAnnotationVisible
-handleman, CSWP (The new, easy test)
RE: API inset hole table
It works great thanks.
RE: API inset hole table
CODE
Is this line setting the insertion point for the table? Does the table template need to have the "attach to anchor toggled off? Just curious.
Joe
SW Office 2008 SP3.1
P4 3.0Ghz 3GB
ATI FireGL X1
RE: API inset hole table
It doesn't have to but I don't have a anchor point set so I would rather let the user position it wherever they need it to be.