GenerativeComponents Help

Setting Additional properties when using ByFunction technique

  1. When using the ByFunction technique, properties such as LevelName, Transparency, LineStyleName, or Color can be set in the same was as modelBased nodes created using other techniques.

    They are listed, by alphabetically by default, along with Function and FunctionArguments. Here the Color property is set.

    transaction 1 modelChange 'Add coordinateSystem1'
    {
        node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
        {
            Technique                 = 'AtModelOrigin';
            GraphLocation             = <auto> {40.0, 40.0};
        }
    }
    
    transaction 2 modelChange 'Change coordinateSystem1'
    {
        node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
        {
            GraphLocation             = {25.0, 84.167, 174.0, 115.59};
        }
    }
    
    transaction 3 modelChange 'Change coordinateSystem1'
    {
        node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
        {
            Technique                 = 'AtModelOrigin';
            DGNModelName              = '3D Metric Design';
        }
    }
    
    transaction 4 modelChange 'Add point01'
    {
        node User.Objects.point01 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            XTranslation              = <free> 0.0;
            YTranslation              = <free> 0.0;
            ZTranslation              = <free> 0.0;
            GraphLocation             = <auto> {299.0, 84.167};
        }
    }
    
    transaction 5 modelChange 'Add point02'
    {
        node User.Objects.point02 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            XTranslation              = <free> 0.0;
            YTranslation              = <free> 0.0;
            ZTranslation              = <free> 0.0;
            GraphLocation             = <auto> {299.0, 280.037};
        }
    }
    
    transaction 6 modelChange 'Change point01'
    {
        node User.Objects.point01 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            YTranslation              = 10;
        }
    }
    
    transaction 7 modelChange 'Change point02'
    {
        node User.Objects.point02 Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {298.167, 243.37};
        }
    }
    
    transaction 8 modelChange 'colorLine ByPoints  1.'
    {
        node User.Objects.colorLine Bentley.GC.NodeTypes.Line
        {
            Function                  = Line function (Point startPoint, Point endPoint) 
                                        {
                                        Line ln = new Line(); 
                                        ln.ByPoints(startPoint, endPoint); 
                                        return ln; 
                                        };
            FunctionArguments         = {point01, point02};
            Color                     = 3;
        }
    }
  2. Properties can be set directly within the function of the ByFunction technique. This function demonstrates how to directly assign a property to the top-level node.

    transaction 1 modelChange 'Add coordinateSystem1'
    {
        node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
        {
            Technique                 = 'AtModelOrigin';
            GraphLocation             = <auto> {40.0, 40.0};
        }
    }
    
    transaction 2 modelChange 'Change coordinateSystem1'
    {
        node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
        {
            GraphLocation             = {25.0, 84.167, 174.0, 115.59};
        }
    }
    
    transaction 3 modelChange 'Change coordinateSystem1'
    {
        node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
        {
            Technique                 = 'AtModelOrigin';
            DGNModelName              = '3D Metric Design';
        }
    }
    
    transaction 4 modelChange 'Add point01'
    {
        node User.Objects.point01 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            XTranslation              = <free> 0.0;
            YTranslation              = <free> 0.0;
            ZTranslation              = <free> 0.0;
            GraphLocation             = <auto> {299.0, 84.167};
        }
    }
    
    transaction 5 modelChange 'Add point02'
    {
        node User.Objects.point02 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            XTranslation              = <free> 0.0;
            YTranslation              = <free> 0.0;
            ZTranslation              = <free> 0.0;
            GraphLocation             = <auto> {299.0, 280.037};
        }
    }
    
    transaction 6 modelChange 'Change point01'
    {
        node User.Objects.point01 Bentley.GC.NodeTypes.Point
        {
            Technique                 = 'ByCartesianCoordinates';
            YTranslation              = 10;
        }
    }
    
    transaction 7 modelChange 'Change point02'
    {
        node User.Objects.point02 Bentley.GC.NodeTypes.Point
        {
            GraphLocation             = {298.167, 243.37};
        }
    }
    
    transaction 8 modelChange 'colorLine ByPoints  1.'
    {
        node User.Objects.colorLine Bentley.GC.NodeTypes.Line
        {
            Function                  = Line function (Point startPoint, Point endPoint) 
                                        {
                                        Line ln = new Line(); 
                                        ln.ByPoints(startPoint, endPoint); 
                                        this.Color = 3; 
                                        return ln;
                                        };
            FunctionArguments         = {point01, point02};
        }
    }

    When creating an array of nodes, the color can be a single one or a matching array.