I'm having trouble understanding the ConsiderSuppressed parameter, particulularly the truth tables and what they mean in order to use this method in an if statement in my code.
API help link for IsHidden http://help.solidworks.com/2012/English/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IComponent2~IsHidden.html
Basically, I'm trying to extract mass data from SolidWorks into Excel, but I want the macro to have the functionality to get the parts from the assembly that I've isolated (by using the IsHidden method in conjunction with the GetSuppression method). So far, I haven't been able to get it to work. It still seems to be picking up hidden parts.
Here's a snippet of the code I have for this part:
SolidworksApi macrosxlCurRow = 2
Components = swAssembly.GetComponents(0)
'Loop that populates excel spreadsheet
For Each Component In Components
Set swComp = Component
If swComp.GetSuppression <> 0 And Not swComp.IsHidden(True) then
Bodies = swComp.GetBodies2(0)
RetBool = MassProp.AddBodies(Bodies)
CenOfM = MassProp.CenterOfMass
xlsheet.Range("K" & xlCurRow).value = CenOfM(1)
xlsheet.Range("M" & xlCurRow).value = CenOfM(2)
...
End If
xlCurRow = xlCurRow + 1
Next Component