Andrew,
Benchmarks on optimized hatches halted … see:
Changed my focus on lagging with hatches in general:
A solution mentioned on the forum was to set them solid.
What is no real solution! Not at all for orphans!!
Although it has a major impact on speed! See my comment at:
Obvious: QCAD doesn’t have to render the patterns anymore. ![]()
Another (half) solution mentioned was to lock/hide the layers with them.
But in doing so, one locks/hides all entities on those layers.
Wrote a script that isolates all hatches to subLayers of the original parent layer.
The goal is to disable all hatches simply by disabling their specific layers and go from there …
To find them all:
ids = doc.queryAllEntities(false, true, RS.EntityHatch);
I was a bit afraid that those in Blocks needed more than a simple ‘move’ but that seems to work out so far.
I also didn’t know if we could alter the layer of orphan hatch patterns without losing the pattern itself. ![]()
Similar as losing it when altering its Origin.
In (very) short:
op = new RModifyObjectsOperation();
hatchEntity = doc.queryEntity(id);
parentLayerName = hatchEntity.getLayerName();
subLayerName = parentLayerName + " ... HatchEntities";
hatchEntity.setLayerName(subLayerName);
op.addObject(hatchEntity, false, false);
In the file at bugtracker: FS#2021 : Cannot work with big dwg files
There are 13.220 entities selected by TA, of which 684 Block References. ![]()
There are:
- 602 hatches in Model_Space
- 797 hatches in total => 195 in Blocks
- Only 1 Orphan pattern style called ‘2X4’ used only once
(The pattern itself is no big deal, 2 line definitions, 1x0°, 1x90°) - On 13 different layers
I couldn’t process them in one operation because some failed:
‘Transaction failed. Please check for block recursions and locked or invisible layers or blocks.’
QCAD is spending more time to ‘autoSave’ as to ‘move’. ![]()
→ Changed from 3min to 30min autoSave (Also a solution mentioned on the forum)
Managed to do them one by one … in debugger mode … in sets of 10 … very tedious but it was still a trial.
The first 500 or so went fine, that needed 50 times a ‘continue’ in debugger mode. (3.6sec/move)
Then there was an ‘Autosave’, from thereon the script did only about 60 moves every 30min. (30sec/move)
File details: .dwg = 1.92Mb ~.dxf = ~18.5Mb (EDIT
that was zipped, it is *.dwg = 3.94Mb)
But at the end the counter said 797 and all were processed.
Saved the file as a revision.
In the report I see that 13 individual hatches didn’t move … 'Transaction failed…
2 on Model_Space and 11 in various other Blocks.
Troubled by: ![]()
- There are 6 with Block names reported not visible in the Block List
Similar as: How To: non-visible blocks
On top these aren’t listed on Misc .. Export Block list / List Block Attrib.
The Biggest downside: ![]()
In the revision:
- 600 in Model_Space => 2 lost
- 784 in total => 184 in Blocks => 11 lost
I presumed that ‘failing the move’ was merely NOT moving …?
A good thing: ![]()
- 1 Orphan pattern with valid pattern (meaning that we can move orphan hatch patterns)
The very good thing: ![]()
With the layers with hatches frozen & Locked …
Once the zoomState includes only part (not all 13k) of the drawing QCAD works with little to no lag.
Back to the drawing board:
Enhanced the script somewhat:
- Skipping hatches already isolated
- Reports handles besides Ids
- …
2Bcont.
When I have the 13 handles, I will report them too.
Regards,
CVH
