Cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Adapter (jt)

Hello,

 

I am using the JT Open Toolkit to read the following PLMXML file:

 

<?xml version="1.0" encoding="utf-8"?>
<PLMXML xmlns="http://www.plmxml.org/Schemas/PLMXMLSchema" schemaVersion="6" language="en-us" date="2013-08-12" time="14:43:46" author="Teamcenter V8000.3.0.62_20120406.00 - Foo Bar">
  <Header id="id1" traverseRootRefs="#id5" transferContext="Cortona3DDefaultTransferMode"></Header>
  <ProductRevision id="id2" name="FOO,ASSY" accessRefs="#id3" subType="ABC_Part Revision" masterRef="#id6" revision="D">
    <ApplicationRef version="CpJ5ib1NRNqfbC" application="Teamcenter" label="Q5IZ_pW4RNqfbC"></ApplicationRef>
    <AssociatedDataSet id="id15" dataSetRef="#id12" role="IMAN_Rendering">
      <ApplicationRef version="hiN5TQzFRNqfbC" application="Teamcenter" label="hiN5TQzFRNqfbC"></ApplicationRef>
    </AssociatedDataSet>
  </ProductRevision>
  <Product id="id6" name="FOO,ASSY" accessRefs="#id3" subType="ABC_Part" productId="12345">
    <ApplicationRef version="Q5IZ_pW4RNqfbC" application="Teamcenter" label="Q5IZ_pW4RNqfbC"></ApplicationRef>
  </Product>
  <ProductView rootRefs="id5" primaryOccurrenceRef="id5">
    <Occurrence id="id5" instancedRef="#id2">
      <ApplicationRef application="Teamcenter" label="Q3ZFDBb5Y1laUB/gnVFDB8AY1laUB"></ApplicationRef>
      <Transform id="id167">-1 0 0 0 0 1 0 0 0 0 -1 0 -1.49202 0.7055399999999999 -0.363823499999999 1</Transform>
    </Occurrence>
  </ProductView>
  <AccessIntent id="id3" intent="reference" ownerRefs="#id4"></AccessIntent>
  <Site id="id4" name="UKDBY01" siteId="356181945">
    <ApplicationRef version="wJFBnlGxRNqfbC" application="Teamcenter" label="wJFBnlGxRNqfbC"></ApplicationRef>
  </Site>
  <DataSet id="id12" name="12345-D" accessRefs="#id3" version="1" memberRefs="#id16" type="DirectModel">
    <ApplicationRef version="hKA5TQzFRNqfbC" application="Teamcenter" label="hKA5TQzFRNqfbC"></ApplicationRef>
    <UserData id="id14">
      <UserValue value="" title="ref_names">
        <UserList id="id13" type="list">
          <Item value="JTPART"></Item>
        </UserList>
      </UserValue>
    </UserData>
  </DataSet>
  <ExternalFile id="id16" accessRefs="#id3" locationRef="12345_D-FOO,ASSY/MODEL$.jt" format="jt">
    <ApplicationRef version="hGL5TQzFRNqfbC" application="Teamcenter" label="hGL5TQzFRNqfbC"></ApplicationRef>
  </ExternalFile>
</PLMXML>

 

My C++ code is as follows: 

 

using namespace plmxml_api;
using namespace plmxml60;

JtkEntityFactory::init();
JtkEntityFactory::registerCustomer(12345);

char* options[] = { "CustomerID=12345" };
char* pluginNames[]={"plmxmlAdapterJT60"};
Initialise(1, pluginNames, 1, options);

Configuration loadOptions;
loadOptions.Set("adapters/JT/CustomerID", "12345");
loadOptions.Set("adapters/JT/Initialised", "TRUE" );
loadOptions.Set("adapters/JT/import/ModelViews", "TRUE" );

Array<Handle> aHandles;
Result r=Load("C:\\file.xml", loadOptions, aHandles);
if(r.GetCode()!=ErrorCodeOK) printf("%S\n",(wchar_t*)r.GetMessage().GetData());

 

When I run the code, it displays the following error:

 

Missing Adapter (jt), resolving: 12345_D-FOO,ASSY/MODEL$.jt

 

What am I doing wrong? How do I connect the JT adapter? Do I have to implement the adapter myself or is it possible to use a standard one? If the PLMXML file contains other file types in addition to JT, do I have to supply an adapter for each file type?

1 REPLY

Re: Missing Adapter (jt)

The PLMXML file indicates format="jt", but plmxmlAdapterJT60 expects file type "JT" (case-sensitive). The solution is:

 

loadOptions.Set("adapters/substitute", "jt/JT");

 

Now the program loads PLMXML without error messages.