jockathon junior
jockathon junior

Reputation: 27

revit bounding box in familydoc

Can I get a family bounding Box XYZ, Revit lookup mentions something in the active view with the family type, which makes sense as the types vary, however familydoc.family.familytype only has access to family parameters! I need this to or a similar set of values for the 3d max extents of a family within the family doc.

foreach (FamilyType ft in _doc.FamilyManager.Types)
{

    BoundingBoxXYZ bb = ft.boundingBox(); //doesnt exist

    TaskDialog.Show("elem type name:", ft.Name + bb.min + bb.max);

}

Upvotes: 0

Views: 987

Answers (1)

Jeremy Tammik
Jeremy Tammik

Reputation: 8339

Of course you cannot get the geometry of a family type. A family type is an abstract concept, basically just a collection of dimension values. The only concrete object owning geometry is the family instance inserted into a project.

Within the family document, you can determine the bounding box by iterating over all the elements inside the family definition, which might be solids of various kinds, cylinders, extrusions, etc., and summing up all their respective bounding boxes.

For an example of how that can easily be done, take a look at the ExpandToContain method in

http://thebuildingcoder.typepad.com/blog/2013/04/geosnoop-net-boundary-curve-loop-visualisation.html

Upvotes: 2

Related Questions