Need Help: Line Chain from Point List

Hi everybody,

Just to add some background, this is my first experience with Generative Components, so I am still trying to figure out the ins and outs of the program. I do have basic programming experience in C++ and Java, so I can sort of understand the scripting language.

I should also point out that I am currently using Generative Components V8i (SELECTseries 6), so it is an older version.

Basically, I am trying to model a sign structure that has multiple variations, so I am trying to use GC to lessen the amount of time spent creating separate models. So far, I have managed to figure out how to create points and draw lines by using simple tutorials and commands.

I ran into trouble when I needed to find a way to create a zigzag effect between points (they are already in a list, in the order they need to connect). I have tried to use the ByChaining, ByLacing, and Polyline ByVertices methods, but nothing has resulted in a success so far. I am still having trouble understanding the scripting, namely the difference between a script transaction and a model change transaction, as well as using functions.

I have attached a screen capture of the code that I am currently having problems with. On it, I have the various methods I have tried to use along with my method to create the point list. The transaction to create the point list is a script transaction btw.

If anyone could offer a solution and/or explain to me the difference/how-to-use the scripting vs model change transactions, it would be much appreciated. I will also attach a screen capture of what I have so far modeling wise.

Thanks,

Shannon

Parents
  • HI Shannon,

    I didn't manage to replicate you script, maybe you could save the script out of the editor and so we can see the whole script.

    My approach to creating a zigzag poly between points would be to use 2 lists one for the top and one for the bottom.

    I then wrote a little function that would allow me to shift the top startpoint along one point and I then did the same on the bottom but setup a skip point to give that "truss" look.

    maybe you will find something useful in that. (unfortunately I am using OpenBuildings update 5 so I can't give you the DGN)

    The function should work in either version. just setup a point and change it method to byfunction and past in the function.

    If you are farmilary with C programing i am sure you will be able to modify to suit from there.

    function (Point BottomPts, Point TopPts, int TopShift, int BottomSkip)
    {


    Point MyList = {};
    int b = 0;

    for (int i = 0; i < BottomPts.Count; ++i)
    {
    Point MyPt = {};
    int t = i + TopShift;

    MyPt = new Point().ByCoordinateList(baseCS,BottomPts[i].XYZ);
    MyList.Add(MyPt);

    if (t < TopPts.Count)
    {
    MyPt = new Point().ByCoordinateList(baseCS,TopPts[t].XYZ);
    MyList.Add(MyPt);
    }
    i = i + BottomSkip;

    }
    return MyList;


    }

    I also recorded a quick screen grab of it in action.

    Thanks

    Wayne

  • Hi Wayne, 

    Thank you so much, your response was very helpful! 

    It took a while for me to implement it into my program, but after a while it finally worked and the result is perfect. 

    Again, thanks, 

    Shannon

Reply Children
No Data