Cancel
Showing results for 
Search instead for 
Did you mean: 

JTOpen API to open existing jt file

Experimenter
Experimenter

Hello Experts,

 

I want to open an existing jt file and add a text to it using JT Open API. Is this possible ? Please give me some hints (sample code) to do it.

 

Thank you in advance.

 

Regards,

Gowreeswar

1 REPLY

Re: JTOpen API to open existing jt file

Experimenter
Experimenter

Hello everyone, I figured out how to open an existing JT using API 

 

JtkEntityPtr<JtkCADImporter> importer;
importer = JtkEntityFactory::createCADImporter();

 

JtkEntityPtr<JtkHierarchy> root;
root = importer->import( "<jt path>");

 

and to create PMI

// Note
JtkEntityPtr<JtkPMINote> note = ( JtkPMINote* )JtkEntityFactory::createPMI( JtkEntity::JtkPMINOTE, child );
double noteOrigin[ 3 ] = { 0, 10, 0 };
double noteBottomRight[ 3 ] = { -1, 10, 0 };
double noteTopLeft[ 3 ] = { 0, 10, 1 };
note->setVisualFrame( noteOrigin, noteBottomRight, noteTopLeft );
double arTxtBox[ ] = { -10, -1, 10, 0, 0, 1 };
note->addVisualTextData( "top view", arTxtBox, 1, 0, 0 );