Reusing Input Data  

The scenario below explains how to reuse input data using the let keyword. For more information about this keyword, see let Keyword.
  1. Re-run The Pocket Calculator scenario. Keep the generated document open.

  2. Enter the script below in the editor:

    context Input : Feature "Select OBody"
    P1 isa GSMPoint
      {
       PointType = 0;
       TypeObject isa GSMPointCoord
         {
           X = 50mm;
           Y = 0mm;
           Z = 150mm;
         }
       }
    P2 isa GSMPoint
       {
        PointType = 0;
        TypeObject isa GSMPointCoord
         {
           X = 50mm;
           Y = 100mm;
           Z = 150mm;
         }
       }
    
    Line1 isa GSMLine
       {
        LineType= 0 ;
        TypeObject isa GSMLinePtPt
         {
           FirstPoint = object : Input : Feature "Select WindowP3";
           SecondPoint = object: ../../P1;
         }
        }
    
    Line2 isa GSMLine
        {
         LineType= 0 ;
         TypeObject isa GSMLinePtPt
           {
             FirstPoint = object : Input : Feature "Select WindowP3";
             SecondPoint = object: ../../P2;
           }
         }
  3. Click Generate. The Enter Inputs dialog box is displayed. You are prompted to enter the OBody feature, then twice the WindowP3 feature. Click Cancel and proceed to the next step.

  4. Replace the current script with the one below:

    let X = Input: Feature "Select WindowP3";
    context Input : Feature "Select OBody"
    
    P1 isa GSMPoint
      {
       PointType = 0;
       TypeObject isa GSMPointCoord
         {
           X = 50mm;
           Y = 0mm;
           Z = 150mm;
         }
       }
    P2 isa GSMPoint
       {
        PointType = 0;
        TypeObject isa GSMPointCoord
         {
           X = 50mm;
           Y = 100mm;
           Z = 150mm;
         }
        }
    
    Line1 isa GSMLine
        {
         PointType = 0 ;
         TypeObject isa GSMLinePtPt
          {
            FirstPoint = object : Input X;
            SecondPoint = object: ../../P1;
          }
         }
    
    Line2 isa GSMLine
         {
          LineType= 0 ;
          TypeObject isa GSMLinePtPt
           {
            FirstPoint = object : Input X;
            SecondPoint = object: ../../P2;
           }
          }
  5. Click Generate. The dialog box below is displayed:

  6. Click Select then select the WindowP3 feature. Click Apply. The second input line
    is highlighted. Click Select then select the OBody feature. Click Apply then click OK.
    Two lines are created. WindowP3 is the point where they intersect.