www.mxdraw.com
内容索引主面
前一个向上下一个
MxDrawXCustomFunction::Mx_GetGroupForEntity 方法

得到实体所在组

IDL
static bool Mx_GetGroupForEntity(McDbObjectId id, std::vector<CString>& vecGrounName);
参数 
说明 
McDbObjectId id 
实体id 
std::vector<CString>& vecGrounName 
返回组名数组,因为实体可以同时在多个组中 

成功返回TRUE

例如: C#代码

    MxDrawUtility mxUtility = new MxDrawUtility();

     MxDrawPoint getPt;
     MxDrawEntity ent = mxUtility.GetEntity(out getPt, "选择实体");
     if (ent == null)
         return;
     Int64 id = ent.ObjectID;
     ent.Close();
   
     MxDrawResbuf param = new MxDrawResbuf();
     param.AddObjectId(id);

     MxDrawResbuf ret = (MxDrawResbuf)axMxDrawX1.CallEx("Mx_GetGroupForEntity", param);
     if (ret.AtString(0) == "Ok")
     {
         for (int i = 1; i < ret.Count; i++)
         {
             MessageBox.Show(ret.AtString(i));
         }

     }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!