- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to get code combination properties, but I can't get it, i've made this so far:
public partial class Form1 : Form
{
IRobotCaseServer Loads;
RobotCaseCollection RCC;
private void Form1_Load(object sender, EventArgs e) {
Robot.robApp = new RobotApplication();
Loads = Robot.robApp.Project.Structure.Cases;
RCC = Loads.GetAll();
for (int j = 1; j <= RCC.Count; j++) {
IRobotCase rc = RCC.Get(j);
IRobotCaseAnalizeType AT = rc.AnalizeType;
if (AT == IRobotCaseAnalizeType.I_CAT_COMB || AT == IRobotCaseAnalizeType.I_CAT_COMB_CODE || AT == IRobotCaseAnalizeType.I_CAT_COMB_NONLINEAR) {
//IRobotCaseCombination RComb = RCC.Get(j); //this doesn't work
IRobotCaseCombination RComb = RCC.Get(j) as IRobotCaseCombination; //this doesn't work also
textBox1.Text += rc.Number + " " + rc.Name + "\r\n";
textBox1.Text += RComb.label + "\r\n"; //this doesn't work, loop breaks here
// textBox1.Text += RCC.Get(j).label + "\r\n"; //this doesn't work also
}
}
}
But this code seem to work in excel. I don't understand. Here is the main problem:
RobotCaseCombination RComb = RCC.Get(j);
it won't accept it.
and this line returns null reference:
IRobotCaseCombination RComb = RCC.Get(j) as IRobotCaseCombination;
any idea?
Mirko Jurcevic
My blog: www.engipedia.com
Try my Revit add-ins: Autodesk App Store
Solved! Go to Solution.