Generative Components

I am trying to place a co-ordinate system along a bspline curve. I need to use "by incremental distance along curve" as the spacing varies and I need to use "chord length"  for my purposes. I am finding that if I use the "chord length" option I get an error saying the "curve must be planar", but if I use "by spacing along a curve" using "chord length" it works? this also occurs with points? these errors do not occur if I use the "arc length" option.

Parents Reply Children
  • I would setup a int that gave a list of indices of the CS you needed. Do you want to remove just one or random ones in the list?

    eg 0,1,2,4,5,6,7

    or 0,1,2,4,5,7, 

    etc

    Then you could use a MembersAt  to extract the required items from the list.

    I typically wrap all this into a function but you could do it with a few nodes.

    Thanks

    Wayne

  • look it would be random ones, say I have spans at 27m and every now and then I would have to change the spans to make it fit over roads, services etc.?

  • ok, 

    For a single item it would easy enough to use an expression like

    RemoveAt(list,int) where the list is your list of items and the int is the index of the item you want to remove.

    just thinking of an easy expression for multiple items at random indexes.

  • Hi Richard,

    I did a bit of tinkering and there might be a way to do it via expressions and nodes but I find it easier to write a function. 

    So I placed a cell node byfunction and then just looped through and excluded the index list with in if statement. Then you can just feed it the inputs with the indexes you wish to exclude ie {0,5,8,7} 

    looks to work. Give it a try.

    I have attached a txt export of the transactions. 

    Thanks

    Wayne

    transaction 1 stateChange 'Add baseCS'
    {
        gcModel
        {
            node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem
            {
                Technique                 = 'AtDGNModelOrigin';
                DGNModelName              = 'Design Model';
                SymbolSize                = 1;
                GraphLocation             = {254.82, 155.868, 0.0, 116.37};
            }
        }
    }
    
    transaction 2 stateChange 'Add point2, point3'
    {
        gcModel
        {
            node User.Objects.point2 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ByCartesianCoordinates';
                CoordinateSystem          = baseCS;
                XTranslation              = <free> -1675.64158747857;
                YTranslation              = <free> 5653.90897416519;
                ZTranslation              = <free> 0.0;
                GraphLocation             = {559.144, 40.366, 0.0, 155.43};
            }
            node User.Objects.point3 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ByCartesianCoordinates';
                CoordinateSystem          = baseCS;
                XTranslation              = <free> 24252.3999804634;
                YTranslation              = <free> 4506.81733303709;
                ZTranslation              = <free> 0.0;
                GraphLocation             = {561.144, 236.463, 0.0, 155.43};
            }
        }
    }
    
    transaction 3 stateChange 'Add line1'
    {
        gcModel
        {
            node User.Objects.line1 Bentley.GC.NodeTypes.Line
            {
                Technique                 = 'ByPoints';
                StartPoint                = point2;
                EndPoint                  = point3;
                GraphLocation             = {833.667, 163.0};
            }
        }
    }
    
    transaction 4 stateChange 'Add coordinateSystem1'
    {
        gcModel
        {
            node User.Objects.coordinateSystem1 Bentley.GC.NodeTypes.CoordinateSystem
            {
                Technique                 = 'ByNumberAlongCurve';
                Curve                     = line1;
                NumberAlongCurve          = 20;
                NumberAlongCurveOption    = NumberAlongCurveOption.ChordLength;
                IncludeStart              = true;
                IncludeEnd                = true;
                GraphLocation             = {1067.666, 44.333, 0.0, 155.43};
            }
        }
    }
    
    transaction 5 stateChange 'Add SkipList'
    {
        gcModel
        {
            node User.Objects.SkipList Bentley.GC.NodeTypes.Expression
            {
                Technique                 = 'Default';
                Value                     = {2,6,7,12,15};
                GraphLocation             = {1067.938, 224.232, 0.0, 116.35};
            }
        }
    }
    
    transaction 6 stateChange 'Add cell2'
    {
        gcModel
        {
            node User.Objects.cell2 Bentley.GC.NodeTypes.Cell
            {
                Technique                 = 'ByFunction';
                Function                  = function (CoordinateSystem InputCS, object SkipIndex,string InputCell,string InputCellLibrary)
                                            {
                                            Cell MyCellList = {};
                                            
                                            
                                            for (int i = 0; i < InputCS.Count; ++i)
                                            {
                                            
                                                    if(SkipIndex.Contains(i) == false)
                                                            {
                                                            Cell MyCell = new Cell().ByCoordinateSystemOrPointWithOptionalScaling(InputCS[i],InputCell,1,1,1,true,InputCellLibrary);
                                                            MyCellList.Add(MyCell);
                                                                
                                                            }
                                                
                                            }
                                            
                                            return MyCellList;
                                            
                                            };
                DebuggerTrigger           = DebuggerTriggerLevel.Breakpoints;
                InputCS                   = coordinateSystem1;
                SkipIndex                 = SkipList;
                InputCell                 = "SimpleBaluster";
                InputCellLibrary          = '..\..\..\ProgramData\Bentley\OpenBuildings CONNECT Edition\Configuration\Datasets\Dataset_AU\Cell\RailingPostsBalusters.cel';
                GraphLocation             = {1300.667, 95.5, 0.0, 168.45};
            }
        }
    }
    

  • thanks wayne, will give it a go.

    hey i'm working from home and creating a GC model and have found it very slow? it there anything that can be done to speed it up at all?