Hi All,
I should probably know this by now but I am still a little bituncertain.
When to set and declare objects.
Example #1 Dim swApp as SldWorks.Sldworks is used to declare swApp,and at the begining of your macro you set it to"CreateObject("SldWorks.Application")" to get the handle onsolidworks.
Does that need to be done only once in the whole macro and then atthe very end of the macro set it to nothing ?
Example #2 Say I am in a function and i have the handle on theactive part now i call another function should I:
A. declare the part again and set it again in the function that iam calling or does it still know which part i am refering to.
B. pass the handle to the function i am calling then once thefunction is complete it will be passed back to the function it wascalled from.
I hope this is not too confusing. I am just a little bit undecidedas to how often I need to declare objects.
Any help is great. ThanksSolidworksApi macros
I should probably know this by now but I am still a little bituncertain.
When to set and declare objects.
Example #1 Dim swApp as SldWorks.Sldworks is used to declare swApp,and at the begining of your macro you set it to"CreateObject("SldWorks.Application")" to get the handle onsolidworks.
Does that need to be done only once in the whole macro and then atthe very end of the macro set it to nothing ?
Example #2 Say I am in a function and i have the handle on theactive part now i call another function should I:
A. declare the part again and set it again in the function that iam calling or does it still know which part i am refering to.
B. pass the handle to the function i am calling then once thefunction is complete it will be passed back to the function it wascalled from.
I hope this is not too confusing. I am just a little bit undecidedas to how often I need to declare objects.
Any help is great. ThanksSolidworksApi macros