TBC Macros and Extensions

 View Only
Expand all | Collapse all

need a TBC macro hint

  • 1.  need a TBC macro hint

    Posted 12-15-2020 17:55
    Edited by Ronny Schneider 12-15-2020 22:43

    I've run into an issue with the TBC macros now a few times. Some Geometry functions expect a declared array as input or output, but the way I try to do it I get a "Strongbox" error.


    But defining it those three ways doesn't work.

    I assume that it is the array that triggers the error and not the v1,v2 or v3.

    How would I have to declare the array that it would be accepted?

     

     

    Thanks in advance.



    ------------------------------
    Ronny Schneider
    ------------------------------


  • 2.  RE: need a TBC macro hint

    Posted 12-17-2020 13:49

    Python doesn't have "out" parameters so don't include that argument in the call. "Out" values will be returned from the function call (along with updated "ref" values)



    ------------------------------
    Gary Lantaff
    ------------------------------



  • 3.  RE: need a TBC macro hint

    Posted 12-17-2020 15:42

    This bit of code seems to work....

    pts = Array[Point3D]([Point3D.Undefined, Point3D.Undefined])
    p0 = Point3D(100,100,100)
    p1 = Point3D(150,100,110)
    p2 = Point3D(120,130,130)
    rtn = Triangle3D.IntersectElevationNoTolerance(p0, p1, p2, 105.0, pts)
    if rtn[4] == 2:
            # two intersections found
            # line end points are contained in the "pts" array



    ------------------------------
    Gary Lantaff
    ------------------------------



  • 4.  RE: need a TBC macro hint

    Posted 12-17-2020 16:53

    Thanks Garry, I had found it myself after some time and created a new post but must have gotten sidetracked and didn't actually post it.

    After lots and lots of iterations I finally found the issue. The Object browser led me completely into the wrong direction.
    The countX, the actual result, needs to be outside the brackets. And it isn't just an integer as shown above but an array that again includes some of the input values.

    The following did finally work.




    ------------------------------
    Ronny Schneider
    ------------------------------