Hi smf - glad to hear that! I updated your library file list.smf wrote:I'm still playing around with QCad and QCTrack, but it "just works", so there was no need for an update.
model railroad track planning
Moderators: andrew, Husky, J-J
Re: model railroad track planning
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: model railroad track planning
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
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
Re: model railroad track planning
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
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 2526 times
Re: model railroad track planning
Done!
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: model railroad track planning
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.
Re: model railroad track planning
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.
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.
Re: model railroad track planning
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!
Re: model railroad track planning
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:
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!
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?
Thanks in advance!
Re: model railroad track planning
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().
You'd have to query the selection status of the block reference. In your function that is: block.isSelected().
Re: model railroad track planning
Thanks, that's it! Leaving me with the question, why I did not do this before - it is more elegant, a lot faster...
Re: model railroad track planning
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
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 1807 times