Automatic pop-up of custom property box?

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

Reply to
John23
Loading thread data ...

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

Reply to
CAD Guy

Cadguy, Do you have some code you can share with us? :)

Reply to
SW Monkey

Project for making SW addins in VB6.

CADguy is mostly correct. You need a program that monitors SW events. Best done with an addin.

Reply to
That70sTick

Unfortunately, I don't have the source code.

Sorry : < (

CG

Reply to
CAD Guy

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.

Reply to
CS

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.