Skip to main content
6-Contributor
August 31, 2022
Solved

XToolkitObsoleteFunc with C++ otk in Creo 9.0.0.0 for pfcComponentFeat::GetModelDescr()

  • August 31, 2022
  • 1 reply
  • 1692 views

I am attempting to get a c++ otk creo adding to work with Creo 9.0.0.0. I have the plugin working in 8.0.0.0 and 8.0.3.0 with the following code:

[ I should note that I have used the 8.0.0.0 otk libs to build against as that was the original target version - my issue may just be that I have to build against 9.0.0.0 protk and otk libraries - I will try that if that is confirmed to be the case]

 

pfcFeature_ptr childFp = childFeatures->get(i);
pfcComponentFeat_ptr compPtr = pfcComponentFeat::cast(childFp);
pfcModelDescriptor_ptr mdlPartInstDesc = compPtr->GetModelDescr(); <== exception thrown here

 

and ultimately I need to obtain the child model using the Model Descriptor and the current session

pfcModel_ptr childMdl = currentSession->RetrieveModel(mdlPartInstDesc);

 

However I get an exception pfcExceptions::XToolkitObsoleteFunc
{
Message : "pfcExceptions::XToolkitObsoleteFunc"
MethodName : "pfcModel::Model::Descr<get>"
ToolkitFunctionName : "ProMdlDataGet"
}

thrown when I call compPtr->GetModelDescr(). I do not see this function listed as obsolete in /PTC/Creo 9.0.0.0/Common Files/otk_cpp_doc/Otk_Cxx_RelNotes.pdf

Best answer by Eike_Hauptmann

Hi Paul

 

ProMdlDataGet is TK and it is obsolete. So it gets automatically replaced by using the new 9.0 sources.

 

Eike_Hauptmann_0-1661941988406.png

 

So yes, you need to get the Creo 9.0 sources and build against them.

 

Br,

Eike

 

1 reply

15-Moonstone
August 31, 2022

Hi Paul

 

ProMdlDataGet is TK and it is obsolete. So it gets automatically replaced by using the new 9.0 sources.

 

Eike_Hauptmann_0-1661941988406.png

 

So yes, you need to get the Creo 9.0 sources and build against them.

 

Br,

Eike

 

PAULR_UK6-ContributorAuthor
6-Contributor
August 31, 2022

Thanks Eike for your prompt reply