简体   繁体   中英

Selecting plan with FilteredElementCollector Revit Api

enter image description here

I am developing an application with Revit api. I'm trying to open my 3D model using FilteredElementCollector. I couldn't catch it first, I want to ask how can I do it? I also get this error when I select another 3D model of mine.

Error: Autodesk.Revit.Exceptions.InvalidOperationException: 'Setting active view is temporarily disabled.

Can you help with these issues?

By 3D model, do you mean a 3D view?

https://www.revitapidocs.com/2015/b6adb74b-39af-9213-c37b-f54db76b75a3.htm

You'll see here that changing the active view is only possible when there is no:

There is no open transaction.

IsModifiable is false.

IsReadOnly is false

ViewActivating, ViewActivated, and any pre-action of events (such as DocumentSaving or DocumentClosingevents) are not being handled.

Worth making sure you don't have an open transaction. If you do, and you need one you can use the RequestViewChange method:

https://www.revitapidocs.com/2015/a2e920d4-2849-282e-c25f-40a4d2cbef2d.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM