- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings from South America, I've been struggling quite for a long in automating the placement of generic model adaptive families to follow a path. Let's say the following element represents my adaptive family (this one consists of 4 adaptive points)
So my goal is to place various instances of this family following a path in a way that the faces at the end and beginning of each connection make a perfect plug without overlaps. So far, I've been trying to add an extra adaptive point to the family so whenever I place a new instance its starting face's direction can follow the trend. However, I've not succeeded at all as you can see below:
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
"1)."
#Get the symbol
FamilySymbols=FilteredElementCollector(doc).OfClass(FamilySymbol).ToElements()
symbol=None
for symb in FamilySymbols:
if symb.get_Parameter(BuiltInParameter.SYMBOL_NAME_PARAM).AsString() == "Family1":
symbol=symb
#Create the adaptive family
tr=Transaction(doc,"adaptive")
tr.Start()
AdaptiveFamily=AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(doc,symbol)
#find the adaptive points in the family instance
adaptivePoints=AdaptiveComponentInstanceUtils.GetInstancePointElementRefIds(AdaptiveFamily)
adaptivePtList=[doc.GetElement(x) for x in adaptivePoints]
#move the adaptive component's points to match the position of the placement points
#XYZpositions=[XYZ(0,0,0),XYZ(15,15,0),XYZ(30,40,10),XYZ(70,100,20)]
XYZpositions=[XYZ(30,40,10),XYZ(70,100,20),XYZ(100,130,25),XYZ(140,150,25)]
for adaptPoint,placementPoint in zip(adaptivePtList,XYZpositions):
adaptPoint.Position= placementPoint
tr.Commit()
----------------------------------------------------------------------------------------------------------------
Any suggestions on how to approach this task in order to align those consecutive surfaces by using generic adaptive models?
Regards and thanks in advance,
Miguel G
Solved! Go to Solution.