Cancel
Showing results for 
Search instead for 
Did you mean: 

Apply Robotic Rules

Experimenter
Experimenter

Hi there,

 

I have a problem to apply robotic rules. I programmed a .dll in C# which I start in NX (Strg.+U).

There I change some robotic rules like the robot configuration. But I can't figure out how to apply them.

 

So there is the python file: "ApplyRoboticRules.py". Is it possible to execute it? I've tried the following without success:

 

System.Diagnostics.Process.Start("C:\\Program Files\\Siemens\\NX 10.0\\UGII\\run_journal.exe", "\"C:\\Program Files\\Siemens\\NX 10.0\\MACH\\resource\\robots\\ApplyRoboticRules.py\"");

 

In the command window appears:

"Journal execution results for C:\...\ApplyRoboticRules.py...

Execution was successful."

 

But it seems that nothing happend in NX. Do you have any ideas for me?

 

Best regards

Medi89

 

Edit: Or is it possible to press a menubutton? I can find the button with:

 

NXOpen.MenuBar.MenuButton menubutton = theUI.MenuBarManager.GetButtonFromName("UG_CAM_ROBOTIC_APPLY_RULES");

 

But is there a way to "press" the button?

 

 

1 REPLY

Re: Apply Robotic Rules

Experimenter
Experimenter

Noone any idea?

 

So another way I tried is to import IronPython to my project and execute the Python-Skript. I do it with the following code:

 

var engine = Python.CreateEngine();
var paths = engine.GetSearchPaths();
paths.Add(@"C:\Program Files\Siemens\NX 10.0\UGII\python");
paths.Add(@"C:\Python27\Lib");
engine.SetSearchPaths(paths);
engine.ExecuteFile(@"C:\Program Files\Siemens\NX 10.0\MACH\resource\robots\ApplyRoboticRules.py");

 

But then I get this Error:

"No module named NXOpen"

 

Am I missing another path?