Showing results for 
Search instead for 
Did you mean: 

ConvSMs unsing

Valued Contributor
Valued Contributor



I have a little problem with this function.

When i try to use it :

                    SolidEdgePart.ConvToSMs objConvs = objModel.ConvToSMs;

                    Array tab = Array.CreateInstance(typeof(Object), 100);



                        objConvs.Add(topFace, 0, ref tab, Missing.Value, 0, 0);


(topFace is the face with the biggest aera)

i have always an exception :

Une exception de première chance de type 'System.Runtime.InteropServices.COMException' s'est produite dans mscorlib.dll

Erreur non spécifiée (Exception de HRESULT : 0x80004005 (E_FAIL))


   à System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)

   à SolidEdgePart.ConvToSMs.Add(Object RefFace, Int32 nEdgeNum, Array& EdgesArray, Object BRType, Double dBRWidth, Double dBRLength)

   à ImportStep.SeDocWorker.Convertit(SolidEdgeDocument objDoc) dans D:\Developpement\Professionnel\ImportStep\ImportStep\SeDocWorker.cs:ligne 88

I don't understand why. Have you an idee ?



Posted by: Jean-Christophe Brabant
Post date: 2/25/2009 4:32:32 AM


RE: ConvSMs unsing

Valued Contributor
Valued Contributor


If you look at the IDL definition of the method, the 2nd parameter is the length of the 3rd parameter.  You're passing zero so that is incorrect.  Also, the 3rd parameter expects an array of valid Edge objects.  That's the best hint that I can give you at the moment.[id(0x00000018), helpstring("Adds an occurrence of the referenced object."), helpcontext(0x00007535)]ConvToSM* Add( [in] IDispatch* RefFace, [in, optional] long nEdgeNum, [in, optional] SAFEARRAY(IDispatch*)* EdgesArray, [in, optional] VARIANT BRType, [in, optional] double dBRWidth, [in, optional] double dBRLength);


Posted by: Jason Newell
Post date: 2/26/2009 12:47:34 PM

RE: ConvSMs unsing

Valued Contributor
Valued Contributor



I have found a solution for this use.

This function is relevant with document ".par" but when i have opened with "sheet metal" template.

If you open the document .par with template "iso part.par", it's unable to applie this function.

(It works correctly even if i take 0 to the second parameter.)



Posted by: Jean-Christophe Brabant
Post date: 2/27/2009 1:57:47 AM