Skip to main content
1-Visitor
September 15, 2021
Solved

Getting XToolkitGeneralError exception on executing SetConstraints() API of ComponentFeat in JLink

  • September 15, 2021
  • 1 reply
  • 2212 views

I am using Creo Parametric 7.0 7.0.4.0

I am trying to delete the component along with its related children, but before deleting them i am saving all the constraints of parent and child.
After deleting the components I am assembling new component and applying the same restored constraints.I am able to apply the constraints to parent but not able to set for child, it throws XToolkitGeneralError exception.

Here are the errors that I faced
Unable to set constraints to the componentFeat.
Getting XToolkitGeneralError exception on executing SetConstraints() API of ComponentFeat in JLink

Best answer by sgudla

Hello @Priyanka_B,

 

Constraints extracted before deleting the components will be come invalid after deleting the components. These constraints cannot be reused 'as is' as the components paths and the component references of the newly assembled components will not be same.

 

One could extract the information like component location / position, which surface and what type of constraint is applied and then use this information to re-create the constraints for the newly assembled components. I hope this clarifies.

 

Thanks,

Seshu

1 reply

sgudla18-OpalAnswer
18-Opal
September 15, 2021

Hello @Priyanka_B,

 

Constraints extracted before deleting the components will be come invalid after deleting the components. These constraints cannot be reused 'as is' as the components paths and the component references of the newly assembled components will not be same.

 

One could extract the information like component location / position, which surface and what type of constraint is applied and then use this information to re-create the constraints for the newly assembled components. I hope this clarifies.

 

Thanks,

Seshu