I have to admit first that I have made a mistake. Not a big one, but it is still a mistake. This is the typical over-engineering issue, I guess.
So, one of my clients had an issue with the elevation of the cable trays. And matter of fact he was totally right. Because the in-built Plant3D elevations looked like this for my cable trays:
Therefore, none of these were useful.
It is a bit deeper dive into the rabbit-hole: as we all know Plant3D is all about piping. So the straight cable trays are also handled as pipes. They just look like trays in our case of course. Pipes have COP, TOP and BOP values. They are Center of Pipe, Top of Pipe, and Center of Pipe respectively.
So according to my original scripts a 150 mm wide tray had a CoP position somewhere in space and 75 mm below that was the BoP and 75 mm above that was the ToP. Because the tray had a height of 60 mm, none of the above values made any sense.
Hence, I have changed some parts of the straight scripts so Plant3D would assume the theoretical pipe’s center is at the bottom of the straight trays, like this:
Problem solved, right? CoP can be used for the ortho drawings as bottom of the trays.
But this is not totally elegant as CoP means center. Moreover, it messed up the length-calculation procedures, because this way the center of gravity was not at the same “elevation” anymore as the CoP values. Therefore, the calculated lengths were increase a bit, a couple of millimeters only in usual case, but still, it was not precise.
Only after this I have realized that no change was necessary at all to have the correct elevation of cable trays. ToP, CoP, BoP can stay where they are. You just have to edit the Matching Pipe OD in the Spec Editor! You should use the height of your cable trays for the correct result and that is all!
Let's assume you have a cable tray with a width of 150, 200, 300, 450 mm. And 60 mm is the height of all these trays. Then you should enter 60 for ALL sizes to the Matching Pipe OD field.
This way the BoP, CoP and ToP are all okay for all cable trays, all the elevation of cable trays are now correct.
These Matching Pipe OD values are now corrected in all sample catalogs in my Python Cable Tray app. Therefore, everyone using it can simply use the PLANTORTHOANNOTATE command in Plant3D for the cable trays as well to get the proper elevation annotations on the ortho drawings automatically in the same way for pipes.