API sample project from help file

Discussion in 'SolidWorks' started by Sam, Oct 20, 2006.

  1. Sam

    Sam Guest

    Has anyone ever used the api sample project from the help file in the
    "Files" section on the SolidWorks API Sample Projects page (I am on one
    sw2006sp4.1)? It states the sample project is able to "Rename, copy,
    and save SolidWorks files currently in memory". There is a link to
    download, I am able to download but I am unable to get the macro to
    run. I get an error stating "could not load an object because it is not
    available on this machine" when I try to edit the macro through
    tools\macro\edit. The macro will open but I when I try to run it I get
    an error stating "can't find project or library". I get the feeling
    that there are some other files that are missing from the download.

    If anyone has used this macro successfully I would appreciate them
    letting me know how it works.

    Thanks, Sam
     
    Sam, Oct 20, 2006
    #1
  2. Sam

    TOP Guest

    I think that you might have to select the appropriate type library to
    make it work.
     
    TOP, Oct 21, 2006
    #2
  3. Sam

    Sam Guest

    I took a look at that and I see that one library type states
    "MISSING: Microsoft Masked Edit Control 6.0". Do you think that could
    be the problem? Where can I get this Masked Edit Control?

    Thank, Sam
     
    Sam, Oct 22, 2006
    #3
  4. Sam

    Sam Guest

    I just thought about something else, do you think this macro might
    require the full blown VB software and not just VBA?
     
    Sam, Oct 22, 2006
    #4
  5. Sam

    raulsimental Guest

    "Rename, copy, and save SolidWorks files currently in memory" API
    Sample Project. Runs without problems using SW2007 SP 1.0
     
    raulsimental, Oct 23, 2006
    #5
  6. Sam

    Sam Guest

    I was able to get past the first error by locating the microsoft
    masked edit control on the net and downloading but now I am not sure
    how to get the macro to run properly. Doe it only copy and rename the
    currently open documents? There does not appear to be a way to browse
    to select documents. But even with some documents open I still cannot
    get it work and receive an error stating "Invalid Row Value" and when I
    select Debug grid.col = 2 is highlighted. I am not a good programmer
    (obviously) so I am not sure what to do about this.
    Also, I am assuming that the grid control is supposed to populate with
    the documents to copy or rename but no documents ever appear in the
    grid control.

    Raul, were you able to successfully use the macro to copy and rename
    some documents? If so can you please explain how you did this.


    Thanks, Sam
     
    Sam, Oct 23, 2006
    #6
  7. Sam

    raulsimental Guest

    Raul, were you able to successfully use the macro to copy and rename
    Hi Sam,
    I'm able to run the macro and rename files without problems.
    When running the macro a window appears showing a list of items that
    are currently open and to the right of that list is an empty column to
    enter the new name for every part.
    It is a great macro.
    Your could achieve almost the same thing for an assembly if your select
    save as and Edit Referenced file Locations.
     
    raulsimental, Oct 23, 2006
    #7
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.