×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Check BOM on sheet

Check BOM on sheet

Check BOM on sheet

(OP)
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

RE: Check BOM on sheet

33456,

I do not know if you can find that out from the way you are doing it; I have never tried it.  I did a semi-quick look through API help but could not find any straightforward method.  In the past, I wrote a macro that cycled through each sheet, got the tableannotation object associated with that sheet and then got the BOMFeature object to get the BOM name.  

Regards,

Regg

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources