Hi All,
What's your opinion/s on using hastables for retrieving xdata, so far I've had no issues and it works quite well, it just saves iterating over the table and assigning var's one at a time, I can just dump the resbuf then work on it like an array, just another way to skin the cat I guess.
Here's a sample
private void GetXdata()
{
ResultBuffer rb = new ResultBuffer();
rb = (ResultBuffer)_solid.GetXDataForApplication(Utils.AppName);
if(rb != null)
{
_hasData = true;
Hashtable ht = new Hashtable();
IEnumerator iter = rb.GetEnumerator();
int i = 0; //count for ht
while (iter.MoveNext())
{
TypedValue tv = (TypedValue)iter.Current;
ht.Add(i,tv.Value);
i++;
}
//set the property values
Point3d x = new Point3d();
Point3d y = new Point3d();
Point3d z = new Point3d();
Point3d L = new Point3d();
Point3d R = new Point3d();
L = (Point3d)ht[1];
R = (Point3d)ht[2];
x = (Point3d)ht[3];
y = (Point3d)ht[4];
z = (Point3d)ht[5];
_start = L;
_end = R;
_vecX = new Vector3d(x.X,x.Y,x.Z);
_vecY = new Vector3d(y.X,y.Y,y.Z);
_vecZ = new Vector3d(z.X,z.Y,z.Z);
_sectionType = (string)ht[6];
_sectionName = (string)ht[7];
_itemNo = (string)ht[8];
}
}