How to move a familie to a other point? match Openings

Hello,

I want to move element based on a linked modelelement (location point)…

the problem is the element that i want to move has is orign not in the center:


test.dyn (92.0 KB)
is it possible to move it via boundingbox?

my input is the elements and the desired points!

# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *


clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

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

Openings = UnwrapElement(IN[0])
positions = UnwrapElement(IN[1]).ToXyz()

doc = DocumentManager.Instance.CurrentDBDocument

TransactionManager.Instance.EnsureInTransaction(doc)

OUT = Openings.Location.Move(positions)

TransactionManager.Instance.TransactionTaskDone()

is this even possible? i have voids so i can`t extract geometry. but i can make a boundingBox

any ideas

KR

Andreas

or can i work with align? the height value i could also map,but not moving inbewteen the wall

I’d pull the points to be co-planar by matching the Z value the ‘target” to the one of the element to move, and then use that as the new location point.

2 Likes

@JacobSmall ,

How do i set the Z value. Can i filter my elements. can i use this node as GroupByKey may elements?
test.rvt (2.6 MB)
link.rvt (2.5 MB)

In the Revit API context via Python, it’d be something like:

sourcePnt = IN[0]
targetPnt = IN[1]
shiftedTargetPnt = XYZ(targetPnt.X, targetPnt.Y, sourcePnt.Z)

@JacobSmall,

i think have to place the same families as in the linked file

import clr

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

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

sourcePnt = IN[0]
targetPnt = IN[1]

shiftedTargetPnt = XYZ(targetPnt.X, targetPnt.Y, sourcePnt.Z)

OUT = shiftedTargetPnt

it works to get the points… it is not possible to place this hostbased family… so the opinings that are positionated … the families have the centerpoint in the center. The families that i want to place, the origin is on the placing level and the need a host(wall/slap)

The XYZ would need to be converted to a Dynamo point in order to use it in the context of Dynamo.