Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
n_mulconray
2112 Views, 6 Replies

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

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? 

6 REPLIES 6
Message 2 of 7
FAIR59
in reply to: n_mulconray

easy:

 

SpatialElementCalculationPoint sPoint;

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

 

Message 3 of 7
Anonymous
in reply to: FAIR59

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

Message 4 of 7
FAIR59
in reply to: Anonymous

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

 

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

 

Message 5 of 7
Anonymous
in reply to: FAIR59

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

 

 

Message 6 of 7
FAIR59
in reply to: Anonymous

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();
Message 7 of 7
Anonymous
in reply to: FAIR59

Thanx for the quick response!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report