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.
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.
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
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
No prob.
Hope that's clear.
No prob.
Hope that's clear.
Dear Brett,
Thank you for your update and sample material.
I am unable to open the GIF file:
Can you describe the steps to reproduce the issue in words as well, please?
Thank you!
Best regards,
Jeremy
Dear Brett,
Thank you for your update and sample material.
I am unable to open the GIF file:
Can you describe the steps to reproduce the issue in words as well, please?
Thank you!
Best regards,
Jeremy
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.
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.
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:
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
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:
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
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
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
thanks for the update.
thanks for the update.
Hi @Brett_Burling ,
FYI, The Engineering team says that the fix will be available in Revit 2023.1.
Hi @Brett_Burling ,
FYI, The Engineering team says that the fix will be available in Revit 2023.1.
Can't find what you're looking for? Ask the community or share your knowledge.