Automatic pop-up of custom property box?

Discussion in 'SolidWorks' started by John23, Jun 15, 2005.

  1. John23

    John23 Guest

    Hi,
    I don't really plan to do it, but I'm curious to know if it would
    be possible to do the following:
    When you insert a first view in a drawing, the custom property box of
    the drawing file automatically pop up.
    Or
    A VB form pops up asking you to give the value of a specific custom
    property and specify the sheet's scale and etc...

    How can you make this happen automatically without having to start a
    macro manually?
    My guess is that you need to create an .exe program that run in the
    background of SW. And SW would always need to be started from this
    custom-made program. Am I right or is there an easier way to proceed?
    Thanks
    JC
     
    John23, Jun 15, 2005
    #1
  2. John23

    CAD Guy Guest

    John,

    One way to accomplish this is to create a DLL using Visual Basic that
    listens to specific events (i.e. - File Open, Save, SaveAs, etc.) to occur
    in SolidWorks. When one of the events occurs, it triggers a macro to
    execute.

    I use a custom DLL, that was implemented as an add-in for SW. This add-in
    launches my custom properties macro any time I perform a Save, or SaveAs.

    I haven't seen any generic versions that are available for free, or for
    purchase.

    CG
     
    CAD Guy, Jun 15, 2005
    #2
  3. John23

    SW Monkey Guest

    Cadguy,
    Do you have some code you can share with us? :)
     
    SW Monkey, Jun 15, 2005
    #3
  4. John23

    That70sTick Guest

    That70sTick, Jun 15, 2005
    #4
  5. John23

    CAD Guy Guest

    Unfortunately, I don't have the source code.

    Sorry : < (

    CG
     
    CAD Guy, Jun 15, 2005
    #5
  6. John23

    CS Guest

    If you go the macro method you can start it automatically by modifying
    the target of shortcuts to sw.

    RMB on the shortcut
    Place this in the target field (ofcourse you will have to enter the
    path to the macro you want to run.

    "C:\Program Files\SolidWorks 2004\SLDWORKS.exe" /m
    "G:\Macros\Events.swp"

    This is enabling the /m switch which runs a macro upon startup. This
    isn't fool proof because if a user opens SW by double clicking a file
    or through another OLE enabled program it won't start. This is why if
    it is feasible it is alot more consistent to got the addin route or an
    external exe.

    If you use this method make sure Module1.Main is at the last sub of
    Module1 Because for some reason SW or MS decided to assume that the
    last sub you wrote would be the one you wanted to run.
     
    CS, Jun 16, 2005
    #6
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.