Hi,
Just to report the MultiSelect2 method does not accept the AddComponents3 method result.
I have to cast COM object array into a IComponent2 object array before.
var components = (object[])assembly.AddComponents3(names, transforms, coordSystemNames);
var count = docExtension.MultiSelect2(components, false, null); // Select no component and returns 0
To fix it:
var components = (object[])assembly.AddComponents3(names, transforms, coordSystemNames);
// FIX
var array = new Component2[components.Length];
for (var i = 0; i < components.Length; i += 1)
array[i] = (Component2)components[i];
var count = docExtension.MultiSelect2(array, false, null); // Select all components and returns components.Length
Is it a normal behavior or an API problem ?
Best regards,
Alexandre
SolidworksApi macros