ECMAScript reference to the current QCAD document

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
michal_w
Newbie Member
Posts: 7
Joined: Sun Nov 29, 2020 6:32 pm
Location: Poland

ECMAScript reference to the current QCAD document

Post by michal_w » Mon Feb 10, 2025 10:14 am

Hi,

Would you please tell me how to get the reference to the active (open) QCAD document?

Thank you
Michał

CVH
Premier Member
Posts: 4919
Joined: Wed Sep 27, 2017 4:17 pm

Re: ECMAScript reference to the current QCAD document

Post by CVH » Mon Feb 10, 2025 11:24 am

Hi,

Depends on where it is required.

When eventually based on EAction then it can be as simple as this.getDocument();
Then basically the same as EAction.getDocument();

With a known RDocumentInterface in di again very simple: di.getDocument();

There are countless methods.
Try to enter the search term 'getDocument' in the QCAD reference

Regards,
CVH

michal_w
Newbie Member
Posts: 7
Joined: Sun Nov 29, 2020 6:32 pm
Location: Poland

Re: ECMAScript reference to the current QCAD document

Post by michal_w » Mon Feb 10, 2025 7:53 pm

Hi,

Thank you for your hints.

Michał

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”