Bug Report, Revit API 2016: Deleted View problem

Bug Report, Revit API 2016: Deleted View problem

StruSoft_Iwona
Contributor Contributor
472 Views
3 Replies
Message 1 of 4

Bug Report, Revit API 2016: Deleted View problem

StruSoft_Iwona
Contributor
Contributor

I created an addin command what creates a view. If I delete that view in Revit and use the addin command again I get an exception. But not always. If I change between views a few time before the command, sometimes I dont get exception. I think the document.ActiveView gives back the deleted view or something like that.

fb.jpg

0 Likes
473 Views
3 Replies
Replies (3)
Message 2 of 4

StruSoft_Iwona
Contributor
Contributor

As I thought ... active view name: "???"

 

In revit dialog the active view is automatically selected after a view deletion but the API dont give that view back as active view.

After creation:
q1.jpg

After deletion (3D view automatically selected and the exception occurs):
q2.jpg


0 Likes
Message 3 of 4

Revitalizer
Advisor
Advisor

Hi,

 

it would be better to use uiApp.ActiveUIDocument.ActiveGraphicalView insted of a document's ActiveView since there may be active (focused) non-graphical views, e.g. Project browser, properties palette or custom palettes.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 4 of 4

JimJia
Alumni
Alumni

Thanks Revitalizer, I also think UIDocument.ActiveGraphicalView is safer choice.


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes