P
Phuff
I'm hoping someone has some suggestions. I'm programming something
which interacts with Autodesk Inventor release 11 SP2. I want to for
loop through a collection and get data fro each item. Although the
collection specifies [int index] it does not seem to be compatible with
..Net's version of int.
for (inti = 0; i < var.DrawingViews.Count; i++)
{
MessageBox.Show(var.DrawingViews.Name);
}
This always returns an invalid parameter exception.
However, this works:
for (inti = 0; i < var.DrawingViews.Count; i++)
{
MessageBox.Show(var.DrawingViews[8].Name);
}
As you can see if you hard code the number it gets cast or converted,
COM side, to whatever data type Inventor wants. I've tried everything.
Int16-64, short-long, and all the unsigned variants. None of them
work. I am aware that I can enumerate through the collection with
foreach and it does in fact work. However, there will undoubtedly be a
point where I will want a dynamic index variable.
Any suggestions? Any type of Win32 type I should marshal in and cast
this int as?
Thanks!
which interacts with Autodesk Inventor release 11 SP2. I want to for
loop through a collection and get data fro each item. Although the
collection specifies [int index] it does not seem to be compatible with
..Net's version of int.
for (inti = 0; i < var.DrawingViews.Count; i++)
{
MessageBox.Show(var.DrawingViews.Name);
}
This always returns an invalid parameter exception.
However, this works:
for (inti = 0; i < var.DrawingViews.Count; i++)
{
MessageBox.Show(var.DrawingViews[8].Name);
}
As you can see if you hard code the number it gets cast or converted,
COM side, to whatever data type Inventor wants. I've tried everything.
Int16-64, short-long, and all the unsigned variants. None of them
work. I am aware that I can enumerate through the collection with
foreach and it does in fact work. However, there will undoubtedly be a
point where I will want a dynamic index variable.
Any suggestions? Any type of Win32 type I should marshal in and cast
this int as?
Thanks!