Solid Edge control via Matlab activex - physical properties help!

G'day all,


I am having a baffling problem. I am trying to automate simple geometry generation in SE using matlab (front end maths is handled in a matlab GUI)


Thus far I can open solid edge, open a file, add and change variables (and hence dimensions), but I am stuck and cannot seem to be able to compute and obtain the part volume.I follow the syntax (roughly) shown in the examples for VB, but get the error: No method 'GetPhysicalProperties' with matching signature found for class

'Interface.Solid_Edge_Part_Type_Library.Model'.What I do isSmiley SurprisedbjApp = actxserver('SolidEdge.Application')ObjDoc = actxserver('SolidEdge.PartDocument')* Opens the part file I am working on*cylinder = ObjApp.Documents.Open('C:\SolidEdge Parts\TestCyl.par')From here, if I type:cylinder.Models.Item(1).methodsMatlab indicates that the method 'ComputePhysicalProperties' is available for this class, however I always get the above error.I notced that in VB and C++ all the examples predefine the variables needed as doubles and pass them all to the method, but you don't need to do that in Matlab as far as I am aware (everything is a double by default).Any help would be much appreciated.Regards



Posted by: Matt Newcombe
Post date: 11/8/2011 4:47:00 PM


RE: Solid Edge control via Matlab activex - physical properties help!



in this case of the quite complex method call ComputePhysicalProperties, which requires existing arrays of doubles given by reference, you have to declare and initialize all required parameter variables first.


Posted by: Wolfgang Kunert
Post date: 11/8/2011 11:31:52 PM

RE: Solid Edge control via Matlab activex - physical properties help!

G'day Wolfgang,


Thankyou for the reply. After some digging the issue turned out that I was simply not converting the VB language into Matlab - the arguments passed to ComputePhysicalProperties needed to only contain 6 variables (including the density and accuracy), and I had to assign it the correct output string in Matlab, i.e.


[Vol, Surface, Mass, CoG, CoV, GMI, PMI, PA, ROG, RAA, Status] = ObjPar.Models.Item(1).ComputePhysicalProperties(100, 0.999, Volume, Area, Mass, CenterOfGravity, CenterOfVolume, GlobalMomentsOfInertia).


All working superbly now.





Posted by: Matt Newcombe
Post date: 11/9/2011 3:50:15 PM