Hi,
sorry for repeating the same subject again, but none of the solution in the forum or other place gave me a solution so far. I want to align an annotation symbol with a reference plane in a family document. Getting the reference of the reference plane is easy. But so far I couldn't find a way to get a reference of any valid object or geometry of the annotation family.
Found solutions so far:
Options options = new Options();
options.IncludeNonVisibleObjects = true;
options.ComputeReferences = true;
options.DetailLevel = ViewDetailLevel.Undefined;
GeometryElement geoElem = fi.get_Geometry(options);
geoElem returns me null.
If I do:
Options options = new Options();
options.IncludeNonVisibleObjects = true;
//options.ComputeReferences = true; <--- is not allowed and throws error.
//options.View = v;
GeometryElement geoElem = fi.GetOriginalGeometry(options);
I get geometry and I can loop through all the lines and solids, but the geometry object have no reference (reference is null).
What does give me a reference is:
Reference r = Reference.ParseFromStableRepresentation(famdoc, fi.UniqueId);
but I can't use it, as it is not a valid reference for:
Dimension d1 = famdoc.FamilyCreate.NewAlignment(v, r, p.GetReference());
Maybe someone has an idea and could help me out, or the API team could get a method included to make that a bit easier as requested in this post:
2 years ago.
regards
Christian
PS:
If I change the code to:
Options geomOptions = f.Document.Application.Create.NewGeometryOptions();
geomOptions.IncludeNonVisibleObjects = true;
geomOptions.ComputeReferences = true;
//options.View = v;
geomOptions.DetailLevel = ViewDetailLevel.Undefined;
GeometryElement geoElem = f.Symbol.get_Geometry(geomOptions);
geoElem still returns null. (just thought this might work as found here: http://forums.autodesk.com/t5/revit-api/how-to-get-the-reference-of-a-planarface/m-p/6489839#M17855)