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, J-J, Husky
-
Husky
- Moderator/Drawing Help/Testing
- Posts: 5054
- Joined: Wed May 11, 2011 9:25 am
- Location: USA
Post
by Husky » Sat Jan 21, 2017 4:34 am
smf wrote:I'm still playing around with QCad and QCTrack, but it "just works", so there was no need for an update.
Hi smf - glad to hear that! I updated your library file list.

Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."
-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Mon Feb 11, 2019 8:40 pm
Hi there,
somewhere before QCad 3.21 there were some changes that I completely missed. Sorry!

So the version 101 of QCTrack does not work with the current version of QCad. After massive help of Andrew (thank you!) I will upload an updated QCTrack version for the next official QCad version as soon as possible.
Regards - smf
-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Sat Apr 27, 2019 2:36 pm
Hi there,
sorry for the long offline-time (read: family-time). Attached is the new QCTrack version 102 which is tested with QCad 3.22.0 and seems

to work. If you have any problems, please report them here.
@Husky: if you're still here, please update the "newest version" thread. Thank you!
@Andrew: thank you for your help and special QCad-extension!
Best regards
smf
-
Attachments
-
- QCTrack_V102_QCad3220.zip
- (76.82 KiB) Downloaded 4483 times
-
Husky
- Moderator/Drawing Help/Testing
- Posts: 5054
- Joined: Wed May 11, 2011 9:25 am
- Location: USA
Post
by Husky » Sun Apr 28, 2019 9:40 am
Done!

Work smart, not hard: QCad Pro
QcadPro, QcadCam, Win11/64, 64GB RAM, 10-Core, SSD
If a thread is considered as "solved" pls. change the title of the 1. post to "[solved] Title..."
-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Wed Jul 26, 2023 7:47 am
Unfortunatly, QCTrack is broken starting with QCad 3.24.0 onwards. Maybe there were some changes to the API of line-block-positions which I am not able to nail down or fix at the moment. I'm sorry and can not foresee when QCTrack will be fixed.
Last edited by
smf on Wed Jul 26, 2023 11:59 am, edited 1 time in total.
-
andrew
- Site Admin
- Posts: 8782
- Joined: Fri Mar 30, 2007 6:07 am
Post
by andrew » Wed Jul 26, 2023 11:40 am
Can you try this change in function getClosestTrackEnd in QCTrack.js:
var line = data.queryEntity(subIds[k], true);
The true argument means that the returned entity will be transformed according to block transformations. The default is false.
The same change is likely needed in getClosestTrackStraightMid.
-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Thu Jul 27, 2023 7:11 am
Thank you for your fast response, indeed the added true-parameter fixes adding new tracks.

I looked for other occurences and tried to add this parameter, but sometimes the complete library is broken, sometimes only parts of it work. It will take some time to test each occurence, but now I have a plan. Thanks again!

-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Thu Jul 27, 2023 12:40 pm
Most things seem to work now, one thing to do is getting "selected" property of a line of a block depending on the selection of the block. Until 3.23 I did something like:
Code: Select all
var k, subIds = document.queryBlockEntities(data.getReferencedBlockId());
for (k = 0; k < subIds.length; k++) {
var line = data.queryEntity(subIds[k]); //starting with 3.24, add "true" parameter to get absolute coordinates instead of block coordinates
if (!line.isSelected()) { ... } //always returns false starting with 3.24 <<< how to do now?
Maybe there is a more elegant way to get only entities of selecteded blocks, or what would be the preferred way to get the "selected" property?
Thanks in advance!
-
andrew
- Site Admin
- Posts: 8782
- Joined: Fri Mar 30, 2007 6:07 am
Post
by andrew » Thu Jul 27, 2023 1:12 pm
It's the block reference that is selected, not the individual entities inside the block definition.
You'd have to query the selection status of the block reference. In your function that is: block.isSelected().
-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Thu Jul 27, 2023 1:19 pm
Thanks, that's it! Leaving me with the question, why I did not do this before - it is more elegant, a lot faster...

-
smf
- Premier Member
- Posts: 175
- Joined: Tue Feb 28, 2012 1:05 pm
Post
by smf » Thu Jul 27, 2023 2:40 pm
Hi there,
thanks to Andrew's help, attached is the new QCTrack version 103 which is tested with QCad 3.24.0 / 3.27.6 / 3.28.1 and seems

to work. If you have any problems, please report them here.
@Husky: if you're still here, please update the "newest version" thread. Thank you!
Best regards
smf
-
Attachments
-
- QCTrack_V103_QCad3276.zip
- (80.38 KiB) Downloaded 3383 times