FaceWall.Create bug in some specific cases and the workaround

FaceWall.Create bug in some specific cases and the workaround

aignatovich
Advisor Advisor
734 Views
6 Replies
Message 1 of 7

FaceWall.Create bug in some specific cases and the workaround

aignatovich
Advisor
Advisor

Hi, guys, I want to notify about a minor bug in the API.

 

FaceWall.Create throws Autodesk.Revit.Exceptions in a specific case:

1) you have a user mass family (not an in-placed one)

2) you created the family instance programmatically using NewFamilyInstance(XYZ, FamilySymbol, StructuralType) method

3) you want to create a face wall by the family instance face

 

To avoid this exception you should either:

- create a family with another NewFamilyInstance method overload, for example with NewFamilyInstance(XYZ, FamilySymbol, Level, StructuralType) 
- fill "Schedule level" parameter

 

Screenshot 2021-02-03 222700.jpg

It seems, FaceWall.Create method internally tries to determine the level for a new FaceWall element (UI offers to select it) and fails if the level is not found. Meanwhile FaceWall.IsValidFaceReferenceForFaceWall method returns true.

So, apart from checking the results of IsValidFaceReferenceForFaceWall and IsWallTypeValidForFaceWall you should check if at least one of these conditions is met:

- face source element SCHEDULE_LEVEL_PARAM parameter value is not equal to ElementId.InvalidElementId
- face source element INSTANCE_SCHEDULE_ONLY_LEVEL_PARAM parameter value is not equal to ElementId.InvalidElementId

- face source element is an in-placed family instance

 

Affected versions: 2019-2021.

 

@jeremytammik , I think, the developer team should be aware of this minor bug as well as anyone who faced with it and could find a workaround here.

0 Likes
Accepted solutions (1)
735 Views
6 Replies
Replies (6)
Message 2 of 7

jeremy_tammik
Alumni
Alumni

Dear Alexander,

 

Thank you for your report and workaround.

 

I logged the issue REVIT-173637 [FaceWall.Create throws exceptions] 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.

 

Best regards,

 

Jeremy

 

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

aignatovich
Advisor
Advisor

Hi, Jeremy,

I consider this bug as a minor one. It happens in a certain condition only, and we know how to avoid it. This post could help the community to save some time. So the answer to these questions is: minor/minimal. The potential revenue impact to Autodesk: API stability. I think it would be good enough if this method will throw InvalidOperationException with a correct message instead of InternalException as a fast fix that could save hours for API users.

Thank you

0 Likes
Message 4 of 7

jeremy_tammik
Alumni
Alumni
Accepted solution

Dear Alexander,

 

Thank you for your assessment and analysis, which I added to the issue REVIT-173637 [FaceWall.Create throws exceptions].

  

Cheers,

 

Jeremy

 

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

jeremy_tammik
Alumni
Alumni

The development team ask:

 

Does this issue happen only to wall? Or also happen to other face based element created by the mass family?

  

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

aignatovich
Advisor
Advisor

Hi, Jeremy,

 

Yes, it seems this issue happens with face walls only. I succeed in creating family instances and curtain systems on mass faces.

0 Likes
Message 7 of 7

jeremy_tammik
Alumni
Alumni

Dear Alexander,

 

Thank you very much for your answer.

 

The development team confirmed the issue and closed REVIT-173637 [FaceWall.Create throws exceptions] as ' code fix needed'.

 

They raised a eew ticket REVIT-174171 [FaceWall.Create throws exceptions] to complete the programming for a future version of Revit.

 

Please make a note of this number for future reference.

 

Cheers,

 

Jeremy

 

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