How to Get Parallel Grid Line Points (Tekla Open API)

_config.yml

What is the task at hand?

So I get some phone calls the other day – people complaining. They want changes. Yet again! Why can’t these people make up their damn minds! That means I have to go back to my code – which I hopefully haven’t forgotten, and I have to try and make their changes fit in, with the least amount of trouble.

What did they want this time?

They wanted to dimension bolts not just to one grid line, but to every single one. Ok that’s fine. How am I going to select all parallel gridlines, given an input of just one gridline?

  1. First I need the input Gridline. This is given. We have the input gridline because we’ve asked the user to select a relevant gridline.
  2. We need to get the actual grid, using that grid line.
  3. We need to get all pertinent gridlines using the grid – we want to get only the gridlines that are parallel with our originally selected gridline.
  4. Finally create the dimensions. See previous post for examples.

1. The Input Gridline

  • This has been obtained by selection.

2. Getting the Actual Grid

3. Getting Pertinent Gridlines

Now we extract the relevant points given the above information. This is the final result:

4. Create the dimensions

We’ve got the bolt dimension (previous post). We have some grid line dimensions (see above code). Add the above points to the bolt positions and then create those dimensions as outlined in the previous post. Voila! We are finished!

Written on October 6, 2017