API sample project from help file

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

Reply to
Sam
Loading thread data ...

I think that you might have to select the appropriate type library to make it work.

Reply to
TOP

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

Reply to
Sam

I just thought about something else, do you think this macro might require the full blown VB software and not just VBA?

Reply to
Sam

"Rename, copy, and save SolidWorks files currently in memory" API Sample Project. Runs without problems using SW2007 SP 1.0

Reply to
raulsimental

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

Reply to
Sam

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.

Reply to
raulsimental

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.