Hello colleagues , I realized a new problem during my development and don't know, is it my code or it is autocad ?
My question is why in a drawing with lots of overruled objects, always it takes more time to regen viewports. I know all about LAYOUTREGENCTL system variable. If I set it " Cashe Model Tab and All Layouts ", it is not that bad , but if I set it to "Regen When Switching Layouts" . It is horrible and the reality is I don't want to change that system variable in code which is not professional.
Now the real question is what shall I do in my code to make regen faster during changing layout tabs even if the LAYOUTREGENCTL system variable is set to 0 ? Thanks in advance for any professional advice .
Janet.
Without knowing what your OverRules do and how many "a lots of overruled objects" means, I can only comment in general sense.
Using Overrule obviously add overhead to AutoCAD operation: AutoCAD must scan the database for the type you overrule applies. If you also have overrule filter defined (with, say, XData), AutoCAD needs read each object's XData to see if the object is subject to the Overrule. So, yes, Overrule could be abused to drag down AutoCAD performance.
So, what you should do really depends on what your Overrule does and if you can justify the overhead added to AutoCAD with the adavantage your Overrule brings in. The only way to speed up regen with your code is to optimize your Overrule code.
Norman Yuan
>It is horrible and the reality is I don't want to change that system variable in code which is not professional.
This statement needs clarification. It is OK to change a variable to do what you want. It is not professional if you don't set it back to what it was before you changed it.
IMO this is SOP. Save the value of a system variable, set it to what you need, and reset it when you are finished.
Thanks All, I really appreciate everybody comments. drawing has 2000 overrulled objects and Yes they carry Xdata .
Just the overrule part is almost 1500 lines of code, and it is hard to simplify it to paste here. But I guess like what Norman said and I wanted to confirm that , I have to cope with it. I will try to trim the code to see what happens.
Thanks Again.
Janet.
You also need to make sure the layer manager dialog is closed when working in ps layouts. It's a big reason for slow regeneration of the ps viewports.