gemini-viewer-examples
gemini-viewer-examples copied to clipboard
About continuous loading of local DXF files
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?
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.
请问有具体的代码实现吗?我这里不是很明白?
const viewer1 = new DxfViewer(cfg1);
viewer1.loadModel(modelCfg1);
...
viewer1.destroy();
const viewer2= new DxfViewer(cfg2);
viewer2.loadModel(modelCfg2);
...