Discussion forum for contributors and developers who are using the QCAD ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).
- Junior Member
- Posts: 16
- Joined: Sun Apr 29, 2018 7:04 am
- Location: Leinefelde
I have a set of block reference entities and they all have the same referenced block id. How could I copy the block, so that every block reference holds a copy of the original block? I tried this:
Code: Select all
var a = doc.queryEntity(62);
var b = a.getReferencedBlockId();
var c = doc.queryBlock(b);
var d = c.clone();
var op = new RAddObjectOperation(d, false);
But the last part only changes the name of the block, because the implementation of clone calls the copy constructor of RBlock. The id is still the same and there is no method to change it.
Gentoo/Linux, QCad 3.20 Prof.