Reply

SE API with C++/Properties

[ Edited ]

 

    //SolidEdgeFramework::ApplicationPtr pSEApp;

    //SolidEdgeFramework:Smiley FrustratedolidEdgeDocumentPtr pSEDoc;

    //SolidEdgePart:Smiley TongueartDocumentPtr pPartDoc;

    //SolidEdgeFramework:Smiley TongueropertySetsPtr pPropSets;

    //SolidEdgeFramework:Smiley TongueropertiesPtr pProps;

    //SolidEdgeFramework:Smiley TongueropertyPtr pProp;

    IDispatchPtr pDispatch;

    //HRESULT hr;

    //pSEApp.GetActiveObject("SolidEdge.Application");

    //pDispatch=pSEApp->ActiveDocument;

    //hr=pDispatch->QueryInterface(&pPartDoc);

    //pDispatch=pPartDoc->Properties;

    //hr=pDispatch->QueryInterface(&pPropSets);

    //CString tempStr;

 

    //long k=pPropSets->Count;

    //for(long i=1;iCount;i++)

    //{

    //    tempStr.Empty();

    //    pProps=pPropSets->Item(i);

    //    tempStr=(LPCSTR)pProps->Name;

    //    //MessageBox(tempStr);

 

    //    for(long j=1;jCount;j++)

    //    {

    //        tempStr.Empty();

    //        pProp=pProps->Item(j);

    //        tempStr=(LPCSTR)pProp->Name;

    //        //MessageBox(tempStr);

    //    }

    //}

    //pProps=pPropSets->Item("SummaryInformation");

    //pProp=pProps->Item("Title");

    //tempStr=pProp->GetValue().bstrVal;

 

    SolidEdgeFileProperties::IJPropertySetsPtr pPropSets;

    SolidEdgeFileProperties::IJPropertiesPtr pProps;

    pPropSets.CreateInstance("SolidEdge.FileProperties");

    pPropSets->Open("C:\\1.par",false);

    long x=1;

    pDispatch=pPropSets->GetItem((long)1);

    pDispatch->QueryInterface(&pProps);

 

    MessageBox(pProps->Name);

    SolidEdgeFileProperties::IJPropertyPtr pProp;

    pProps=pPropSets->GetItem("Custom");

    pProps->Add("xxx",(_variant_t)"yyy");

    pProps->Save();

 

 

Posted by: assassin 007
Post date: 5/16/2010 7:53:10 PM

1 REPLY

RE: SE API with C++/Properties

[ Edited ]

assassin,

 

I certainly appreciate the input. Might I suggest that you use the wiki for examples. I started http://wiki.jasonnewell.net/SDK.ashx but you can certainly expand it from there.

 

Posted by: Jason Newell
Post date: 5/16/2010 7:55:59 PM