Some AutoCAD commands (such as TRIM, EXTEND, and FILLET) require users to specify a pick point as well as the entity. To pass such pairs of entity and point data by means of acedCommand(), you must specify the name of the entity first and enclose the pair in the RTLB and RTLE result type codes.
The following sample code fragment creates a circle centered at (5,5) and a line that extends from (1,5) to (8,5); it assumes that the circle and line are created in an empty drawing. It then uses a pick point with the TRIM command to trim the line at the circle's edge. The acdbEntNext() function finds the next entity in the drawing, and the acdbEntLast() function finds the last entity in the drawing.
ads_point p1; ads_name first, last; acedCommand(RTSTR, "Circle", RTSTR, "5,5", RTSTR, "2", 0); acedCommand(RTSTR, "Line", RTSTR, "1,5", RTSTR, "8,5", RTSTR, "", 0); acdbEntNext(NULL, first); // Get circle. acdbEntLast(last); // Get line. // Set pick point. p1[X] = 2.0; p1[Y] = 5.0; p1[Z] = 0.0; acedCommand(RTSTR, "Trim", RTENAME, first, RTSTR, "", RTLB, RTENAME, last, RTPOINT, p1, RTLE, RTSTR, "", 0);