MATLAB: How to pass an object array to activex (SolidEdge)

activexMATLABmethodobjectsolidedge

In the output of
methods SolidEdgeFrameworkSupport.ComplexStrings2d -full
can you show us the signature for AddByObjects?

Best Answer

MathWorks support and documentation were not so useul I suggest to improve them.
Anyway I was able to solve the problem after many attempts changing the approach from COM to .NET. Now this code works:
clear;close all; clc;
% Loading .NET libraries
SEF = NET.addAssembly('C:\Program Files\Solid Edge ST5\Custom\SELibrary\bin\Interop.SolidEdgeFramework.dll');
SEFS = NET.addAssembly('C:\Program Files\Solid Edge ST5\Custom\SELibrary\bin\Interop.SolidEdgeFrameworkSupport.dll');
SED = NET.addAssembly('C:\Program Files\Solid Edge ST5\Custom\CustomSensor\bin64\Interop.SolidEdgeDraft.dll');
% Connecting with SolidEdge
objType = System.Type.GetTypeFromProgID('SolidEdge.Application');
objApp = SolidEdgeFramework.Application(System.Activator.CreateInstance(objType));
objApp.Visible = true;
% Creating new document
objDoc = SolidEdgeDraft.DraftDocument(objApp.Documents.Add('SolidEdge.DraftDocument'));
objSheet = objDoc.ActiveSheet;
% Get the ComplexStrings2d object on the active sheet
objCompStrn = objSheet.ComplexStrings2d;
% Draw few lines on the active sheet
objL1 = objSheet.Lines2d.AddBy2Points(0.1,0.1,0.2,0.2);
objL2 = objSheet.Lines2d.AddBy2Points(0.2,0.2,0.4,0.2);
objL3 = objSheet.Lines2d.AddBy2Points(0.4,0.2,0.5,0.1);
% Store the Line objects in an Array
objBObjs = NET.createArray('System.Object',3);
objBObjs(1) = objL1;
objBObjs(2) = objL2;
objBObjs(3) = objL3;
% Create a ComplexString2d object
objCompStrn.AddByObjects(3, objBObjs)