API WTF

Discussion in 'SolidWorks' started by Jim Sculley, May 6, 2004.

  1. Jim Sculley

    Jim Sculley Guest

    The API continues to astonish me with its bizarre behavior.

    Make a simple macro:

    Dim swApp As Object
    Dim filters As Variant

    Sub main()
    Set swApp = Application.SldWorks
    filters = swApp.GetSelectionFilters
    End Sub

    I run this macro having opened a part and enabled the 'Vertices' filter.
    The VARIANT 'filters' returned contains *3* elements. One is the
    expected selection type ID for vertices (3), while the other two values
    (92, 110) don't event map to anything in the swconst.tlb (or swconst.h
    for that matter). Add the edges filter and you get 1 as expected, along
    with 46 and 108. Go one step further and filter faces and 2 is added to
    the array, along with 109.

    1 46 108

    2 109

    Perhaps I've missed something, but just how is this API call supposed to
    work?
     
    Jim Sculley, May 6, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.