Hi,
From the QCAD docs, there's a class called RS Class Reference that defines LIMMIN and LIMMAX as KnownVariables. I am wondering is there is a way to access global variables like these from within the ECMAscript environment?
Thank you
Using QCAD known variables in ECMAscript?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Junior Member
- Posts: 10
- Joined: Sat Jun 02, 2018 7:59 pm
- Location: Walnut Creek, CA
Using QCAD known variables in ECMAscript?
Mike Miller, P.E.
Re: Using QCAD known variables in ECMAscript?
Yes:
RS.LIMMIN
RS.LIMMAX
RS.LIMMIN
RS.LIMMAX
-
- Junior Member
- Posts: 10
- Joined: Sat Jun 02, 2018 7:59 pm
- Location: Walnut Creek, CA
Re: Using QCAD known variables in ECMAscript?
Hi Andrew,
I tried:
The output is:
Are these pointers to the actual values? I expect each to have a pair of coordinates, so I tried
with no success. Please advise.
I tried:
Code: Select all
var min = RS.LIMMIN;
var max = RS.LIMMAX;
appWin.handleUserInfo("Min = " + min + " max = " + max);
but these always return 91, and 90, respectively.Min = 91 max = 90
Are these pointers to the actual values? I expect each to have a pair of coordinates, so I tried
Code: Select all
values = min.getData();
Mike Miller, P.E.
Re: Using QCAD known variables in ECMAscript?
RS.LIMMIN, RS.LIMMAX are constants used to identify these header variables. These are not the actual values of these variables.
To query the value for a document, you can use:
To query the value for a document, you can use:
Code: Select all
document.getKnownVariable(RS.LIMMIN);