CAD entity into the current selection set

The main use of Function:


_DMxDrawX::AddCurrentSelect


The centralized entity into the current selection, described in detail below:


parameter Explanation

LONGLONG lId

Id entity

VARIANT_BOOL isShowGrid

Whether displayed simultaneously grips, the default is TRUE

isUpdateDisplay

Whether to automatically update the display call


js code to achieve the following:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function MouseEvent(dX, dY, lType) {
                     if (lType == 3)
                     {
                         // 鼠标右键按下
                         var filter = mxOcx.NewResbuf();
 
                         // 5020 = RTDXF0,只选择直线实体,设置过滤条件
 
                         //filter.AddStringEx("LINE",5020);
 
                         var ent = mxOcx.FindEntAtPoint(dX, dY, filter);
 
                         var sPopMenu;
                         if (ent != null )
                         {
                             mxOcx.ClearCurrentSelect();
                             mxOcx.AddCurrentSelect(ent.ObjectID, true , true );
 
                             sPopMenu = mxOcx.GetOcxAppPath() + "\MxPopMenuEnt.mnu"
                         }
                         else
                         {
                             sPopMenu = mxOcx.GetOcxAppPath() + "\MxPopMenu.mnu"
                         }
 
 
                         mxOcx.TrackPopupMenu(dX, dY, sPopMenu);
                         // 设置1,表示鼠标事件,不再往下传递.
                         mxOcx.SetEventRet(1);
                         }
                     }

Guess you like

Origin www.cnblogs.com/yzy0224/p/10979228.html