Cancel
Showing results for 
Search instead for 
Did you mean: 

Getting parameters from patheditor

Experimenter
Experimenter

Hi Developer,

is there a possibility to get the Parameters shown in Patheditor? Especially I am searching for the speed and the Acceleration.

 

Greetings Düren

 

Patheditor.PNGpatheditor

 So now I fixed it, now I can easyly take the names on the Patheditor.

 public void ShowMotionType()
        {
            TxObjectList selectedObjects = TxApplication.ActiveSelection.GetItems();
            if (selectedObjects.Count == 1)
            {
                ITxRoboticLocationOperation op = selectedObjects[0] as ITxRoboticLocationOperation;
                if (op != null)
                {
                    string paramValue = GetDynamicParameter((op.Collection as ITxRoboticOrderedCompoundOperation).Robot.Controller.Name, "Speed", op);        //"Speed" für Joint Speed, "Acc" für Beschleunigung
                    MessageBox.Show("Speed = " + paramValue);
                }
            }
        }

        public string GetDynamicParameter(string controllername, string columnName, ITxOperation op)
        {
            string paramValue = string.Empty;

            TxOlpControllerUtilities utils = new TxOlpControllerUtilities();
            ITxOlpRobotControllerParametersHandler paramHandler = (ITxOlpRobotControllerParametersHandler)utils.GetInterfaceImplementationFromController(controllername, typeof(ITxOlpRobotControllerParametersHandler), typeof(TxRobotSimulationControllerAttribute), "ControllerName");
            if (paramHandler != null)
            {
                if (paramHandler.HasComplexRepresentation(columnName, op, TxOlpCommandLayerRepresentation.UI))
                {
                    paramValue = paramHandler.GetComplexRepresentation(columnName, op, TxOlpCommandLayerRepresentation.UI);
                }
            }

            return paramValue;
        }
8 REPLIES

Re: Getting parameters from patheditor

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Duren,

 

Please check this article:

https://community.plm.automation.siemens.com/t5/Tecnomatix-Developer-Forum/How-to-obtain-Circ-Motion...

 

Best Regards,

DianaG

 

Re: Getting parameters from patheditor

Experimenter
Experimenter

Hi DianaG,

Thanks for the Link. I am not sure what I have to to put in instead of "RRS_MOTION_TYPE" to get the velocity (and in the next step the acceleration) in percent. I would be grateful for an answer.

Best Regards

Düren

Re: Getting parameters from patheditor

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Duren,

 

Did you read the entire thread? The last post give you an example how to read the parameters the way you see them in Path Editor.

 

Best Regards,

DianaG

Re: Getting parameters from patheditor

Experimenter
Experimenter

Hi Diana,

i read the Link Acceleration and Speed works fine. I just tried to get the Duration from the Patheditor, with putting the word duration in the gap where Acc stands before but it doesn't works.

Can you help me?

Greetings

Düren

string sDauer = GetDynamicParameter((op.Collection as ITxRoboticOrderedCompoundOperation).Robot.Controller.Name, "Duration", op);

Re: Getting parameters from patheditor

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Duren,

 

The Duration is a general parameter of the operation, so you can get it using the Duration property of ITxOperation.

GetDynamicParameter is used usually for custom parameters of the controller.

 

Best Regards,

DianaG

Re: Getting parameters from patheditor

Experimenter
Experimenter

Hi,

 

Thank you Diana for the answer. Now I can get the duration.

Can you also tell me how to get the Robot-Name like it is shown in the Patheditor?

I couldn't find a property for the Robot Name. Or does another way exist to get all the operations of a robot when I got its Name?

 

Best Regards,

Düren

Re: Getting parameters from patheditor

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Duren,

 

To get the robot name for ITxRoboticLocationOperation, you can use this code:

ITxRoboticLocationOperation robLocOperation = TxApplication.ActiveSelection.GetItems()[0] as ITxRoboticLocationOperation;
            if(robLocOperation != null)
            {
                ITxRoboticOrderedCompoundOperation roboticOperation = robLocOperation.ParentRoboticOperation;
                string robotName = roboticOperation.Robot.Name;
            }

 

Best Regards,

DianaG

Re: Getting parameters from patheditor

Experimenter
Experimenter

Thanks a lot for your Help.