cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are troubleshooting an issue impacting community login, and it may be intermittently unavailable. Sorry for any inconvenience.

JLink question: importing relations

lylebeidler
1-Newbie

JLink question: importing relations

I'm having trouble importing relations into my model.

Here's what I have:

String relationsFileName =
"z:/engineering/IL_START/configurator_relations.txt";

File relationsFile = new
File(relationsFileName);

if (relationsFile.exists())

{

try {


RelationImportInstructions importInst =
pfcModel.RelationImportInstructions_Create();


model.Import(relationsFileName,importInst);

}// end try
block

catch (Exception e)

{writeLog("Error
importing relations" + e);

mesg = "error
importing relations";

}

}// end if relationsfile
exists

else

{mesg = "relation file not
found";

}



The underlined line is what I'm having trouble with. I know for the Import
command to work, I need ImportInstructions, but for the life of my I can't
figure out what that is supposed to accomplish.

Can any of you gurus help me with this?

Thanks!

--



Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
<">mailto:-> -
<">http://www.mgsincorporated.com>
2 REPLIES 2


> ... I know for the Import
> command to work, I need ImportInstructions, but for the life of my I can't
> figure out what that is supposed to accomplish. ...


For relations, the instructions are simply a placeholder object in the
Import() and Export() methods. The steps you are following look correct,
if you're using WF3. In WF4, there is a more direct way to access relations.

What type of problem are you having exactly?


Marc
--
Marc Mettes
-
Visit My CAD/PDM AutomationBlog
Or, Subscribe to My CAD/PDM Automation Blog by Email





Turns out the answer is: I'm an idiot.



The relations I was importing in referenced parameters I had not yet added
into the model, so the Relations dialog was throwing a "Relations have an
error" message, which my error checking was not showing me.



--



Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
<">mailto:-> -
<">http://www.mgsincorporated.com>
Announcements


Top Tags