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: 119
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 565 times
linetype2.js
script that sets current linetype to id 2
(1.25 KiB) Downloaded 580 times
David Frías Barranco | architect
[email protected] | davidfriasarquitecto.es

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

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

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

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

Post Reply

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