Generic model adaptive - Adjacent components

Generic model adaptive - Adjacent components

MiguelGT17
Advocate Advocate
1,031 Views
2 Replies
Message 1 of 3

Generic model adaptive - Adjacent components

MiguelGT17
Advocate
Advocate

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)

MiguelGT17_0-1641345584356.png

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:

MiguelGT17_1-1641346297295.png

 

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

0 Likes
Accepted solutions (1)
1,032 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Dear Miguel,

 

Happy New Year to you. That sounds like a tricky problem. I am sorry to say have no advice to offer on this from a programming point of view. In general, the best way to approach a task like this is to determine the best practices and optimal workflow from an end user point of view first, before trying to automate the solution. To do so, please discuss and analyse it with an experienced application engineer, product usage expert, or product support. Once you have got that part sorted out, it is time to step up into the programming environment. I hope this clarifies.

 

Good luck and best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

RPTHOMAS108
Mentor
Mentor
Accepted solution

This problem seems to come up a lot e.g. tunnelling rings etc.

 

I tend to think that instead of one path you can define three parallel i.e. three points define a plane so three points at each profile of the form would define the orientation of the end profiles. A neighbouring profile could therefore match those same three points to marry up two profiles. Points would have to be fixed at same parameters of each circle. You often have these ideas but then you may find a limitation that means they can't be done that way you envisaged. If I were investigating I would explore that in the UI can't say at this stage it is doable.

 

When you created the form you didn't pick both the profiles and the curve i.e. form seems to follow just the profiles. Seems the end profiles are not perpendicular to the tangent of the end of the curve by points and solid is not following the curve.