Cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Robot Programm into Path editor

Valued Contributor
Valued Contributor

Hello all,

 

I wan to add robot program into path editor using robotic program inventory.

U can understand like these following steps:

1.) From robotic programm inventory , create new program , add into programm editor and then make it default.

 

Can u suggest initial steps for that?

 

Thnx

 

6 REPLIES

Re: Adding Robot Programm into Path editor

Valued Contributor
Valued Contributor

I try just this code for creating robotic program for each robot and it crates robotic programm for each robot. But then i m confused, which method should i use to add each program into path editor. Also type of rpbptic program is ITxRoboticProgram, so to which typei need to convert it to add to path editor

 TxObjectList list = TxApplication.ActiveDocument.PhysicalRoot.GetAllDescendants(new TxTypeFilter(typeof(TxRobot)));
            foreach (TxRobot robot in list)
            { 
                
                ITxRoboticProgram rp= TxApplication.ActiveDocument.RoboticProgramRoot.CreateProgram(new TxRoboticProgramCreationData(robot));
                rp.Name = robot.Name + "_Program";
}
                

Re: Adding Robot Programm into Path editor

Legend
Legend

Hi,

you want to use the members of ITxPathEditorViewer?

 

From the SDK-help:

ITxPathEditorViewer Interface Members

 
 MethodAddOperationAdds an operation to the viewer.  
 MethodCanAddOperationReturns whether the passed operation can be added to the viewer.  
 MethodRemoveAllItemsRemoves all items currently loaded in the viewer.  
 MethodRemoveOperationRemoves an operation from the viewer.  
 MethodRemoveRoboticProgramRemoves the robotic program (if any) currently loaded in the viewer.  
 MethodSetRoboticProgramSets a robotic program in the viewer.  
 

Re: Adding Robot Programm into Path editor

Valued Contributor
Valued Contributor

Hello @MarkusH

Thanx, I have created a root program and set into path editor. Now i want to add Generic operation into robot program. Manually we drag generic operaton and paste under Robot program. So how can i add generic operation under robot program ? Thanx

ITxRoboticProgram RobotProgram = TxApplication.ActiveDocument.RoboticProgramRoot.CreateProgram(new TxRoboticProgramCreationData(selectedrobot));
            RobotProgram.Name = selectedrobot.Name + "_Program";
            TxApplication.ViewersManager.PathEditorViewer.SetRoboticProgram(RobotProgram);

Re: Adding Robot Programm into Path editor

Legend
Legend

I really don't know, because I have never worked with robotic programs.

But maybe

RobotProgram.AddElement(new TxGenericRoboticOperation)

Re: Adding Robot Programm into Path editor

Valued Contributor
Valued Contributor

Hi,

Thanx ur suggested code successfully worked. 

I want to set Path Number by using a WPF. Which property should i use to set path number.

Do i use property of Generic operation or robotic program?

i could not find property in that.

Can u help me that?

U can refer the picture attached.

 

 

Re: Adding Robot Programm into Path editor

Siemens Genius Siemens Genius
Siemens Genius

Hi,

 

try this:

TxRoboticProgram.GetElementNumber().

 

Regards,

Moshe