cancel
Showing results for 
Search instead for 
Did you mean: 

Move the Body encountered NXException:Internal error

Experimenter
Experimenter

this is java code for moving the Body below:

public void moveObjByDistance(NXObject obj, String distance, Direction direction1) throws RemoteException, NXException {
nxopen.Part workPart = theSession.parts().work();
ufSession.ui().openListingWindow();

nxopen.features.MoveObject nullNXOpen_Features_MoveObject = null;
nxopen.features.MoveObjectBuilder moveObjectBuilder1;
moveObjectBuilder1 = workPart.baseFeatures().createMoveObjectBuilder(nullNXOpen_Features_MoveObject);
moveObjectBuilder1.transformMotion().setOption(nxopen.geometricutilities.ModlMotion.Options.DISTANCE);
moveObjectBuilder1.transformMotion().setDistanceVector(direction1);

boolean added1;
if(obj instanceof Body) {
added1 = moveObjectBuilder1.objectToMoveObject().add((Body)obj);
ufSession.ui().writeListingWindow("\nBody: " + obj.getClass() + " ID:" + obj.journalIdentifier());
} else if(obj instanceof Face){
added1 = moveObjectBuilder1.objectToMoveObject().add((Face)obj);
}
moveObjectBuilder1.transformMotion().distanceValue().setRightHandSide(distance);
ufSession.ui().writeListingWindow("\nMove Distance: " + distance);
nxopen.NXObject nXObject1;
nXObject1 = moveObjectBuilder1.commit();
nxopen.NXObject [] objects1 ;
objects1 = moveObjectBuilder1.getCommittedObjects();
moveObjectBuilder1.destroy();
}

I invoked the method in NX10  like this:

this.moveObjByDistance(QFD, new Double(pDistance1).toString(), direction6);

The QFD is a body; pDistance1=9.686485122451934; direction6 is the direction.

While the program was runned at line:"nXObject1 = moveObjectBuilder1.commit()",the program throwed NXException:Internal error.

this is the system log below:

>>>> INTERNAL ERROR caught in file "o:\ugnx1003\ip5\src\modl\no\ind\ModlFeatureJA_MoveObjectBuilder.cxx" at line number 3831
>>>> INTERNAL ERROR caught in file "o:\ugnx1003\ip5\src\cmod\no\ind\jax_feat_builder_definitions.c" at line number 260
>>>> INTERNAL ERROR caught in file "o:\ugnx1003\ip5\drv\part\no\ind\ja_builder_jam.cxx" at line number 84
Caught exception: nxopen.NXException: Internal error
at nxopen.Builder_impl.commit(Native Method)
at CreateSteelMold.moveObjByDistance(CreateSteelMold.java:2172)
at CreateSteelMold.apply(CreateSteelMold.java:665)
at nxopen.blockstyler.BlockDialog_impl.show(Native Method)
at CreateSteelMold.show(CreateSteelMold.java:2243)
at CreateSteelMold.main(CreateSteelMold.java:2265)

 

I don't know why?

1 REPLY

Re: Move the Body encountered NXException:Internal error

Experimenter
Experimenter

I found why the program throwed NXException:Internal error.I created the direction with option: nxopen.SmartObject.UpdateOption.AFTER_MODELING.  I used WITHIN_MODELING to replace it,the program was done.

Also,Thank you very much,everybody!