How to Write a Program to Import IGES / Para-solid File Format
-
I have Given the Program what i have written to import an File Format, But it shows me an error (OpenDialodFile and FCAD Image) are not found.... I have pasted my program below and i have bolded................. #region Open private void openToolStripMenuItem_Click(object sender, EventArgs e) { string filename; try { filename = getOpenFilename(Program.settings.workingDirectory); } catch { filename = ""; } if (filename != "" && filename != null) { /* Load the file. */ XmlDocument doc = new XmlDocument(); doc.Load(filename); /* create prefix<->namespace mappings (if any) */ XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable); /* Query the document */ if (doc.SelectNodes("/grammarRule", nsMgr).Count > 0) { grammarRule rule = grammarRule.openRuleFromXml(filename); grammarDisplays.Add(new grammarRuleDisplay(rule, Path.GetFileName(filename))); grammarDisplays[grammarChildCount].Show(); } else if (doc.SelectNodes("/ruleSet", nsMgr).Count > 0) { ruleSet rs = ruleSet.openRuleSetFromXml(filename, Program.settings.defaultGenSteps); ruleSetDisplays.Add(new ruleSetDisplay(rs, Path.GetFileName(filename))); ruleSetDisplays[ruleSetChildCount].Show(); } else if (doc.SelectNodes("/designGraph", nsMgr).Count > 0) { designGraph graph = designGraph.openGraphFromXml(filename); addAndShowGraphDisplay(graph, Path.GetFileName(filename)); } else if (doc.SelectNodes("/candidate", nsMgr).Count > 0) { string tempString = ""; candidate c = candidate.openCandidateFromXml(filename); SearchIO.output("The candidate found in " + filename, 0); if (c.performanceParams.Count > 0) { tempString = "has the following performance parameters"; foreach (double a in c.performanceParams) tempString += ": " + a.ToString(); SearchIO.output(tempString, 0);
-
I have Given the Program what i have written to import an File Format, But it shows me an error (OpenDialodFile and FCAD Image) are not found.... I have pasted my program below and i have bolded................. #region Open private void openToolStripMenuItem_Click(object sender, EventArgs e) { string filename; try { filename = getOpenFilename(Program.settings.workingDirectory); } catch { filename = ""; } if (filename != "" && filename != null) { /* Load the file. */ XmlDocument doc = new XmlDocument(); doc.Load(filename); /* create prefix<->namespace mappings (if any) */ XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable); /* Query the document */ if (doc.SelectNodes("/grammarRule", nsMgr).Count > 0) { grammarRule rule = grammarRule.openRuleFromXml(filename); grammarDisplays.Add(new grammarRuleDisplay(rule, Path.GetFileName(filename))); grammarDisplays[grammarChildCount].Show(); } else if (doc.SelectNodes("/ruleSet", nsMgr).Count > 0) { ruleSet rs = ruleSet.openRuleSetFromXml(filename, Program.settings.defaultGenSteps); ruleSetDisplays.Add(new ruleSetDisplay(rs, Path.GetFileName(filename))); ruleSetDisplays[ruleSetChildCount].Show(); } else if (doc.SelectNodes("/designGraph", nsMgr).Count > 0) { designGraph graph = designGraph.openGraphFromXml(filename); addAndShowGraphDisplay(graph, Path.GetFileName(filename)); } else if (doc.SelectNodes("/candidate", nsMgr).Count > 0) { string tempString = ""; candidate c = candidate.openCandidateFromXml(filename); SearchIO.output("The candidate found in " + filename, 0); if (c.performanceParams.Count > 0) { tempString = "has the following performance parameters"; foreach (double a in c.performanceParams) tempString += ": " + a.ToString(); SearchIO.output(tempString, 0);
-
I have Given the Program what i have written to import an File Format, But it shows me an error (OpenDialodFile and FCAD Image) are not found.... I have pasted my program below and i have bolded................. #region Open private void openToolStripMenuItem_Click(object sender, EventArgs e) { string filename; try { filename = getOpenFilename(Program.settings.workingDirectory); } catch { filename = ""; } if (filename != "" && filename != null) { /* Load the file. */ XmlDocument doc = new XmlDocument(); doc.Load(filename); /* create prefix<->namespace mappings (if any) */ XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable); /* Query the document */ if (doc.SelectNodes("/grammarRule", nsMgr).Count > 0) { grammarRule rule = grammarRule.openRuleFromXml(filename); grammarDisplays.Add(new grammarRuleDisplay(rule, Path.GetFileName(filename))); grammarDisplays[grammarChildCount].Show(); } else if (doc.SelectNodes("/ruleSet", nsMgr).Count > 0) { ruleSet rs = ruleSet.openRuleSetFromXml(filename, Program.settings.defaultGenSteps); ruleSetDisplays.Add(new ruleSetDisplay(rs, Path.GetFileName(filename))); ruleSetDisplays[ruleSetChildCount].Show(); } else if (doc.SelectNodes("/designGraph", nsMgr).Count > 0) { designGraph graph = designGraph.openGraphFromXml(filename); addAndShowGraphDisplay(graph, Path.GetFileName(filename)); } else if (doc.SelectNodes("/candidate", nsMgr).Count > 0) { string tempString = ""; candidate c = candidate.openCandidateFromXml(filename); SearchIO.output("The candidate found in " + filename, 0); if (c.performanceParams.Count > 0) { tempString = "has the following performance parameters"; foreach (double a in c.performanceParams) tempString += ": " + a.ToString(); SearchIO.output(tempString, 0);
How many times are you going to ask this question and then ignore the questions you get back? Do NOT repost this question again.
A guide to posting questions on CodeProject
How to debug small programs
Dave Kreskowiak