larjia
2007-03-08, 01:39 AM
Hi all,
I tried to run the "CreateDimensions" samples in the Revit API SDK, but failed. After debugging the sample, I found the problem seems from the AddDimension() method.
1) I don't know what's the meaning of the ReferenceArray as below:
// get reference
ReferenceArray referenceArray = new ReferenceArray();
What is reference here? Do we need to do this only for creating a new dimension?
2) Why the GeoObjectArray.get_item(int) methods returns an object of type Autodesk.Revit.Geometry.Solid but not Autodesk.Revit.Geometry.GeometryObject?
Autodesk.Revit.Geometry.Element element = wallTemp.get_Geometry(options);
GeometryObjectArray geoObjectArray = element.Objects;
// enum the geometry element
for (int j = 0; j < geoObjectArray.Size; j++)
{
GeometryObject geoObject = geoObjectArray.get_Item(j);
// Here the geoObject is of type Autodesk.Revit.Geometry.Solid !!!
Curve curve = geoObject as Curve;
// curve will equals to null !!!
.....
}
Any suggestions? Thanks in advance....
I tried to run the "CreateDimensions" samples in the Revit API SDK, but failed. After debugging the sample, I found the problem seems from the AddDimension() method.
1) I don't know what's the meaning of the ReferenceArray as below:
// get reference
ReferenceArray referenceArray = new ReferenceArray();
What is reference here? Do we need to do this only for creating a new dimension?
2) Why the GeoObjectArray.get_item(int) methods returns an object of type Autodesk.Revit.Geometry.Solid but not Autodesk.Revit.Geometry.GeometryObject?
Autodesk.Revit.Geometry.Element element = wallTemp.get_Geometry(options);
GeometryObjectArray geoObjectArray = element.Objects;
// enum the geometry element
for (int j = 0; j < geoObjectArray.Size; j++)
{
GeometryObject geoObject = geoObjectArray.get_Item(j);
// Here the geoObject is of type Autodesk.Revit.Geometry.Solid !!!
Curve curve = geoObject as Curve;
// curve will equals to null !!!
.....
}
Any suggestions? Thanks in advance....