Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Get the XYZ point of the Room Awareness point in a Family Document

n_mulconray
Advocate

Get the XYZ point of the Room Awareness point in a Family Document

n_mulconray
Advocate
Advocate

I can easily retrieve the builtin parameter BuiltInParameter.ROOM_CALCULATION_POINT, however has anyone managed to retrieve the coordinate point for the actual point inside the famdoc that you can move around so that families are discoverable within rooms? If this is not possible is there any workaround? Does this affect the extent of the bounding box for the loadable model family? 

0 Likes
Reply
Accepted solutions (1)
2,152 Views
6 Replies
Replies (6)

FAIR59
Advisor
Advisor
Accepted solution

easy:

 

SpatialElementCalculationPoint sPoint;

sPoint.Position = new XYZ(2, 2, 2);

 

Anonymous
Not applicable

Hi This is great just what I have been looking for...

Just one problem, I can't get the SpatialElementCalculationPoint reference in the family editor, do you know what I might be doing wrong?

many thanx

0 Likes

FAIR59
Advisor
Advisor

You have to check the Family Parameter "Room Calculation Point" , to obtain the SpatialElementCalculationPoint.

 

FamilyDocument.OwnerFamily.get_Parameter(BuiltInParameter.ROOM_CALCULATION_POINT).Set(1);

 

Anonymous
Not applicable

Thanx again I had that point covered already.

What I am not getting is the  sPoint, I don't have a lot of experience with the family editor side of the revit api. So the following i'm getting an error stating that the sPoint is not set to anything...

SpatialElementCalculationPoint sPoint;
sPoint.Position = new XYZ(2, 2, 2);

 

Is the sPoint derived from the FamDoc, OwnerFamily, getGeometry a builtInParameter that is cast or parameter definition? Just lost here and some background might help me from asking too many questions in the future. Plus I have googled quite a bit and found very few references to the SpatialElementCalculationPoint

 

 

0 Likes

FAIR59
Advisor
Advisor

the class definition for SpatialElementCalculationPoint is:

public class SpatialElementCalculationPoint : SpatialElementCalculationLocation

 

the class definition for SpatialElementCalculationLocation is:

public class SpatialElementCalculationLocation : Element

 

so the SpatialElementCalculationPoint is an Element and can be obtained by a FilteredElementCollector.

 

            SpatialElementCalculationPoint sPoint = new FilteredElementCollector(doc)
            .OfClass(typeof(SpatialElementCalculationPoint))
.Cast<SpatialElementCalculationPoint>()
.ToList().FirstOrDefault();

Anonymous
Not applicable

Thanx for the quick response!

0 Likes