How to avoid 'Edit Block In-place' toolbar with a new GUI 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
CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

How to avoid 'Edit Block In-place' toolbar with a new GUI document?

Post by CVH » Mon Oct 03, 2022 10:37 am

Andrew,
Running QCAD Pro 3.27.6.0 on Win7 32 bit

So far I tested 2 methods:

Code: Select all

    var action = RGuiAction.getByScriptFile("scripts/File/NewFile/NewFile.js");
    if (!isNull(action)) {
        action.slotTrigger();
    }
    else {    // Without a new drawing
        return;    // Return to terminate in beginEvent
    }

Code: Select all

include("scripts/File/NewFile/NewFile.js");
...
..
.
    var mdiChild = NewFile.createMdiChild();
    if (isNull(mdiChild)) {    // Without a new drawing
        return;    // Return to terminate in beginEvent
    }
I presume that the second does just the same as the first.

A new GUI document is created, the focus shifts to the new document, output of the script does reach the new drawing.
The problem is that the 'Edit Block In-place' options toolbar turns visible.
EBIP-spook.png
EBIP-spook.png (105.45 KiB) Viewed 5760 times
I traced it with debugging and it pops up at calling NewFile.setupDefaultAction(documentInterface);
To be clear, it pops up in both modes, normal and debugging.

It is not that of a big deal because it is rather spooky.
When I swap focus to another document or switch to another application it simply disappears.

But one can't use any of the options buttons because we are not editing in place nor do we use a block.
Every button will throw an exception on the Command History.

The drawing that is created is an early adaption of _myCone by tukuyomi. :wink:
https://www.qcad.org/rsforum/viewtopic. ... =30#p38464

Regards,
CVH

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

Re: How to avoid 'Edit Block In-place' toolbar with a new GUI document?

Post by andrew » Tue Oct 04, 2022 2:33 pm

Are you creating a new (empty) document or loading a drawing?

The current block editing state is stored in the drawing file, so that might be to blame if you are loading an existing drawing file.

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

Re: How to avoid 'Edit Block In-place' toolbar with a new GUI document?

Post by CVH » Tue Oct 04, 2022 5:55 pm

Andrew,

If all input of the dialog is fine the script creates a new GUI document and puts 3 to at most 5 entities on it.
_myCone is not that complex at all, we are taking it step by step. :wink:

I know there is a file 'empty.dxf' in the templates but I assume that this is not used.
This so said empty drawing has 5 extra layers defined aside Layer 0 and an additional 'Layout2'.
The new GUI drawing that is created only has the default blocks and Layer 0.

I could try this out on a Win 10 PC ... It is a bare minimal stand-alone dedicated for the CNC.

I am also the only one that avoids the use of 'Edit Block In-place': https://www.ribbonsoft.com/bugtracker/i ... sk_id=2179

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”