private void layerBox_SelectedIndexChanged(object sender, EventArgs e) { //Get the newly selected layer and update the display accordingly fileLayer = data.Layer(layerBox.SelectedIndex); frozenBox.Text = fileLayer.Frozen.ToString(); inUseBox.Text = fileLayer.InUse.ToString(); LayerDBox.Text = fileLayer.LayerDescription; LayerNameBox.Text = fileLayer.LayerName.ToString(); LayerNumberBox.Text = fileLayer.LayerNumber.ToString(); LayerOnBox.Text = fileLayer.LayerOn.ToString(); LockBox.Text = fileLayer.Locked.ToString(); PlotBox.Text = fileLayer.Plottable.ToString(); if (fileLayer.LayerOn == true) { OnRadioButton.Checked = true; } else { OffRadioButton.Checked = true; } }
private void loadButton_Click(object sender, EventArgs e) { labelLastErrorDescription.Text = ""; try { LayerGroupBox.Enabled = true; LayoutGroupBox.Enabled = true; //Call QueryFile (This must be done first) data = Accusoft.ImagXpressSdk.ImageX.QueryFile(imagXpress1, filePath); lo.Cad.CadData = data; //Call QueryCadFormat to obtain details about the CAD file data.QueryCadFormat(out fileType, out fileVersion, out layerCount, out layoutCount); //If CadFileOpen has been previously called, it must be closed explicitly if (imageXView1.Image != null) { imageXView1.Image.CadFileClose(); imageXView1.Image.Dispose(); imageXView1.Image = null; } //Setup our display layoutBox.Items.Clear(); layerBox.Items.Clear(); VersionBox.Text = fileVersion.ToString(); TypeBox.Text = fileType.ToString(); CountBox.Text = layoutCount.ToString(); fileLayout = data.Layout(0); HeightBox.Text = fileLayout.Height.ToString(); WidthBox.Text = fileLayout.Width.ToString(); NameBox.Text = fileLayout.Name; UnitBox.Text = fileLayout.Unit.ToString(); for (int i = 0; i < layoutCount; i++) { fileLayout = data.Layout(i); layoutBox.Items.Add(fileLayout.Name); } layoutBox.SelectedIndex = 0; CountBox2.Text = layerCount.ToString(); fileLayer = data.Layer(0); frozenBox.Text = fileLayer.Frozen.ToString(); inUseBox.Text = fileLayer.InUse.ToString(); LayerDBox.Text = fileLayer.LayerDescription; LayerNameBox.Text = fileLayer.LayerName.ToString(); LayerNumberBox.Text = fileLayer.LayerNumber.ToString(); LayerOnBox.Text = fileLayer.LayerOn.ToString(); LockBox.Text = fileLayer.Locked.ToString(); PlotBox.Text = fileLayer.Plottable.ToString(); for (int i = 0; i < layerCount; i++) { fileLayer = data.Layer(i); layerBox.Items.Add(fileLayer.LayerName); } layerBox.SelectedIndex = 0; //Load the CAD file imageXView1.Image = Accusoft.ImagXpressSdk.ImageX.CadFileOpen(imagXpress1, filePath, lo); } catch (Exception ex) { labelLastErrorDescription.Text = ex.Message; } }