Get Origin of a family, how?

Hello Dynos,

How can i get the origin of a family as point? I mean where the refplanes cross.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

element = UnwrapElement(IN[0])

OUT = element.Origin.ToPoint()

This script does not run! because there is no Origin to snoop out.

KR

Andreas

If you mean of an instance in a project, that property is called it’s location.

If you are in a Family Document, you need to query the Refplanes for the Define Origin property.

1 Like


how can i get x.y.z coordinates?

 OUT = element.Location.ToPoint()

Go and take a look in Clockwork Location Node, you can study the python code in there. He build exactly this node.

2 Likes

Thank you i try to reconstruct Element.Location+

i am still struggeling, i want to simplify the node just to get this Point(origin)

# The inputs to this node will be stored as a list in the IN variables.
elem = UnwrapElement(IN[0])


OUT = elem.Location.Point.()

i got some previews but without progress :frowning:

KR

Andreas

haha… …the blind chicken :slight_smile:

elem = UnwrapElement(IN[0])

x = elem.Location.Point.X
y = elem.Location.Point.Y
z = elem.Location.Point.Z

OUT = x,y,z

How could be some list-comprehantions?

KR

Andreas

Hello @Draxl_Andreas
try this, if you want point

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

element = UnwrapElement(IN[0])

loc = element.Location
if isinstance(loc, LocationPoint):
	rvtPoint = loc.Point
	protoPoint = rvtPt.ToPoint()
2 Likes