Offset command would work as follows:
Command : O (or OS)
1. PythonCAD to ask user to select Entity to be offsetted.
2. User select one of the available Entity on screen. (Single object can only be selected.)
3. PythonCAD to ask user to input the distance of offset (OSD). (Default the last value if user just enter)
4. PythonCAD to ask user to select the side on which Entity needs to offset.
5. PythonCAD creates a new entity parallel to the original entity on the side selected and at the distance mentioned.
6. All properties of parent entity are retained by the newly created entity.
- If a segment is offsetted a parallel segment at OSD distance is created on the selected side.
- If a circle/polygon is offsetted a concentric circle is created at the OSD distance on outside or inside based on the side selected (Error if OSD < radius and side is inside the circle).
- If a polyline is offsetted all segments of polylines get offsetted as per the segment offset rule but they get trimmed or extended based on which side it is offsetted.