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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Jlink Insert Feature sample in UG

PaulGarland
1-Newbie

Jlink Insert Feature sample in UG

The following code, that is in the Wildfire 4.0 toolkit documentation, always produces the XToolkitNotFound exception. Can anyone tell me if there is something special that I need to know to get this code to work?

public Feature createImportFeatureFromDataFile (Solid solid, String csys, String filename) throws Exception
{
IntfNeutralFile data_source;
ModelItems c_systems;
CoordSystem c_system = null;
Feature import_feature = null;
ImportFeatAttr feat_attr;

try
{
data_source = pfcModel.IntfNeutralFile_Create(filename);


c_systems = solid.ListItems(ModelItemType.ITEM_COORD_SYS);

for (int i = 0; i < c_systems.getarraysize(); i++)
{
if (c_systems.get(i).GetName().equals(csys))
{
c_system = (CoordSystem)c_systems.get(i);
break;
}
}


feat_attr = pfcModel.ImportFeatAttr_Create();
feat_attr.SetJoinSurfs(true);
feat_attr.SetMakeSolid(true);
feat_attr.SetOperation(OperationType.ADD_OPERATION);
feat_attr = null;


import_feature = solid.CreateImportFeat(data_source,
c_system,
feat_attr);

}
catch (jxthrowable x)
{
System.out.println("Exception Occured:" + x);
throw new Exception(x);
}

etc...etc...etc...

Paul

2 REPLIES 2

The actual code is on page 22-43 of the Wildfire 5.0 JLink Users Guide.

Well....that was truely painful to figure out - by slow process of elimination. File has to be in the WD folder, and has to be versioned.

Question 2: How do you get session.CreatePart to use the template? (an act of purest optimism to oppose the question in the first place....)

Top Tags