Reply

How to get the Profile Information of the ExtrudeCutOut of the Assembly level Feature

[ Edited ]

 

Hi Jason,

    Please check this .... we have discussed regarding assembly level features earlier.. i can able to get the "Assembly level Hole profile information... why i am not getting Extrude cutout profile"

 

#include "stdafx.h"

 

 

int _tmain(int argc, _TCHAR* argv[])

{

    HRESULT hr = S_OK;

    SolidEdgeFramework::ApplicationPtr pApplication = NULL;

    SolidEdgeFramework:Smiley FrustratedolidEdgeDocumentPtr pDocument = NULL;

    SolidEdgeAssembly::AssemblyDocumentPtr pAssembly = NULL;

    SolidEdgeAssembly::AssemblyFeaturesPtr pAssemblyFeatures = NULL;

    SolidEdgeAssembly::AssemblyFeaturesExtrudedCutoutsPtr pAssemblyFeaturesExtrudedCutouts = NULL;

    SolidEdgeAssembly::AssemblyFeaturesExtrudedCutoutPtr pAssemblyFeaturesExtrudedCutout = NULL;

 

    IfFailGo(CoInitialize(NULL));

    IfFailGo(pApplication.GetActiveObject(_T("SolidEdge.Application")));

    pDocument = pApplication->ActiveDocument;

 

    IfNullGo(pDocument);

 

    if (pDocument->Type == SolidEdgeFramework::igAssemblyDocument)

    {

        pAssembly = pDocument;

        pAssemblyFeatures = pAssembly->GetAssemblyFeatures();

        pAssemblyFeatures->GetAssemblyFeaturesExtrudedCutouts();

        pAssemblyFeaturesExtrudedCutouts = pAssemblyFeatures->GetAssemblyFeaturesExtrudedCutouts();

 

        for (LONG i = 1; i Count; i++)

        {

            pAssemblyFeaturesExtrudedCutout = pAssemblyFeaturesExtrudedCutouts->Item(i);

            _bstr_t bstrName(pAssemblyFeaturesExtrudedCutout->Name);

            _tprintf(_T("%s\r\n"), bstrName.GetBSTR());

 

   long nProf=0;

    SAFEARRAY *pProfiles = NULL;        

  pAssemblyFeaturesExtrudedCutout ->GetProfiles(&nProf,&pProfiles);  //***** it is crashing here

 

        }

    }

 

Error:

    pAssemblyFeaturesExtrudedCutout = NULL;

    pAssemblyFeaturesExtrudedCutouts = NULL;

    pAssemblyFeatures = NULL;

    pAssembly = NULL;

    pDocument = NULL;

    pApplication = NULL;

    CoUninitialize();

 

return 0;

}

 

Posted by: Triad User
Post date: 5/4/2009 1:22:24 AM

1 REPLY

RE: How to get the Profile Information of the ExtrudeCutOut of the Assembly level Feature

[ Edited ]

I think you're going to have to submit an IR to GTAC on this one. Everything that I've tried does not work. The code as you have it should work.

 

Posted by: Jason Newell
Post date: 5/5/2009 3:43:56 AM