Skip to content

Enable window select for export #298

Description

@dubstar-04

Consider window selection for export.

This could form part of a bigger part of work to make design core scriptable.

Allow users to automate drawing operations by running external .js files against a live Design Core instance.

designCore.doc — document-level operations (open, save, import, export)
designCore.db — drawing database access (iterate/query/modify entities)
designCore.ed — editor interaction (prompt user, write to command line, get current selection)
designCore.cmd — programmatic command dispatch (equivalent to typing at the command line)

Example
// Draw a circle at user-picked point
const pt = await designCore.ed.getPoint('Pick centre:');
const radius = await designCore.ed.getReal('Enter radius:');
await designCore.cmd.sendCommand('CIRCLE', pt, radius);

// Iterate entities
for (const entity of designCore.db.entities()) {
if (entity.type === 'Line') {
entity.setProperty('colour', 'red');
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions