Openings on Roof in Window Family via API

Openings on Roof in Window Family via API

Anonymous
Not applicable
1,425 Views
14 Replies
Message 1 of 15

Openings on Roof in Window Family via API

Anonymous
Not applicable

Dear all,

 

What we want to achieve is rather straight forward: Openings in Roof using Revit API.

 

I see following possibilities:

  1. Creating a new opening using Create.NewOpening().
    This is intended way of working, as per API design. However, due to a known Revit API bug (link: https://forums.autodesk.com/t5/revit-api/revit-net-issue/td-p/5701091) this is not possible as of now.
  2. Supplying profiles of Openings along with Roof profile while creating roof.
    This is not an acceptable solution as this approach needs the opening curves to be fully within Roof's profile (cannot conincide roof borders or corners) 
  3. Placing Opening on Roof in Window Family 
    My client's Revit professional came up with approach of creating Window Family for Roof, with just Opening element in it (without all window friles).
    However, i found API for Family (FamilyItemFactory Document.FamilyCreate.NewOpening()) allows openings only on Ceilings and Walls (not for roofs). I find it strange because in Revit UI, it is very much possible.
    What is the way around?

 

Any light sheded in this direction will be highly appreciated.

 

Best regards,

Kinjal.

 

 

0 Likes
1,426 Views
14 Replies
Replies (14)
Message 2 of 15

jeremytammik
Autodesk
Autodesk

Dear Kinjal,

 

Thank you for your very pertinent query.

 

I see an old wish list item REVIT-26344 [Document.Create.NewOpening failed to create opening for extrusion roof] that seems to be related to your request.

 

It was closed by the development team, but I reopened it and asked for advice on how to address your need.

 

I'll let you know as soon as I hear back from them.

 

Thank you for your patience.

 

Best regards,

 

Jeremy



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

0 Likes
Message 3 of 15

jeremytammik
Autodesk
Autodesk

Dear Kinjal,

 

I discovered something else right after writing the first answer.

 

The development team have already addressed the issue I mentioned and implemented a fix for the related ones REVIT-70803 and REVIT-71315 [NewOpening throws InvalidOperationException: The hostElement is not a floor, ceiling or roof].

 

It will probably become available in the next major release.

 

I hope this helps.

 

Best regards,

 

Jeremy



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

Message 4 of 15

Anonymous
Not applicable

Dear Jeremy,

 

Thanks a ton for your efforts and help! This is indeed a useful news for us.

 

Best regards,

Kinjal.

0 Likes
Message 5 of 15

Anonymous
Not applicable

@jeremytammik In a regular document it is possible to use the changed NewOpening-Function:

https://www.revitapidocs.com/2021.1/8ff3c649-4d5a-67a6-81d7-3d1dca9e9955.htm

 

When i try to use it while generating a new family it wont work and is still limited to wall and ceiling:

https://www.revitapidocs.com/2021.1/b869aa8a-0c97-8d20-fee8-82c67849294f.htm

 

Is this still a valid topic or is there another way around this opening creation?

0 Likes
Message 6 of 15

jeremy_tammik
Alumni
Alumni

I don't know whether the workflow you suggest is possible at all. Have you researched the best practices to achieve your goal manually through the end user interface?

  

In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.

 

You should therefore always research the optimal workflow and best practices to address your task at hand manually through the user interface first.

 

To do so, please discuss and analyse it with an experienced application engineer, product usage expert, or product support.

 

Once you have got that part sorted out, it is time to step up into the programming environment.

 

I hope this clarifies.

 

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

Anonymous
Not applicable

 

Thanks for the quick response.

 

I tried it in Revit (no code) and it is working fine.

In my example i tried it with default Metric Generic Model roof based.rft and a Round Opening on a BaseRoof:

becus25_0-1619086290535.png

 

In Revit i can use it with walls and roofs, in code just with walls.

 

I will forward this topic to product support, thanks for helping.

0 Likes
Message 8 of 15

jeremy_tammik
Alumni
Alumni

Thank you very much for the testing and confirmation.

 

If you can achieve the desired effect manually in the UI and the same does not work programmatically in the API, then this is exactly the right place to raise and solve the issue.

 

Please do not bother product support with it; they will just escalate it back to us, DAS, Autodesk Developer Advocacy and Support, formerly ADN, Autodesk Developer Network.

 

Can you possibly provide a minimal reproducible case to demonstrate the problem to the development team, and also provide a context in which to test that any fix we find really works?

 

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

 

Thank you!

  

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

Anonymous
Not applicable

I made two code-samples with Revit 2022 API.

- One describes this problem which occurs in every revit version (maybe never implemented / too strong filter).

- Another sample describes a new problem which occurs just in Revit 2022 (another topic, could be critical for some plugins including the one i am working on).

 

The attached zip-file includes the two commands, a dxf-file and two rft-files.

The problems are documented with inline comments.

 

0 Likes
Message 10 of 15

jeremy_tammik
Alumni
Alumni

Dear Becus25,

 

Thank you for your two reports and minimal reproducible cases.

 

They are very succinct, and that helps a lot.

 

Normally, I would ask you to submit each new report in its own separate thread. No need, though, this time.

 

I looked at the drafting view creation issue first.

 

Sorry to hear about this problem.

 

I logged the issue REVIT-176579 [Revit 2022 opens newly created drafting view] 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
0 Likes
Message 11 of 15

jeremy_tammik
Alumni
Alumni

Dear Becus25,

 

Thank you again for your succinct reports and minimal reproducible cases.

 

Next time, please submit each one in a separate thread.

 

I logged a second issue REVIT-176582 [NewOpening API in family limited to wall, UI works for roof also] 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.

 

The same as above applies to this as well, of course.

 

Best regards,

 

Jeremy

 

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

Anonymous
Not applicable

Noted, i keep it in mind for my next story. Thanks a lot for helping.

 

I will refer to you asap in a PM regarding your questions related to REVIT-176579.

0 Likes
Message 13 of 15

jeremy_tammik
Alumni
Alumni

Dear Becus25,

 

Thank you for your private message providing your company details and business cases for the two development issues REVIT-176579 [Revit 2022 opens newly created drafting view] and REVIT-176582 [NewOpening API in family limited to wall, UI works for roof also].

 

I added them to the ticket notes and raised the priority of the former to critical.

 

Best regards,

 

Jeremy

  

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

jeremy_tammik
Alumni
Alumni

Dear Becus25,

 

The development team analysed the issue REVIT-176579 [Revit 2022 opens newly created drafting view] and determined that a code fix was required.

 

They opened a new code fix issue REVIT-176780 [Revit 2022 opens newly created drafting view] for that task. Please make a note of this number for future reference.

 

Unfortunately, the fix just missed the deadline for the very next update release.

 

The development team evaluate its importance as follows:

 

Overall, this isn't critical at all.  Apparently, it is critical for one particular API provider.  However, it seems like they could easily work around this issue by changing their code, no?

 

If this is not easy for you, would you like to submit a business case underlining its importance for you to see whether we can have it included anyway? Please see above for details on what information to supply.

 

Thank you.

 

Best regards,

 

Jeremy

 

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

jeremy_tammik
Alumni
Alumni

Dear Becus25,

 

Thank you for your business case via private forum message for the issue REVIT-176579 [Revit 2022 opens newly created drafting view].

 

Please note that the development team analysed that and determined that a code fix is required. They closed the original ticket and opened a new one for the actual development work, REVIT-176780 [Revit 2022 opens newly created drafting view]. Please make a note of the new ticket number as well.

 

I added your business case to that. They are currently discussing whether it can be nominated to be included in an update release or not.

 

Best regards,

 

Jeremy

 

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