include Push-Pin on prop. manager page API

Discussion in 'SolidWorks' started by Ned, Mar 4, 2004.

  1. Ned

    Ned Guest

    Can someone give me an example of how to include the push-pin in a
    property manager page. The help file gives me this information. I
    have downloaded a sample property manager page from the Solidworks
    website but I am not sure where to insert the code.

    I defined Pinned as Boolean and set it to True, but I get the error
    that PropertyManagerPage2 is not a defined variable.

    The solidworks help file shows the following syntax, but does not
    include an example.

    Syntax (OLE Automation)

    Pinned = PropertyManagerPage2.Pinned (VB Get property)

    PropertyManagerPage2.Pinned = Pinned (VB Set property)

    Thank you

    Ned
     
    Ned, Mar 4, 2004
    #1
  2. To get the push-pin to appear you need to include
    swPropertyManagerOptions_PushpinButton as one of the bitmap values passed as
    the second argument to CreatePropertyManagerPage:

    (1) To get the definition of swPropertyManagerOptions_PushpinButton you
    could add the following enum to the swConst

    Public Enum swPropertyManagerButtonTypes_e
    swPropertyManagerOptions_OkayButton = &H1
    swPropertyManagerOptions_CancelButton = &H2
    swPropertyManagerOptions_LockedPage = &H4
    swPropertyManagerOptions_CloseDialogButton = &H8
    swPropertyManagerOptions_MultiplePages = &H10
    swPropertyManagerOptions_PushpinButton = &H20
    End Enum

    Alternatively, as you need SW2004 for API pushpins anyway, in the Reference
    dialog box on the Tools menu in the VB editor search for check box labelled
    Solidworks Constant type library
    and make sure it is checked. That will give your macro access to the
    definitions from swconst.tlb. Then you can dump the file swConst from the
    sample.

    (2) Then edit the code in PropMgr

    'Set some variables for the Page
    title = "Sample PropertyManager"
    buttonTypes = swPropertyManagerOptions_OkayButton +
    swPropertyManagerOptions_CancelButton +
    swPropertyManagerOptions_PushpinButton

    'Create the PropertyManagerPage
    Set m_Page = swApp.CreatePropertyManagerPage(title, buttonTypes,
    pageHdlr, errors)

    The property Pinned controls whether the pin is pushed in or out once you
    get it to appear.
     
    Paul Delhanty, Mar 5, 2004
    #2
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.