Search found 11 matches

by cjm
Mon Mar 30, 2020 5:07 pm
Forum: QCAD 'How Do I' Questions
Topic: Automatically add dimension labels to drawing with a script
Replies: 6
Views: 4587

Re: Automatically add dimension labels to drawing with a script

It is correct that DimHorizontal & DimVertical are both DimRotated. The diff is set in DimHorizontal.js and DimVertical.js: this.data.setRotation = 0 or pi/2. I set this.data.setRotation in my functions and thought that would be enough but evidently not. I have just rewritten them to use the DimHor...
by cjm
Mon Mar 30, 2020 4:07 am
Forum: QCAD 'How Do I' Questions
Topic: Automatically add dimension labels to drawing with a script
Replies: 6
Views: 4587

Re: Automatically add dimension labels to drawing with a script

I decided to take the second route you suggested, with mixed success. I have fully working functions for horizontal and aligned dims, however I'm still having trouble creating functions for vertical and angular dims. I will post what success I have had so far. My horizontal dim function, which works...
by cjm
Sun Mar 29, 2020 1:57 am
Forum: QCAD 'How Do I' Questions
Topic: Automatically add dimension labels to drawing with a script
Replies: 6
Views: 4587

Automatically add dimension labels to drawing with a script

Is there a way to create dimension labels with a script? For example, in the command line, the following input will create a dimension label:

Code: Select all

dimaligned
0,0
100,0
100
Is there an easy way to do this within a script, short of including and pulling apart the Dimension scripts?
by cjm
Fri Apr 26, 2019 12:35 am
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 4348

Re: Grab values from text boxes created by a .ui file

Please be sure to also check out the Qt API doc and search through the extensive QCAD sources for examples. You can simply implement slotMyButton for a toolbutton named MyButton . Have a look at the Line2P example. Many thanks for all your help, andrew! I think I now have everything I need to finis...
by cjm
Thu Apr 18, 2019 12:54 am
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 4348

Re: Grab values from text boxes created by a .ui file

In this case, you're talking about the options toolbar at the top, not a dialog: var optionsToolBar = EAction.getOptionsToolBar(); var lengthEdit = optionsToolBar.findChild("Length"); Excellent! That works perfectly when I append .text to the end of the findChild methods. Thank you very much! How a...
by cjm
Wed Apr 17, 2019 1:49 pm
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 4348

Re: Grab values from text boxes created by a .ui file

Let's say your dialog widget is called "dialog": var lengthEdit = dialog.findChild("Length"); Using qDebug("User input: " + dialog.findChild("Length")); returns "ReferenceError: Can't find variable: dialog" I am opening the file with this.setUiOptions("file.ui"); if that helps. Edit: Is this assumi...
by cjm
Wed Apr 17, 2019 10:59 am
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 4348

[solved] Grab values from text boxes created by a .ui file

Say I have a text box widget created by a .ui file: <widget class="RMathLineEdit" name="Length"> <property name="toolTip"> <string>The length</string> </property> <property name="text"> <string notr="true">1000</string> </property> </widget> and a button: <item> <widget class="QToolButton" name="Con...
by cjm
Thu Aug 10, 2017 5:53 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 7
Views: 7576

Re: Variable from command line / user input

Sorry to bother you again with this, I had to take a break from this project for a while but I now have a few days free to dedicate to making this tool work and would appreciate some more help. If the user enters a value in the command line, your action receives a commandEvent: BrickArch.prototype.c...
by cjm
Thu Jun 29, 2017 9:03 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 7
Views: 7576

Re: Variable from command line / user input

Thank you for your advice, andrew! I have done as you suggested and completely rewritten my tool, testing it periodically for errors and making some substantial improvements from the original. There are only 3 things missing now: Receiving the variables from the command line Math formulas that work ...
by cjm
Sun Jun 25, 2017 8:11 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 7
Views: 7576

Re: Variable from command line / user input

Here is the code I have written so far. Its a bit of a mess and I expect a lot of things are probably in the wrong place. Trying to run it in QCAD produces no results and I don't know how to make QCAD print error messages. //! [include] include("scripts/EAction.js"); //! [include] //! [constructor] ...
by cjm
Sun Jun 25, 2017 7:12 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 7
Views: 7576

Variable from command line / user input

QCAD version: 3.17.1 OS: Windows 10 at work and Devuan GNU/Linux at home Hello, QCAD community, I am new here and would hugely appreciate some pointers on my first project. I am working on a tool/script to automatically generate a 2D template for a brick arch (a trapezium consisting of smaller paral...

Go to advanced search