Before preparing a symbol, study the symbol in terms of the dimensional parameters required to uniquely define the symbol, the ports or connect points required for the symbol, how the geometry of the symbol will be represented graphically, the origin of the symbol, the orientation of the symbol, and so forth.
Determine the various aspects of the symbol to be drawn such as Physical, Insulation, Maintenance, and so forth. This means that you should decide whether to simply draw the symbol’s physical representation only or whether to add the insulation graphics, maintenance space required, and so forth.
Referring to the example of a ball valve, Physical and Insulation aspects of the valve will be drawn.
The valve is drawn with a circular flange on the left hand side as a cylinder; next a cylinder, a sphere, a cylinder at the center, and another circular flange at the right hand side. This means three outputs are drawn to represent the Physical Aspect of the valve (Port1, ValveBody, and Port2). Please note that even though this example appears to represent a flanged ball valve, the code is generic enough to accommodate different end preparations such as welded, flanged, threaded, and so forth. You can define a more complex geometric representation of the symbol as needed.
As a symmetrical valve, the face to face dimension is required to draw the valve. The dimensions required to draw the flange are obtained from the standard geometric data bulkloaded in the Smart 3D project’s catalog database. This data is available in the AllCommon.xls for the various end preparations (Bolted, Male, or Female). The radius of the sphere is assumed to be a factor of the known dimensions. Hence the input parameters required those for representing the Physical Aspect (Face to Face dimension).
The symbol is drawn with the origin (0, 0, 0) at the center of the valve. The left-hand side port is drawn along –X direction and the right-hand side port is drawn along +X direction.