'CENTROID

The CENTROID command lets you calculate the accumulated area and overall centroid coordinates of close polylines, ellipses and circles from the drawing in a way of successive pickups. It provides three modes of centroid/area calculation; namely, they are:

Entity Mode     Calculate the centroid and area of a single entity only. This is the initial default mode. The total centroid and area will be reset by the next single entity pickup. This mode is reset by the sub-command option "E".

Add Mode     Add the area of the next single entity pickup to the total area. The overall centroid is also calculated. This mode is entered by the sub-command option "A".

Subtract Mode     Subtract the area of the next single entity pickup from the total area. The overall centroid is also calculated. This mode is entered by the sub-command option "S".

Once the CENTROID command is entered, it will prompt

Centroid -- Add/Subtract/<Entity>:

asking you to pick up the entity for the area and centroid calculation. Valid entities are polylines, circles and close ellipses. If the polyline is not closed, it will be taken as a close polyline made by adding an additional line joining its start point and end point. You may enter the sub-command option "A" and "S" to switch to the Add mode and Subtract mode, respectively. CENTROID will change the prompt to

Centroid -- Entity/Subtract/<Add Mode>:

and

Centroid -- Entity/Add/<Subtract Mode>:

respectively.

Once a valid object is picked up, CENTROID will calculate the total area and overall centroid result and report them in the command area in the form as

Area V0= xxx.xxx, Centroid P0= xxxx.xxx

and continue the prompt again, until you press space bar or <Ctrl/C> to terminate it.

As the area and centroid report message implies, the resulted area and centroid are stored in system register V0 and P0, respectively. This would help you in successive operations that may require these two values.

Other type of area/centroid calculation:

For complicated area formation, use BPOLY command to obtain the total area and centroid information.

Special Notes:

The CENTROID command is an external command provided by the TCL program file "CENTROID.TCL" or "CENTROID.TCA". Either file must be present in the COMMANDS sub-directory where the TwinCAD resides. If you can not issue CENTROID command, you may solve the problem by copying the "CENTROID.TCL" to the COMMANDS sub-directory.

goback.gif (1545 bytes)