Hello,
I am creating new component classes for AutoPLANT Plant Design V8i. The first few are variations on a theme; trunnion ball valves. Trunnion ball valves have a drain-port on the bottom of the valve, and in the case of DBB, DIB-1 and DIB-2 configurations are often piped with a lockable drain valve from this port.
Thus far, I have created the class (modified the class.ini, methods.ini, speckey.ini and ports.ini), created the input form to allow user to pick a drain option (straight-drain or elbowed-drain), fluid type (if required), and enter length parameters and such if they are permitted by the system/component/spec. I have created the necessary methods in the Valve.ebs, Orient.ebs and Ports.ebs. The graphic which is being generated is exactly what I want.
The problem I have trying to resolve is the newly created Port3 (the drain-line off the bottom of the main valve). When the component-shape is like a tee (drain valve is in the same plane [perpendicular vector] with the main valve stem) the port rotates about the main valve axis without problem as expected from the Orient.ebs. If, through the input form produced, the user opts to have the drain valve perpendicular to the main valve stem, an at_Component_addOrientationParam is added to the component via the Orient.ebs. In this case, when the user inserts the valve into a model the component requests the insertion point, base direction, stem orientation, and drain orientation. When the user picks a new drain orientation, the Valve.ebs fires to regenerate the graphic as expected. At the end of the draw method, Port3.Loc and Port3.Dir are being updated to reflect the direction the user has selected. Sometimes.
If the valve is attached to another component, the at_Component_putPoint/at_Component_putVector at the end of my draw method updates Port3 as expected. If the valve is simply put in space the at_Component_putPoint and at_Component_putVector SAY that they succeed, but the port is not updated as is evident when I try to attach another component to the drain. I have walked through the Joint.ebs methods when they run and cannot see that they do anything special, but the result is nonetheless different. Because Ports.ebs and Orient.ebs are run in the background - I suspect they are handled differently depending on whether connecting to another object or not as they are only run once (after input and before insertion)
Any direction or advise on how to resolve this will be greatly appreciated.
Thanks in advance,
Phil