| | |
| | | this.Error($"服务器中未找到图纸文件,路径:{filePath}"); |
| | | return; |
| | | } |
| | | |
| | | double[] massData = SwDMUtil.GetMassProperty(filePath, out string errMsg); |
| | | if (massData == null) |
| | | try |
| | | { |
| | | this.Error($"获取图纸一致性数据失败!{errMsg}"); |
| | | return; |
| | | double[] massData = SwDMUtil.GetMassProperty(filePath, out string errMsg); |
| | | if (massData == null) |
| | | { |
| | | //this.Error($"获取图纸一致性数据失败!{errMsg}"); |
| | | //return; |
| | | throw new Exception(errMsg); |
| | | } |
| | | da.fileName = Path.GetFileName(filePath); |
| | | da.volume = NumberUtil.HandleMass(massData[3]); |
| | | da.surfaceArea = NumberUtil.HandleMass(massData[4]); |
| | | da.mass = NumberUtil.HandleMass(massData[5]); |
| | | } |
| | | da.fileName = Path.GetFileName(filePath); |
| | | da.volume = NumberUtil.HandleMass(massData[3]); |
| | | da.surfaceArea = NumberUtil.HandleMass(massData[4]); |
| | | da.mass = NumberUtil.HandleMass(massData[5]); |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Warn("Get Doc Mass Data Failed.", ex); |
| | | da.fileName = Path.GetFileName(filePath); |
| | | da.volume = 0; |
| | | da.surfaceArea = 0; |
| | | da.mass = 0; |
| | | } |
| | | da.pass = true; |
| | | Result<object> res = Client.PostSyncAction<object>(da, "drawAudit/complete"); |
| | | object obj = res.HandleResult(); |
| | |
| | | |
| | | public void OnSwActiveDocChange(ModelDoc2 oldDoc, ModelDoc2 newDoc, Component2 comp) |
| | | { |
| | | long start = DateTime.Now.Millisecond; |
| | | Logger.Debug("Find Open Doc Start..."); |
| | | string path = newDoc.GetPathName(); |
| | | Uri fileName; |
| | | if (string.IsNullOrEmpty(path)) |
| | |
| | | var d3Path = new Uri(GetRealFilePath(e.d3RelativePath)); |
| | | e.IsOpening = fileName == d2Path || fileName == d3Path; |
| | | } |
| | | Logger.Debug($"Find Open Doc {path} End {DateTime.Now.Millisecond - start}ms."); |
| | | } |
| | | |
| | | public void OnSwActiveDocSaved(ModelDoc2 doc, Component2 comp) |