Reply

GetRange

[ Edited ]

Hello all,

 

I am quite new in C# so sorry for my stupid question but I want to measure body using GetRange property but it has as arguments instead of array of doubles something called "ref System.Array". I am not able even declare it. How should I write it?

And how can I obtain results (doubles) ?

 

Thanks,

Jara

 

SolidEdgePart.PartDocument partDoc =

(SolidEdgePart.PartDocument) assemDoc.Occurrences.Item(iOcc).PartDocument;

 

for(int iModel = 1; iModel

{

SolidEdgeGeometry.Body bodyObj =

(SolidEdgeGeometry.Body) partDoc.Models.Item(iModel).Body;

 

 

System.Array minRangePoint;

System.Array maxRangePoint;

 

bodyObj.GetRange(minRangePoint, maxRangePoint);

}

 

 

Posted by: Jara Ctverak
Post date: 2/12/2007 1:21:20 AM

2 REPLIES

RE: GetRange

[ Edited ]

Jara,

 

Don't feel bad. COM Interop Array's are tough. To make things worse, .NET 2.0 is broken regarding this. This code will work in .NET 1.1. If you're using .NET 2.0, I'll have to do some more digging to show you how to do it.

 

Array maxRangePoint = Array.CreateInstance(typeof(double), 0);

Array minRangePoint = Array.CreateInstance(typeof(double), 0);

 

bodyObj.GetRange(ref minRangePoint, ref maxRangePoint); }

 

Posted by: Jason Newell
Post date: 2/12/2007 1:40:18 AM

RE: GetRange

[ Edited ]

Hi Jason,

 

Thank you very much it works well!

 

Jara

 

Posted by: Jara Ctverak
Post date: 2/12/2007 2:21:06 AM