Runing macro on Open File
Runing macro on Open File
(OP)
I'm trying to find a way to program a macro to show, on screen, some custom properties of the opened file. The goal is to give some automatic information about the file (part, assembly or drawing)that the user is opening.
Does anyone have any ideas?
Does anyone have any ideas?






RE: Runing macro on Open File
RE: Runing macro on Open File
Check out http://www.nhcad.com/old/html/example7.asp example number 7. You can put the results onto a Visual Basic form. With this you can attach the macro to a user hot key.
Bradley
RE: Runing macro on Open File
My idea is more about a macro that runs automatically on the event of opening a SW file (not dependent of a hot key, or mouse click). The macro controls the content of some custom properties. If these properties have some values, then messeges are printed on screen. Otherwyse, the macro ends/pauses silently for the user.
Example: a part file as a custom property named "revision_in_study" with the value "yes". If some user opens this file (for use in an assembly, for example), the macro test the contents of the property and warns the user that this file will probably change (depending on the result of the study). I don't want the macro execution to be user dependent, for safety purposes.
I think that the bigest problem is not read the property. That can be solved based on the example that Bradley is showing. The bigest problem is having the macro on stand-by, wayting for a file to be opened, run after the file opens, and be on stand-by again.
RE: Runing macro on Open File
If you figure this one out please let us know. This would be a great tool for other uses also. Good Luck.
Bradley
RE: Runing macro on Open File
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Runing macro on Open File
Is it not true that one must write this add-in using C ?
Bradley
RE: Runing macro on Open File
Because it is possible that add-in crashes without any messages?
RE: Runing macro on Open File
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: Runing macro on Open File
Otherwise, you can write a VB DLL to do it, if you set-up the "trap" for it.
Maybe I'll try
Mr. Pickles
Mr. Pickles
RE: Runing macro on Open File
For the time being, I will simply try to develop a batch macro, that each user should run on a frequent basis, that will detect the darwings that are in a revision process.
RE: Runing macro on Open File
Your best bet maybe to get PDM/Works. The cost is low and the learning curve is short.
Bradley
RE: Runing macro on Open File
I was trying to avoid that. I will still try to find a solution. But mabe a PDM will be the only way to go.
Thanks
RE: Runing macro on Open File
Before we purchased PDM/Works I was trying to come up with a way that 19 SolidWorks users could share files. The best idea I came up with was to use the file attributes to control ownership. Also if one were not going to change a model they would open the model using SolidWorks read only property. The models that were released we put into a write-protected folder (this person would not be a SolidWorks user). The SolidWorks user would link to the write-protected folder, not copy from the write-protected folder. That is as far as I got. Good luck.
Bradley