Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get adaptive family shape handle points - InvalidOperationException

8 REPLIES 8
Reply
Message 1 of 9
Brett_Burling
1451 Views, 8 Replies

Get adaptive family shape handle points - InvalidOperationException

 

In a project I am trying to get all the shape handle points of an adaptive family instance using the following code:

 

...
Dim r As Reference = UiDocument.Selection.PickObject(ObjectType.Element, "Select element:") Dim e As Element = Document.GetElement(r.ElementId) Dim fi As FamilyInstance = TryCast(e, FamilyInstance) Dim shapeHandlePoints As IList(Of ElementId) = AdaptiveComponentInstanceUtils.GetInstanceShapeHandlePointElementRefIds(fi)
...

If the adaptive family contains both placement points and shape handle points the code works as expected. 

 

If the family has no placement points and only shape handle points an InvalidOperationException is thrown.

 

 

Is this expected? An obvious workaround is to add a placement point to my family but i'd rather not do this.

 

 

 

 

 

Brett Burling | Principal Modeller – Civil Structures
Arcadis | Level 16, 580 George Street, Sydney | NSW 2000 | Australia
8 REPLIES 8
Message 2 of 9

Dear Brett,

 

Thank you for your query.

 

Can you please submit a full minimal reproducible case including a macro to execute in the sample model and detailed steps of what to pick etc. to experience the behaviour you describe?

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 9

No prob.

 

  • Revised project attached that contains the macro.
  • GIF attached that shows the steps to reproduce the error.

 

Hope that's clear.

Brett Burling | Principal Modeller – Civil Structures
Arcadis | Level 16, 580 George Street, Sydney | NSW 2000 | Australia
Message 4 of 9

Dear Brett,

 

Thank you for your update and sample material.

 

I am unable to open the GIF file:

gif_broken.png

 

 

 

 

Can you describe the steps to reproduce the issue in words as well, please?

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 9

That's odd works fine on the few computers I tired here (and my phone) anyways steps are as follows...

 

1. Open the project (attached)  and activate the view called "Level 1". The view contains 2 adaptive component families and text labelling them.

 

2. Run the macro called "NumberOfAdaptivePoints" and when prompted select the family labelled "Family with adaptive point and two shape handles" the macro executes and a dialog is displayed showing the number of placement points and the number of shape handle points. This is the expected result.

 

3. Run the macro again but this time select the family labelled "Family with no adaptive point and two shape handles" The macro executes and an exception is thrown at line 37. I was expecting to get a list that contains 2 shape handle element ids.

 

 

Brett Burling | Principal Modeller – Civil Structures
Arcadis | Level 16, 580 George Street, Sydney | NSW 2000 | Australia
Message 6 of 9

Dear Brett,

 

Thank you for your update and description.

 

I logged the issue REVIT-126102 [GetInstanceShapeHandlePointElementRefIds throws InvalidOperationException -- 13819685] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team, and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 9

Dear Brett,

 

Thank you for your patience.

 

The development team are working on the issue REVIT-126102 [GetInstanceShapeHandlePointElementRefIds throws InvalidOperationException -- 13819685] and have successfully reproduced the behaviour you describe.

 

More anon...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 8 of 9

thanks for the update.

 

Brett Burling | Principal Modeller – Civil Structures
Arcadis | Level 16, 580 George Street, Sydney | NSW 2000 | Australia
Message 9 of 9

Hi @Brett_Burling ,

 

FYI, The Engineering team says that the fix will be available in Revit 2023.1.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report