33456
Mechanical
- May 23, 2007
- 10
How can i check on what sheet a bom is.
I have several sheets and several boms, only 1 on a pge offcourse.
please fill in the blanks ..
Sub checkbom()
Dim bom_aanwezig As SldWorks.Feature
Dim swBomFeat As SldWorks.BomFeature
Dim vTableArr As Variant
Dim swTable As SldWorks.TableAnnotation
Set swApp = Application.SldWorks
Set actDOC = swApp.ActiveDoc
Set bom_aanwezig = actDOC.FirstFeature
Do While Not bom_aanwezig Is Nothing
Dim tsoort
tsoort = bom_aanwezig.GetTypeName
If tsoort = "BomFeat" Then
Set swBomFeat = bom_aanwezig.GetSpecificFeature2
vTableArr = swBomFeat.GetTableAnnotations
Set swTable = vTableArr(0)
Dim aantalrijen
aantalrijen = swTable.RowCount
For i = 1 To aantalrijen
hoogteverstelling = hoogteverstelling + 0.0045
Next i
'End If
Set bom_aanwezig = bom_aanwezig.GetNextFeature
Else
Set bom_aanwezig = bom_aanwezig.GetNextFeature()
End If
Loop
End Sub
I have several sheets and several boms, only 1 on a pge offcourse.
please fill in the blanks ..
Sub checkbom()
Dim bom_aanwezig As SldWorks.Feature
Dim swBomFeat As SldWorks.BomFeature
Dim vTableArr As Variant
Dim swTable As SldWorks.TableAnnotation
Set swApp = Application.SldWorks
Set actDOC = swApp.ActiveDoc
Set bom_aanwezig = actDOC.FirstFeature
Do While Not bom_aanwezig Is Nothing
Dim tsoort
tsoort = bom_aanwezig.GetTypeName
If tsoort = "BomFeat" Then
Set swBomFeat = bom_aanwezig.GetSpecificFeature2
vTableArr = swBomFeat.GetTableAnnotations
Set swTable = vTableArr(0)
Dim aantalrijen
aantalrijen = swTable.RowCount
For i = 1 To aantalrijen
hoogteverstelling = hoogteverstelling + 0.0045
Next i
'End If
Set bom_aanwezig = bom_aanwezig.GetNextFeature
Else
Set bom_aanwezig = bom_aanwezig.GetNextFeature()
End If
Loop
End Sub