Andrew, I am missing out on the syntax in scripting
I got two similar ones I can't get to work.
with entity = document.queryEntity(id);
with isArcEntity(entity) = true
How to properly address
math...Rarc...isFullCircle as Boolean
with isPolylineEntity(entity) = true
How to properly address
math...RPolyline...bulges as Qlist
math...RPolyline...getBulges as Qlist
math...RPolyline...hasArcSegments as Boolean
And/or what to explicitly include?
Compiled there are fairly no scripts present as file.
(Plain Wininstaller)
Regards
[SOLVED] Can't find the correct syntax in scripting
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
[SOLVED] Can't find the correct syntax in scripting
Last edited by CVH on Mon Dec 21, 2020 6:25 am, edited 1 time in total.
Re: Can't find the correct syntax in scripting
Code: Select all
var arcShape = entity.castToShape();
if (arcShape.isFullCircle()) {
...
}
Code: Select all
var plShape = entity.castToShape();
var bulges = plShape.getBulges();
if (plShape.hasArcSegments()) {
...
}
You might want to search our github repository or download the scripts as sources:
https://github.com/qcad/qcad
Re: Can't find the correct syntax in scripting
Thanks Andrew,
I found the 'shape method' myself but it solves not all of my concerns.
Looking at a shape signature
eg
[code]RArc(RShape(address: "0x15d2a2b0"), center: RVector(56.2438, -22.9758,.....[/code]
Does Qcad rely on the turncated numbers or on the underlying full precision?
I have a copy of the scripts as source for reference.
Not allways the latest but its only to peek at.
The script folder under Win/Progarms is as it comes, fairly empty, and is kept so.
For numberToString() I had to add sprint.js because this trows an error without.
I found the 'shape method' myself but it solves not all of my concerns.
Looking at a shape signature
eg
[code]RArc(RShape(address: "0x15d2a2b0"), center: RVector(56.2438, -22.9758,.....[/code]
Does Qcad rely on the turncated numbers or on the underlying full precision?
I have a copy of the scripts as source for reference.
Not allways the latest but its only to peek at.
The script folder under Win/Progarms is as it comes, fairly empty, and is kept so.
For numberToString() I had to add sprint.js because this trows an error without.