Toolkit Programming for relations
Hello,
I am trying to write a C++ code into Creotoolkit to import relations from .txt format file and then regenerate the model. Can anybody guide me how can this be achieved?
TIA
Hello,
I am trying to write a C++ code into Creotoolkit to import relations from .txt format file and then regenerate the model. Can anybody guide me how can this be achieved?
TIA
Depending on what you need you might be able to use ProInputFileRead with the PRO_RELATION_FILE option. The relations.txt file would be in the working directory, but you can give a full path or most of the toolkit API's support using $ENVIRONMENT_VARIABLE.
//Use append_relations = 1 to append the relations and != 1 (ex: append_relations = 0) to replace the existing relations.
int append_relations = 1;
status = ProInputFileRead(mdl, L"relations.txt", PRO_RELATION_FILE, NULL, NULL, &append_relations, NULL);
status = ProSolidRegenerate((ProSolid)mdl, PRO_REGEN_NO_FLAGS);
If that doesn't meet your needs (example: needing to edit the post regeneration relations), you can read the text file line by line using something like wifstream to read each line from the text file and put it into an array of text lines. Then you can use ProArrayObjectAdd and ProRelsetRelationsSet like the example code from
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.