gemini-viewer-examples icon indicating copy to clipboard operation
gemini-viewer-examples copied to clipboard

About continuous loading of local DXF files

Open zhaomingxuan96 opened this issue 1 year ago • 3 comments

I’ve found that when opening a DXF file and then opening another new DXF file, the two will overlap in display. How can I make it so that when opening the second file, it clears the first one?

zhaomingxuan96 avatar Mar 15 '24 14:03 zhaomingxuan96

The viewer supports to load more than one DXF files. While it doesn't support unloading a DXF.

You can simply destroy the old DxfViewer instance, and new another one to load your new DXF file.

yanzexuan1 avatar Mar 18 '24 00:03 yanzexuan1

请问有具体的代码实现吗?我这里不是很明白?

wen089130 avatar Oct 16 '24 07:10 wen089130

const viewer1 = new DxfViewer(cfg1);
viewer1.loadModel(modelCfg1);
...
viewer1.destroy();

const viewer2= new DxfViewer(cfg2);
viewer2.loadModel(modelCfg2);
...

yanzexuan1 avatar Oct 17 '24 15:10 yanzexuan1