ObjectARX, AutoCAD. Среда программирования библиотеки C++



         

Обработка Наборов Выбора - часть 2


Следующий код показывает представителю, вызывает к acedSSGet (). Как acutBuildList () запрос иллюстрирует, для “CP” опций многоугольника, и “ПОДГОТОВКА ТЕКСТОВ” (но не для “F”), acedSSGet () автоматически закрывает список точек. Вы не должны формировать список, который определяет конечную точку, идентичную первому.

ads_point pt1, pt2, pt3, pt4;

struct resbuf *pointlist;

ads_name ssname;

pt1[X] = pt1[Y] = pt1[Z] = 0.0;

pt2[X] = pt2[Y] = 5.0; pt2[Z] = 0.0;

// Get the current PICKFIRST set, if there is one;

// otherwise, ask the user for a general entity selection.

acedSSGet(NULL, NULL, NULL, NULL, ssname);

// Get the current PICKFIRST set, if there is one.

acedSSGet("I", NULL, NULL, NULL, ssname);

// Selects the most recently selected objects.

acedSSGet("P", NULL, NULL, NULL, ssname);

// Selects the last entity added to the database.

acedSSGet("L", NULL, NULL, NULL, ssname);

// Selects entity passing through point (5,5).

acedSSGet(NULL, pt2, NULL, NULL, ssname);

// Selects entities inside the window from (0,0) to (5,5).

acedSSGet("W", pt1, pt2, NULL, ssname);

// Selects entities enclosed by the specified polygon.

pt3[X] = 10.0; pt3[Y] = 5.0; pt3[Z] = 0.0;

pt4[X] = 5.0; pt4[Y] = pt4[Z] = 0.0;

pointlist = acutBuildList(RTPOINT, pt1, RTPOINT, pt2,

RTPOINT, pt3, RTPOINT, pt4, 0);

acedSSGet("WP", pointlist, NULL, NULL, ssname);

// Selects entities crossing the box from (0,0) to (5,5).

acedSSGet("C", pt1, pt2, NULL, ssname);

// Selects entities crossing the specified polygon.

acedSSGet("CP", pointlist, NULL, NULL, ssname);

acutRelRb(pointlist);

// Selects the entities crossed by the specified fence.

pt4[Y] = 15.0; pt4[Z] = 0.0;

pointlist = acutBuildList(RTPOINT, pt1, RTPOINT, pt2,

RTPOINT, pt3, RTPOINT, pt4, 0);

acedSSGet("F", pointlist, NULL, NULL, ssname);

acutRelRb(pointlist);




Содержание  Назад  Вперед