Move adaptive points on already deployed adaptive components

python
dynamo

#1

Move adaptive points

This question is asked in the developer section. I found that code snippet on ProvingGround but it appears to be for PyRevit. Seems easy enough but I can’t figure out the data type. The error says it’s expecting familyinstance. How do i turn an element into familyinstance?
image
image
So the key is to NOT to re-deploy adaptive component but moving the existing.


#2

Hi @visualizor,

You were almost there:


#3

I vaguely remember this unwrap thing. Just didn’t know the syntax. Btw do you know why we have to put an unwrap method around the input? What does it do?


#4

Um, as far as I remember, we have to do this to expose the actual Revit API object. When collecting Revit elements through Dynamo, these are are automatically wrapped to enable the Revit document and Dynamo to stay in sync.

You should read the documentation for a more thorough explanation :slight_smile:


#5

forgetting to unwrap gets me every time! :confounded:I wish there was an easy way to tell if an object is a dynamo wrapper or Revit type. I’m beginning to think UnwrapElement() is the Dynamo equivalent of “Have you turned it off and on again?” in the IT world :joy:


#6

Funny, I think that would be lacing and levels… ones advanced coding of an issue and one is noding(?) for an issue. They both do kinda the same and are often overlooked the first time a graph or code is run.
:stuck_out_tongue:


#7

thanks for the help!
one minor thing left is the unit. I used this method
image
except I substituted the “trans4” with “XYZ(0,0,-150)” hoping that the point will be dropped by150mm. But in the model Revit moved it by a lot more. Does dynamo not get unit system from the parent revit file?


#8

Hi Will,

I’m afraid not when you handle elements using the API. Your input values will be read as imperial, so you need to do a conversion if you’re working in metric.


#9

True, changing list depth often results in breaking changes in dynamo, requiring constant attention to levels and lacing. I miss the way the grasshopper datatree construct hides this by operating on items in a list, rather than the lists themselves. ie first item in a grasshopper list will be the first element in every sublist, regardless of how many levels the list has. This has surely gone off topic now though…