Macro Launch at SmartProperties Validation

I created a macro that launches and validates the SmartProperty on each mechanically welded item (which therefore loops around for the time it takes to make all the items).

I would like this macro to run when the SmartProperties is validated on the part.

 

The macro works very well when I launch it alone.

 

But he tells me because the Smart is a priori already launched...

Anyone have a solution?

Thank you

Hello

 

Is it possible to know if the SmartProperties is already launched to make an IF on this condition (launch it or not)?

 

I would be tempted to say no, so I think it's not possible! But let's let the developers do the talking!

 

(If I understood correctly!)

1 Like

The problem is that I don't see what he does when he applies "launch to the validation of the SmartProperties".

 

Or if not, I have to reset everything at the beginning of the macro, right?

Because now, he doesn't do anything to me at all... I don't even know if it launches the macro or not...

To see if it launches your macro, add an MSGBOX at the very beginning, with "Macro launched" for example, so you'll be sure if it's launched or not.

1 Like

You have seen the help:

"-> "After closing SmartProperties" - indicates that the action will be triggered as soon as one exits the SmartProperties utility. Indeed, you can validate the information by pressing (green validate button), but if the window has been pinned then this action will only be taken into account by pressing the red cross."

 

Have you tried with the window pinned or not?

 

 

1 Like

And is it really a SWP macro that you use?

1 Like

Pinned or not, it doesn't change anything.

But I get out of the SmartProperties well since the window closes.

 

On the other hand, I tried to launch a macro including only 1 MsgBox with the "After closing" option, well nothing happens...

If I choose "At validation", then it works (but since I also use smart in my macro, it opposes and it sucks)

 

How to make the "After closing" work??

Hello

 

Using "after closing" launches the macro once the PropertyManager is closed.

But when launching a macro with the SoldiWorks APIs, the code waits for the macro to complete to hand over, so SmartProperties stays open until your macro ends.

 

The only solution would be to go through an executable and no longer through a macro. In this case, the program is launched asynchronously and SmartProperties closes after launching the application.

 

In this case it should work

 

Philippe

As I had assumed, it is impossible!

 

To create an executable, you need to use Visual Studio Express, which is free, here:

http://www.microsoft.com/france/visual-studio/essayez/download.aspx

 

To start, the information available is mainly in English:

http://www.linkedin.com/groups/Create-simple-SolidWorks-StandAlone-Application-4961405.S.235214502

 

http://www.youtube.com/watch?v=aoXJGKAwhbc

Or:

https://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0CEgQFjAD&url=http%3A%2F%2Fsw.fcsuper.com%2Findex.php%3Fname%3DUpDownload%26req%3Dgetit%26lid%3D157&ei=vFzPU_rWKKLS0QX_pYGYAQ&usg=AFQjCNGDPktD7kifUz-jB-GahX4vM7ArrQ&sig2=khj7_cUXvddZbr-d_TMTKQ&bvm=bv.71667212,d.d2k&cad=rja

1 Like

However, if I use "at the validation of the smartproperties", the macro can be launched.

(But I have a pb in my macro that crashes...)

However, if I use "at the validation of the smartproperties", the macro can be launched. :

 

Yes, but you won't be able to restart SmartProperties with the macro because it will only close at the end of your macro

 

Thank you for your help

I didn't really understand the ".exe" to do. Is it VBA inside?

If I give you a macro, someone can do it for me (or explain it to me in more detail because I can't do it...)

Thank you

Yes, the procedure I indicated allows you to create an executable that contains VB code.

 

1 Like

MyCadTools Utility Updates