Host an Adaptive Instance

Host an Adaptive Instance

jmadeley37KVE
Contributor Contributor
467 Views
4 Replies
Message 1 of 5

Host an Adaptive Instance

jmadeley37KVE
Contributor
Contributor

Hi all,

 

I'm having some difficulties hosting an adaptive family instance. I've taken a look around and it appears that once I have created an instance I can't rehost it, so this leaves me with the only option of host it on creation.

 

To create an adaptive component instance I'm using the AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance() method - but this only accepts two parameters of document and symbol. I can see that the object that is created has a Host of Null, so is it possible to create an adaptive component with a host object defined?

 

Thanks in advance!

Jack

0 Likes
468 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

Oh dear. We recently looked at a similar issue:

  

https://forums.autodesk.com/t5/revit-api-forum/rehosting-adaptive-point/m-p/11282839

  

Maybe we need to report this to the development team as well. I asked them for you how to address this.

  

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

jmadeley37KVE
Contributor
Contributor

Thanks Jeremy, from my research this was going to be solved in Revit 2023 but I can't see any difference from 2022. Is there a method that I should be using?

 

Message 4 of 5

jeremy_tammik
Alumni
Alumni

Yes. The development team replied:

  

Looks like the @jmadeley37KVE is unaware of how to rehost the instance points after placing them. Here is the response:

  
One has to fetch the placement point ids from the placed instance and rehost those points individually:

  

  • AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds
  • AdaptiveComponentInstanceUtils.GetInstancePointElementRefIds
  • AdaptiveComponentInstanceUtils.GetInstanceShapeHandlePointElementRefIds

  

One can rehost the individual placement points and shape handles using ReferencePoint.SetPointElementReference.

  

While references from project will work without issues, the curve references from family instances had some issues in older Revit. Curve references from family instances issue was reported in REVIT-181785 (forum link) and is fixed in Revit 2022.2, Revit 2023.1 and all subsequent future releases.

  

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

jmadeley37KVE
Contributor
Contributor

Hi Jeremy,

 

Thanks for the above.

 

I can see that I've retreived the references points as advised above, but how would I go about using the ReferencePoint.SetPointElementReference method? Do I specify the host in the constructor?

 

Thanks

Jack

0 Likes