set current linetype-lineweight scripts - How to update Pen Toolbar?

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
User avatar
dfriasb
Senior Member
Posts: 112
Joined: Thu Mar 10, 2016 1:08 pm
Location: Calafell, Tarragona, Spain

set current linetype-lineweight scripts - How to update Pen Toolbar?

Post by dfriasb » Sat Mar 28, 2020 8:40 am

Hi all,

I've written some scripts to set current linetype and lineweight with command line and keyboard input. They are working exactly as I wanted, but Pen Toolbar is not updated when script runs. This is a little bit confusing for me. Can I introduce some function in script to update Pen Toolbar? Any help will be very welcomed.

Best regards,
Attachments
lineweight1.js
script that sets current lineweight to 0.13mm
(1.15 KiB) Downloaded 46 times
linetype2.js
script that sets current linetype to id 2
(1.25 KiB) Downloaded 44 times
David Frías Barranco | architect
[email protected] | davidfriasarquitecto.es

CVH
Premier Member
Posts: 684
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: set current linetype-lineweight scripts - How to update Pen Toolbar?

Post by CVH » Sat Mar 28, 2020 1:18 pm

A source of info might be:
PenToolBar.js

Regards,
CVH
QCADpro 3.24.3.0 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

CVH
Premier Member
Posts: 684
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: set current linetype-lineweight scripts - How to update Pen Toolbar?

Post by CVH » Sat Mar 28, 2020 1:45 pm

What I read there is:
The startup values are gathered as: colorCombo.setColor(di.getCurrentColor());
di is the document interface.
On a value change it is stored as:
EAction.getDocumentInterface().setCurrentColor(color);

The diff with yours is that you change the document pen.
PenToolBar.js alters the document interface pen....

Regards,
CVH
QCADpro 3.24.3.0 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”