SW API practices

Hello fella's !

I was wondering ...

What's the best, most stable, or quickest way to program thefollowing situation.

A part has 4 configurations.
The user picks a configuration via a form.

A var is set :
sCName = "requestedconfig"

the code changes the configuration :
boolstatus = modeldoc2.CompConfigProperties4(2, 0, True, True,sCName, False)

This changes the configuration on the part, even when the currentactive config is the same as the requested config by the user right?

Is it more efficient/stable if i got it to check the active currentconfiguration on the part with the one requested, and ONLY if theyaren't the same, then configure the part with the requested config?
Else, just leave it like that ?

Thing is, i'm switching a config on a part, and on many occasions,it crashes my macro ..

what's your opinion ?

Greets,
Bert

SolidworksApi macros