public override void CreatePart() { Part part = PartUtils.NewFile(this.WorkpiecePath) as Part; this.PartTag = part; SetAttribute(); }
public override void CreatePart() { if (File.Exists(this.WorkpiecePath)) { File.Delete(this.WorkpiecePath); } Part part = PartUtils.NewFile(this.WorkpiecePath) as Part; this.PartTag = part; SetAttribute(); }
/// <summary> /// 创建part档 /// </summary> /// <param name="directoryPath">文件夹地址加\\</param> /// <returns></returns> public virtual bool CreatePart(string directoryPath) { this.WorkpieceDirectoryPath = directoryPath; this.WorkpiecePath = directoryPath + this.AssembleName + ".prt"; if (File.Exists(this.WorkpiecePath)) { File.Delete(this.WorkpiecePath); } try { Part part = PartUtils.NewFile(this.WorkpiecePath) as Part; this.PartTag = part; SetAttribute(part); return(true); } catch (NXException ex) { ClassItem.WriteLogFile("创建" + this.AssembleName + "失败" + ex.Message); return(false); } }