DynamoDS / DynamoRevit

Dynamo Libraries for Revit
https://dynamobim.org
339 stars 188 forks source link

Dynamo for Revit crashes when exporting huge amount of drafting views as images #2571

Open JunKangL opened 4 years ago

JunKangL commented 4 years ago

Dynamo version

2.0.3

Revit version

2018

Operating system

Windows 10

What did you do?

Exporting 700 drafting views as images in a single project

What did you expect to see?

700 images to be exported

What did you see instead?

Dynamo crashes with this : image Error Message: Not enough quota is available to process this command at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet) at System.Windows.Interop.HwndTarget.OnResize() at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Note: While dynamo for Revit crashes, Revit still runs for a certain amount of time before crashing with a fatal error.

ZiyunShang commented 4 years ago

Hi @JunKangL , are you experiencing this issue in latest Dynamo version like 2.5.2? Could you provide a sample for us so that we can reproduce this issue on our side?

JunKangL commented 4 years ago

Hi @ZiyunShang, sorry but I couldn't provide you the Revit file as it belongs to the company. I can provide you the dynamo graph though: JSON_CreateJsonForDocument_v2.0.dyn.txt

remember to remove the ".txt" fake extension.

And I am experiencing this issue on Dynamo 2.0.3, Revit 2018.

EDIT: its the latest dynamo build of version 2.0.3 available in the web

ZiyunShang commented 4 years ago

I tried your script and got normal results. I only used 3 rvt files and generated 7 PNG files. I think it may be a very large amount of data that caused the crash. @QilongTang @mjkkirschner Do you have any suggestions for this issue?

BTW, in your script, function "RenameFiles(dirpath)": newname = fullpath.replace("WSP - Drafting View - ", "") I found that not all picture name contains this str - "WSP - Drafting View - " in my tests.

JunKangL commented 4 years ago

BTW, in your script, function "RenameFiles(dirpath)": newname = fullpath.replace("WSP - Drafting View - ", "") I found that not all picture name contains this str - "WSP - Drafting View - " in my tests.

From the remark, you can know that i works at WSP and the view type I am exporting is drafting view 😄

And yea, I tried it on a single project, with over 700+ drafting views which cause this crash. It will crash when it reaches 150+ images, and the dynamo will just crash with that error while revit continues to export the images until it hits 500+ and finally revit crashes.