Show / Hide Table of Contents

Importing ProcessDefinition

This example provides information on importing ProcessDefinition. You will need an active station for this example.

You need to pass the filepath of process defintion. To check the result of the addin, ensure that the instruction can be created from RobotStudio.

Use this procedure to Import RsProcessDefintion:

  1. Get Station object.

  2. Create System.Xml.XmlTextReader object.

  3. ImportProcessDefinitions by passing the XmlTextReader object from step2.

Solution

  1. Get Station object.

    Station station = Project.ActiveProject as Station;
    
  2. Create XmlTextReader object.

    textReader = new StreamReader(filePath);
    XmlTextReader definitionFile = new XmlTextReader(textReader);
    
  3. ImportProcessDefinitions by passing the XmlTextReader object from step2.

    station.ActiveTask.ImportProcessDefinitions(definitionFile);
    textReader.Close();
    

Example

This example provides information on importing RsProcessDefinition.

private static bool ImportProcessDefinitionFile(string filePath)
{
    TextReader textReader = null;
                
    //Get Station object                   
    Station station = Project.ActiveProject as Station;
    try
    {
        //Read the file                          
        textReader = new StreamReader(filePath);
        XmlTextReader definitionFile = new XmlTextReader(textReader);

        //Import Process Definition into task     
        station.ActiveTask.ImportProcessDefinitions(definitionFile);
        textReader.Close();

        return true;
    }
    catch
    {
        if (textReader != null)
            textReader.Close();
        return false;
    }
}        

Required Namespaces

System.Xml

System.IO

ABB.Robotics.RobotStudio.Environment

ABB.Robotics.Controllers.RapidDomain

See Also

  • Importing MoveInstruction
  • Importing ActionInstruction
  • Getting Process and Instruction Templates
In this article
Back to top Copyright © 2025 ABB