private void loadFile_FormMoBanVeDatabase(String idHoChieu) { this.hoChieuChinh = BS_HoChieu.HoChieu(idHoChieu); this.banVeChinh = BS_BanVe.BanVe(this.hoChieuChinh.MaBanVe); List <LoKhoan> danhSachLoKhoan = BS_LoKhoan.DanhSachLoKhoan(idHoChieu); List <Circle> danhSachCircle = new List <Circle>(); mgCircles = new ManageCircle(); //dựng bản vẽ mới //this.banVeChinh.HienKhoangCach = false; this.Text = "Bản vẽ: [" + this.banVeChinh.TenBanVe + "]"; Lcad.DrwLoad(hDrw, BS_Template.ChonTemplate(this.banVeChinh.Template).DuongDan, this.Handle, hWnd); layerLoMin = Lcad.DrwAddLayer(hDrw, "LoMin", "cyan", 0, Lcad.LC_LWEIGHT_DEFAULT); layerLuoiKichThuoc = Lcad.DrwAddLayer(hDrw, "LuoiKichThuoc", "foreground", 0, Lcad.LC_LWEIGHT_DEFAULT); int hBlockModel = Lcad.PropGetHandle(hDrw, Lcad.LC_PROP_DRW_BLOCK_MODEL); foreach (LoKhoan value in danhSachLoKhoan) { int hEntCircle = Lcad.BlockAddCircle(hBlockModel, value.ToaDoX, value.ToaDoY, value.BanKinh, false); Lcad.PropPutInt(hEntCircle, Lcad.LC_PROP_ENT_ID, int.Parse(value.MaLoKhoan)); Lcad.PropPutInt(hEntCircle, Lcad.LC_PROP_ENT_KEY, keyCircle); Lcad.PropPutStr(hEntCircle, Lcad.LC_PROP_ENT_LAYER, "LoMin"); danhSachCircle.Add(new Circle(hEntCircle)); } mgCircles.AddListCircle(danhSachCircle); if (banVeChinh.HienKhoangCach) { Lcad.LayerClear(layerLuoiKichThuoc, hBlockModel); DungLuoiKichThuoc(); } //vẽ lại hình Lcad.DrwRegenViews(hDrw, 0); Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0); BS_LiteCAD.ShowNotifyAutoHide(elementHost1, this.banVeChinh.TenBanVe + " - đã mở"); //mở form dựng lưới lỗ khoan if (mgCircles.GetListCircles().Count == 0) { FormXayDungLoKhoan fm = new FormXayDungLoKhoan(); fm.MyGetData = new FormXayDungLoKhoan.GetData(loadFile_FormXayDungLoKhoan); fm.Show(); } }
private void loadFile_FormBanVeMoi(String idHoChieu) { this.hoChieuChinh = BS_HoChieu.HoChieu(idHoChieu); this.banVeChinh = BS_BanVe.BanVe(this.hoChieuChinh.MaBanVe); mgCircles = new ManageCircle(); //dựng bản vẽ mới this.Text = "Hộ chiếu: [" + this.hoChieuChinh.TenHoChieu + "]"; Lcad.DrwLoad(hDrw, BS_Template.ChonTemplate(this.banVeChinh.Template).DuongDan, this.Handle, hWnd); layerLoMin = Lcad.DrwAddLayer(hDrw, "LoMin", "cyan", 0, Lcad.LC_LWEIGHT_DEFAULT); layerLuoiKichThuoc = Lcad.DrwAddLayer(hDrw, "LuoiKichThuoc", "foreground", 0, Lcad.LC_LWEIGHT_DEFAULT); //vẽ lại hình Lcad.DrwRegenViews(hDrw, 0); Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0); //mở form dựng lưới lỗ khoan if (mgCircles.GetListCircles().Count == 0) { FormXayDungLoKhoan fm = new FormXayDungLoKhoan(); fm.MyGetData = new FormXayDungLoKhoan.GetData(loadFile_FormXayDungLoKhoan); fm.Show(); } }
private void loadFile_FormMoBanVeDatabase(String idHoChieu) { this.hoChieuChinh = BS_HoChieu.HoChieu(idHoChieu); this.banVeChinh = BS_BanVe.BanVe(this.hoChieuChinh.MaBanVe); List<LoKhoan> danhSachLoKhoan = BS_LoKhoan.DanhSachLoKhoan(idHoChieu); List<Circle> danhSachCircle = new List<Circle>(); mgCircles = new ManageCircle(); //dựng bản vẽ mới //this.banVeChinh.HienKhoangCach = false; this.Text = "Bản vẽ: [" + this.banVeChinh.TenBanVe + "]"; Lcad.DrwLoad(hDrw, BS_Template.ChonTemplate(this.banVeChinh.Template).DuongDan, this.Handle, hWnd); layerLoMin = Lcad.DrwAddLayer(hDrw, "LoMin", "cyan", 0, Lcad.LC_LWEIGHT_DEFAULT); layerLuoiKichThuoc = Lcad.DrwAddLayer(hDrw, "LuoiKichThuoc", "foreground", 0, Lcad.LC_LWEIGHT_DEFAULT); int hBlockModel = Lcad.PropGetHandle(hDrw, Lcad.LC_PROP_DRW_BLOCK_MODEL); foreach (LoKhoan value in danhSachLoKhoan) { int hEntCircle = Lcad.BlockAddCircle(hBlockModel, value.ToaDoX, value.ToaDoY, value.BanKinh, false); Lcad.PropPutInt(hEntCircle, Lcad.LC_PROP_ENT_ID, int.Parse(value.MaLoKhoan)); Lcad.PropPutInt(hEntCircle, Lcad.LC_PROP_ENT_KEY, keyCircle); Lcad.PropPutStr(hEntCircle, Lcad.LC_PROP_ENT_LAYER, "LoMin"); danhSachCircle.Add(new Circle(hEntCircle)); } mgCircles.AddListCircle(danhSachCircle); if (banVeChinh.HienKhoangCach) { Lcad.LayerClear(layerLuoiKichThuoc, hBlockModel); DungLuoiKichThuoc(); } //vẽ lại hình Lcad.DrwRegenViews(hDrw, 0); Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0); BS_LiteCAD.ShowNotifyAutoHide(elementHost1, this.banVeChinh.TenBanVe + " - đã mở"); //mở form dựng lưới lỗ khoan if(mgCircles.GetListCircles().Count == 0) { FormXayDungLoKhoan fm = new FormXayDungLoKhoan(); fm.MyGetData = new FormXayDungLoKhoan.GetData(loadFile_FormXayDungLoKhoan); fm.Show(); } }