Hello,
How can i set my Boundingbox to my Elements(red) instead of the origin coordinate system.
or alternativly, can i rotate it corresponding to the angle ? is there a workflow…
KR
Andreas
How can i set my Boundingbox to my Elements(red) instead of the origin coordinate system.
or alternativly, can i rotate it corresponding to the angle ? is there a workflow…
Get the bounding box of the family symbol which should be at the origin, convert that to a cuboid and transform it by the family instances coordinate system.
import sys
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
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
#Preparing input from dynamo to revit
elements = UnwrapElement(IN[0])
output = []
for i in elements:
output.append(i.Symbol)
OUT = output
KR
Andreas
hello, I think Mr. Jacob means getting the x and y from the wall at the local point where your family instance is located
then make the transformation
Cordially
christian.stan
to get host can be usefull… but it is still not working, and “symbol” does not work for the task…
KR
Andreas
I tried via another track, I attach script if interested (Should not be super optimized yet)
30 Avril Forum anglais rep bb.dyn (53.0 KB)
Cordially
christian.stan
You need to build the coordinate system. Some guidance:
FamilyInstance.FacingOrientation will give you the Y vector of the instance for the coordinate system.
The Z vector is vertical in this case so we can use Vector.ZAxis for the Z axis of the coordinate system.
The X axis of the coordinate system is the cross of the Y and Z.
The coordinate system’s location is the location of the family instance.
Hi,
I did something similar but then with walls.
The idea should be the same for family instances.
Edit:
Finally I ended up here to fix the problem: Youtube
That seems to be more effiecient
Kind Regards,
Martin