How can hide the weld table with API?
It's possible something like this?
If swTable.Type = 0 Then
In SolidWorks 2014, there is a bug on weld table when is inserted with API and I reported it and it's resolved in subsequent versions.
Weld table is listed as swTableAnnotation_WeldTable under Table annotation types but this doesn't work. I do not see any other codes to access an inserted weld table. So not sure if there is any possibilities.
Try and Explore this swApp.RunCommand swCommands_Hide_Table, Empty
May Help you.
But how to get the weld table without pre-selecting it?
Open any Drawing File which is having Weld Table and Run this Code. It should hide all the Weld Table .. ..Cheers..
Dim swApp As Object
Dim Part As ModelDoc2
Dim boolstatus As Boolean
Dim featureMgr As FeatureManager
Dim rootNode As TreeControlItem
Dim swFirstNode As TreeControlItem
Dim swNode As TreeControlItem
Dim swChildNode As TreeControlItem
Dim longstatus As Long, longwarnings As Long
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set featureMgr = Part.FeatureManager
Set rootNode = featureMgr.GetFeatureTreeRootItem2(swFeatMgrPaneTop)
If Not rootNode Is Nothing Then
Set swNode = rootNode.GetFirstChild
While Not swNode Is Nothing
Set swFirstNode = swNode.GetFirstChild
While Not swFirstNode Is Nothing
Set swChildNode = swFirstNode
Dim WeldObj As Object
Set WeldObj = swChildNode.Object
If Not WeldObj Is Nothing Then
Dim feat As feature
Set feat = WeldObj
If feat.GetTypeName2 = "WeldTableFeat" Then 'Getting Weld Table
boolstatus = feat.Select2(False, -1) '>>Selecting Weld Table
swApp.RunCommand swCommands_Hide_Table, Empty
Set swFirstNode = swFirstNode.GetNext
Set swNode = swNode.GetNext
Thanks it works. But WeldTableFeat is not there in the API file so how to find that out?
I m not getting your point as you say 'WeldTableFeat is not there in the API file...???
Yes it is not there in API help file. Did a search and no topic show up for me. I've already raised it to the technical support and awaiting further feedback
Service Request Number: [SR:1-12830453201]
ok ..I see...Yes, it is not there in API help file.
I got WeldTableFeat through API 'GetTypeName2 ' so just added.
Retrieving data ...