Custom order for export

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
User avatar
andrew
Site Admin
Posts: 9052
Joined: Fri Mar 30, 2007 6:07 am

Custom order for export

Post by andrew » Wed Jul 29, 2015 9:41 am

From a QCAD/CAM user:
Can I control the order in which entities are exported in any other way than the predefined ways?

User avatar
andrew
Site Admin
Posts: 9052
Joined: Fri Mar 30, 2007 6:07 am

Re: Custom order for export

Post by andrew » Wed Jul 29, 2015 9:42 am

It is possible to overwrite exportEntities to define any desired custom order in which entities are exported.

The simplest implementation would be (random order):
MyClass.prototype.exportEntities = function() {
    var ids = this.document.queryAllEntities();
    for (var i = 0; i < ids.length; ++i) {
        var entityId = ids;
        var entity = this.document.queryEntity(entityId);
        this.exportContourEntity(entity.data());
    }
};

Post Reply

Return to “QCAD/CAM”