API: listbox/selectionbox with checkbox in propertypage

Discussion in 'SolidWorks' started by Dan, Nov 24, 2003.

  1. Dan

    Dan Guest

    Hello
    Is there a way to create a listbox (or selectionbox) with checkboxes
    near each item in a propertypage created in a macro?
    For example, look at the split feature where you can cut a part into
    several bodies and keep each one of them as a separate file. It uses
    something like a DBgrid with checkboxes. This is sufficient for my
    needs.

    Thx,
    Gil.
     
    Dan, Nov 24, 2003
    #1
  2. you can add any activeX control in a PMP with
    PropertyManagerPage2::AddControl(id,swControlType_ActiveX...)
    then PropertyManagerPageActiveX::SetClass ...
    In my experience, handling PMPs with ActiveX controls requires a lot of
    tedious work... good luck!
     
    Philippe Guglielmetti, Nov 24, 2003
    #2
  3. 1. create a listbox
    2. change the listbox property "multiselect" to "1-fmmultiselectmulti"
    3. add on frm load "ListBox1.ListStyle = fmListStyleOption"

    note if multiselect is not changed then the liststyle will be an
    option button insted of a checkbox.
     
    Sean Phillips, Nov 24, 2003
    #3
  4. Dan

    Dan Guest

    Sean,
    Thanks, but I suspect that your answer refers to a VBA-style form with
    a "regular" listbox control. I asked about a listbox in SW
    propertypage (PropertyManagerPageListbox) or selectionbox
    (PropertyManagerPageSelectionbox).
    I think this control is much more limited.

    Dan.
     
    Dan, Nov 25, 2003
    #4
  5. PropertyManagerPage2::AddControl

    Input:
    (short) ControlType
    Type of control as defined in swPropertyManagerPageControlType_e

    ControlType = swControlType_ActiveX

    insert a vb selection box as an activeX control.
     
    Sean Phillips, Nov 25, 2003
    #5
  6. Dan

    Dan Guest

    Thx,
    What happens when the macro with such line (addcontrol) is used in a
    computer that does not have a VB installation? Can I simply copy the
    activeX file to that pc? Will it work? Do I need to run a registration
    procedure?

    Dan.
     
    Dan, Nov 26, 2003
    #6
  7. if you have microsoft office installed. then you have a working copy
    of microsoft visual basic for Applications. this is a choped up
    version of visual basic 6.0. the whole microsoft sweet can be modified
    and manipulated from this program.

    in solidworks if you click tools\macro\new then this will open up
    visual basic for applications.
     
    Sean Phillips, Nov 26, 2003
    #7
  8. Dan

    rocheey Guest

    What you're probably after is a tree view, and possibly a sub-classed
    treeview.
    It allows indentations, like windows explorer, probably some
    checkboxes, etc. And if you subclass it, you can add extra interfaces
    (like list boxes, text boxes, file dialogs, you name it, on any node).

    I have just finished doing similar, using a 'cloned' Featuremanager
    type interface, except instead of giving the user access to
    sketch/extrude/mate type features in the assembly, giving
    higher-level 'component' features, that drive VB code to update all
    relevant components and mates.

    Yes, as an interface, you could say it is a tight squeeze: but maybe
    thats a GOOD thing. I just ported it over from a previous form-based
    interface, which grew too large allowing access to all the features:
    you couldnt see the darn assembly underneath.

    Yes, tried porting the single-form into a tabbed form; but with
    real-time error-checking, I was unable to show the user the 2 (or
    more) conflicting values if the values resided on 2 (or more) tabs.

    With the tree view, I just save which areas of the tree are expanded
    (you listening, Solidworks ?), scrunch everything up but the
    conflicting dimensions,
    and show just those areas expanded. After the user makes his
    corrections, I return the user back to the original tree view state.

    Not to mention that the user is already familiar with the
    featuremanager-type interface....
     
    rocheey, Nov 26, 2003
    #8
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.