public static void AddDevAttribute(DevAttrArgs ee) { try { LoadDevAttribute(); DevAttributeCtl.objId = ee.devObjId; DevAttributeCtl.AddDevAttribute(); DevAttributePs.Visible = true; } catch (Exception) { PublicMethod.Instance.Editor.WriteMessage("功能位置属性面板加载失败!"); } }
/// <summary> /// 属性查询 /// </summary> /// <param name="fno">设备fno</param> /// <param name="fid">设备fid</param> /// <returns></returns> public static RetureValueCheck AttributeQuery(long fno, long fid) { try { var value = DevEventHandler.GetDevTables(fno, fid); if (value == null) { return(RetureValueCheck.LoadNoFound); } //这里表示已经找到了该FID+FNO对应的设备 if (value.DevObj != null) { //如果这四张表有一张被删除了,就表示该设备已经被删除 if ((value.ComObj != null && value.ComObj.EntityState == EntityState.Delete) || (value.SelfObj != null && value.SelfObj.EntityState == EntityState.Delete) || (value.ConnectObj != null && value.ConnectObj.EntityState == EntityState.Delete) || (value.GnwzObj != null && value.GnwzObj.EntityState == EntityState.Delete)) { MessageBox.Show("抱歉,您要查找的设备已被删除咯!!!", "CAD警告", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); return(RetureValueCheck.LoadDialogFalied); } ObjectId objId = DBEntityFinder.Instance.GetObjectIdByFid(fid); DevAttrArgs ee = new DevAttrArgs { devObjId = objId }; ViewHelper.AddDevAttribute(ee); return(RetureValueCheck.LoadDialogSuccess); } } catch (Autodesk.AutoCAD.Runtime.Exception ex) { LogManager.Instance.Error(ex.Message); } return(RetureValueCheck.LoadNoFound); }