Reply

BlueSurface arguments

[ Edited ]

Hi everybody,

 

this is my first post at the forum, and honestly, this is one of my last chances to succeed within my automation code. I just want to import some curves in SE from Excel (done) and create a blue surface from them. Please find attached below my Matlab code for it.

 

Let's say that even simpler I am trying to build the surface considering just one section and one guide, but it seems some arguments are wrong or something...The message Matlab gives is

 

Error using Interface.Solid_Edge_Part_Type_Library.BlueSurfs/Add

Error: Type mismatch, argument 2

 

% Killing existing instance of SolidEdge if you need to. Syntax is as

% follow:

% /IM ImageName: specifies the image name of the process to be terminated.

% Use the wildcard (*) to specify all image names

% /F: specifies that process(es) be forcefully terminated.

!taskkill /F /IM Edge.exe

!taskkill /F /IM EXCEL.exe

% -------------------------------------------------------------------------

% Open SolidEdge Application

% -------------------------------------------------------------------------

solidEdge = actxserver('SolidEdge.Application');

solidEdge.Visible = true;

 

solidEdgePart = solidEdge.Documents.Add('SolidEdge.PartDocument');

solidEdgePart.Activate;

PartDocument = solidEdge.ActiveDocument;

% -------------------------------------------------------------------------

% Curves by table. Import and create all body curves

% -------------------------------------------------------------------------

folderPath = 'C:\...path\GeometriaTest\';

fileExtension = '.xls';

curvesNames = {'sWindshield'; 'asWindshield'; 'fUpperHood'; 'fUpperWindshield'};

numberCurves = length(curvesNames);

for iCurve = 1:numberCurves

ExcelFileName = curvesNames{iCurve};

sExcelFilePath = strcat(folderPath,ExcelFileName,fileExtension);

curve = PartDocument.Constructions.CurvesByTable.Add(sExcelFilePath);

set(curve,'Name',ExcelFileName);

end

% -------------------------------------------------------------------------

% Blue surfaces

% -------------------------------------------------------------------------

section1 = PartDocument.Constructions.CurvesByTable.Item('fUpperWindshield');

guide1 = PartDocument.Constructions.CurvesByTable.Item('sWindshield');

 

Origin(1) = 0.0;

Origin(2) = 0.0;

 

myBlue = PartDocument.Constructions.BlueSurfs.Add(1,section1,Origin,'igNatural',0.0,'igNatural',0.0,1,guide1,'igNatural',0.0,'igNatural',0.0,false,false);

 

%----------------------------------------------------------------------------

% Arguments for Add method in BlueSurfs

% ByVal NumSections As Long, _

% ByRef CrossSections() As Object, _

% ByRef Origins() As Object, _

% ByVal SectionStartTangentType As FeaturePropertyConstants, _

% ByVal SectionStartTangentMagnitude As Double, _

% ByVal SectionEndTangentType As FeaturePropertyConstants, _

% ByVal SectionEndTangentMagnitude As Double, _

% ByVal NumGuideCurves As Long, _

% ByRef GuideCurves() As Object, _

% ByVal GuideStartTangentType As FeaturePropertyConstants, _

% ByVal GuideStartTangentMagnitude As Double, _

% ByVal GuideEndTangentType As FeaturePropertyConstants, _

% ByVal GuideEndTangentMagnitude As Double, _

% ByVal WantEndCaps As Boolean, _

% ByVal Periodic As Boolean _

% ------------------------------------------------------------------------

 

Any help is really welcome. Thanks in advance!

 

/L3munoz

 

Posted by: Jorge Munoz
Post date: 8/2/2012 9:14:12 AM

1 REPLY

Re: BlueSurface arguments

[ Edited ]

I guess it is something related with Origins variable, which should be an object but the input is instead an array...?

 

Posted by: Jorge Munoz
Post date: 8/2/2012 9:35:04 AM