Skip to main content
1-Visitor
June 2, 2011
Question

Jlink Insert Feature sample in UG

  • June 2, 2011
  • 1 reply
  • 1842 views

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

1 reply

1-Visitor
June 3, 2011

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

1-Visitor
June 20, 2011

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....)