lharrison
New member
- Oct 19, 2011
- 52
Hello all,
I'm trying to write what I thought would be a quick and easy NXOpen program to batch STP->NX conversions. We wanted a few other things such as changing part and background color that the translation tool doesn't provide. I'm having quite an issue trying to use the NXOpen methods to convert these files though. Here's a snippet of code where the conversion is supposed to take place:
Problem is, I'm not getting any output at all from the translator. Once the command window pops open, I'm greeted with the following message:
referring to the syslog, I see the section indicating my NXOpen program has begun, and the final message simply states that the translation has failed. I can easily convert models using the translator from the command line as well as from the NX GUI. Is this piece of NXOpen broken in my release(9.0.2)?
I'm trying to write what I thought would be a quick and easy NXOpen program to batch STP->NX conversions. We wanted a few other things such as changing part and background color that the translation tool doesn't provide. I'm having quite an issue trying to use the NXOpen methods to convert these files though. Here's a snippet of code where the conversion is supposed to take place:
Code:
Session NXSession = Session.GetSession();
foreach (string s in (e.Argument as ListBox).Items)
{
try
{
Step214Importer STPImporter = NXSession.DexManager.CreateStep214Importer();
STPImporter.InputFile = s;
STPImporter.ImportTo = Step214Importer.ImportToOption.WorkPart;
STPImporter.ImportToTeamcenter = false;
STPImporter.LayerDefault = 1;
STPImporter.ObjectTypes.Curves = true;
STPImporter.ObjectTypes.Surfaces = true;
STPImporter.ObjectTypes.Solids = true;
STPImporter.ObjectTypes.Csys = true;
STPImporter.ObjectTypes.ProductData = true;
STPImporter.ObjectTypes.PmiData = true;
STPImporter.Optimize = true;
STPImporter.SettingsFile = @"C:\Program Files\Siemens\NX 9.0\step214ug\step214ug.def";
STPImporter.FileOpenFlag = false;
NXObject _object = STPImporter.Commit();
STPImporter.Destroy();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Problem is, I'm not getting any output at all from the translator. Once the command window pops open, I'm greeted with the following message:
Code:
Error - Unhandled UG Exception caught.
With the following message <Internal error: memory access violation>.
Please reference syslog for more detailed information
referring to the syslog, I see the section indicating my NXOpen program has begun, and the final message simply states that the translation has failed. I can easily convert models using the translator from the command line as well as from the NX GUI. Is this piece of NXOpen broken in my release(9.0.2)?