Activating Simp Rep XToolkitBadInputs
Aug 18, 2023
08:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 18, 2023
08:36 AM
Activating Simp Rep XToolkitBadInputs
So I'm trying to call upon an existing simp rep called "Smd_Flat" and then activate it upon a solid sheet metal part in an assembly to get its flat pattern, however i keep getting a XToolkitBadInputs error. My code is below. This is for Creo Parametric 9.0.4.0.
The method loadPart(leaf); just loads the part in a new window as the simp prep couldnt be found in the window with the assembly.
Any help would be appreciated.
Assembly assembly = getAssembly();
ComponentPath[] partList = MzkCommonUtilitiesCode.listEachLeafComponent(assembly);
//Component path to solid array
Solid[] leafArray = new Solid[partList.length];
for (int j = 0; j < partList.length; j++) {
leafArray[j] = partList[j].GetLeaf();
}
//Going through all subcomponents to get key properties
for (int i =0; i < leafArray.length; i++) {
System.out.println("\n");
printMsg("starting loop");
//getting leaf values
Solid leaf = leafArray[i];
String partName = leaf.GetInstanceName();
if (!partName.startsWith("WP")) {
loadPart(partName);
Window creoPartWindow = proeSession.GetCurrentWindow();
//changing simp rep to flat pattern
SimpRep startingRep = leaf.GetActiveSimpRep();
SimpRep simpRep = leaf.GetSimpRep("Smd_Flat");
// Check that simp rep has been found
//printMsg("Smd_Flat simp rep = " + simpRep.GetName());
try {
printMsg("activating simp rep");
leaf.ActivateSimpRep(simpRep);
printMsg("activated simp rep");
}
catch (XToolkitError x) {
printMsg("Activate Simp Rep exception: " + x.GetMessage());
}
Solved! Go to Solution.
Labels:
- Labels:
-
Jlink
ACCEPTED SOLUTION
Accepted Solutions
Aug 22, 2023
01:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 22, 2023
01:55 AM
Maybe, a problem is:
Note
Creo Object TOOLKIT Java supports simplified representation of Assemblies only, not Parts.
2 REPLIES 2
Aug 22, 2023
01:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 22, 2023
01:55 AM
Maybe, a problem is:
Note
Creo Object TOOLKIT Java supports simplified representation of Assemblies only, not Parts.
Aug 22, 2023
03:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 22, 2023
03:26 AM
Ah, I missed that, thank you very much.
