model railroad track planning

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, Husky, J-J

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Thu Jan 08, 2015 8:46 pm

Finally... :D Thanks to Andrew and his perfect support, a first version of a TrackWidget is implemented. :D

Attached there is the current version. Consecutive Exectution is removed - TrackWidget replaces it with the benefit of a better user interface and better integration into QCad. You'll need at least QCad 3.7.2 because I'm using setGroupOrder, or you have to remove the call in each script (just search for "action.setGroupSortOrder(QCTrack.MenuOrder.GroupSortOrder);" and remove the entire line).

The track widget integrates itself into the Widget panel. Now just select the desired track from the track widget and start extension of an existing track by typing QN or selecting "Insert new track from track widget". Mouse over the existing track and you'll get a preview of the track that would be inserted by left mouse click. If you want to change the connection end, you may right-click in the track widget, click on the "rotate button", select "Rotate track at track widget" or - most preferrable - just enter QR (will work even with mouse over a track, so you see the result "on line"). I will post an updated tutorial later.

Thank you Andrew for your support, and thank you Husky for inciting me to give TrackWidget yet another try.
Attachments
QCTrack_V63_TrackWidgetOk.zip
QCTrack version 63.
(55.42 KiB) Downloaded 1793 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4939
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Thu Jan 08, 2015 10:40 pm

Just BEAUTIFUL! :D

Ok, I'm right now playing around ... :shock:

Question: I tried the function "Select ... duplicate and move". The tool is asking for "Select end of track" but after picking the end of a track .... nothing happens. I'm doing something wrong? It was working in a predecessor version.

And now I'm sure ...... you will kill me 8) :
Have you noticed the nice preview Icons in the QCAD Library Browser? Is that something what could be implemented in this new TrackWidget?
Worldhusky-2015.01.08-01.png
Worldhusky-2015.01.08-01.png (22.9 KiB) Viewed 298097 times
However - I never checked before similar Programs/Scrips etc. in the www but now I can already tell that your script is VERY good! Thank you for share this with us!
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..."

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Thu Jan 08, 2015 10:52 pm

:D :D :D
Question: I tried the function "Select ... duplicate and move". The tool is asking for "Select end of track" but after picking the end of a track .... nothing happens. I'm doing something wrong? It was working in a predecessor version.
Uh, I have to check this out soon. "It should not be different than before". :oops:
And now I'm sure ...... you will kill me 8) :
Have you noticed the nice preview Icons in the QCAD Library Browser? Is that something what could be implemented in this new TrackWidget?
Hehe, no, I won't kill anyone for a proposal I already started implementation of. :) In the version 63 there is a function that should generate a preview icon, but I couldn't finish it today (debugger always tells me: "can not add null widget"). So: not ready, but hopefully sometimes it will be. :)
I never checked before similar Programs/Scrips etc. in the www but now I can already tell that your script is VERY good!
Thank you for the compliment. :) In fact, I tried several track planning programs (free and non-free), but I always missed the cool features of QCad. And in QCad everything you need is there, even for playing. :)
Last edited by smf on Fri Jan 09, 2015 8:11 am, edited 1 time in total.

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Tutorial step 7: create plans superfast with TrackWidget

Post by smf » Thu Jan 08, 2015 11:04 pm

In the new version, Consecutive Extension is removed. Instead of that there is a Track Widget that can be enabled / disabled via menu item QCTrack / View track widget or QV. You then get something like the Block list but with some more information about the tracks you may add.
TrackWidgetBase.png
Track widget enabled
TrackWidgetBase.png (63.02 KiB) Viewed 297133 times
To extend your an existing track, just select a track from the track widget and click "Add track" or choose menu item QCTrack / Insert new track from track widget or type QN. With mouse over the existing track, there should be preview of the track that would be inserted on left mouse click. Edit: starting with version 83, "insert new track" with shortcut QN inserts a new track "everywhere", and "connect new track" with shortcut QC inserts a new track that is connected to an already existing one.
TrackWidgetAdd.png
Add track
TrackWidgetAdd.png (15.95 KiB) Viewed 297133 times
Even during preview, you may type QR or select QCTrack / Rotate track at track widget (or you may right click inside the track widget or select a track end from the combobox or hit the Rotate button at the track widget) to select another track end to connect.

So with just 12 clicks you may insert 12 tracks - compared to Consecutive Extension, you save the double clicks :wink: and can move/zoom during insertion and you get a preview - I hope, no one is missing the "old" variant. :wink:
Last edited by smf on Mon Jan 26, 2015 7:59 pm, edited 1 time in total.

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 8:10 am

Question: I tried the function "Select ... duplicate and move". The tool is asking for "Select end of track" but after picking the end of a track .... nothing happens. I'm doing something wrong? It was working in a predecessor version.
Uh, I have to check this out soon. "It should not be different than before". :oops:
You're right, "Move" and "Duplicate and Move" are not working with the current version. :( I'm sorry, I'll fix this today or tomorrow (hopefully).

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: model railroad track planning

Post by Clive » Fri Jan 09, 2015 10:49 am

Hi Stefan

Well, I have read through your documentation and tutorials and so far. I have downloaded your current version of QTrack and it is very impressive, sure there are one or two improvements need - but hey , great work so far :) .

One suggestion I have is that you include some user notes stating that you need to use the 'MaerklinCGleis' file to work with the QTrack extension.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 10:50 am

attached is version 64 with fixed Move / DupMove (in the file there was an insertion by accident).
Attachments
QCTrack_V64_MoveFix.zip
QCTrack version 64
(55.42 KiB) Downloaded 1669 times

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 10:56 am

Well, I have read through your documentation and tutorials and so far. I have downloaded your current version of QTrack and it is very impressive, sure there are one or two improvements need - but hey , great work so far :) .
Thanks. :) The scripts are very basic at the moment, so if you miss something, please post it - at the moment I'm working on it, so perhaps I can "just implement" it. :)
One suggestion I have is that you include some user notes stating that you need to use the 'MaerklinCGleis' file to work with the QTrack extension.
The MaerklinCGleis is only useful if you have Märklin C-Gleis or just want to have a starting point for script checking - you can use QCTrack completely without it and build tracks for every system (as described in tutorial step 2 and 3, e.g. for Ninco slot car system or Fleischmann N scale).

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: model railroad track planning

Post by Clive » Fri Jan 09, 2015 11:21 am

smf wrote:The MaerklinCGleis is only useful if you have Märklin C-Gleis or just want to have a starting point for script checking - you can use QCTrack completely without it and build tracks for every system (as described in tutorial step 2 and 3, e.g. for Ninco slot car system or Fleischmann N scale).
Okay thanks for the explanation.

However there is an issue for me - I don't get the dialog window opening as you describe in step 2.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 11:44 am

However there is an issue for me - I don't get the dialog window opening as you describe in step 2.
Oh, tutorial 2 or step 2 in tutorial 3? The create-dialog should appear immediately after QCTrack / Create... :?

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 11:46 am

Tataaaa. :D

New version attached has icons with radius dependent background color in TrackWidget. :D Unfortunately, this slows down loading and refreshing "a bit", because the icon is always created from scratch. I will have to look at the item-db used in the library-browser...
Attachments
QCTrack_V66_TrackWidgetIconColor.zip
QCTrack version 66
(55.84 KiB) Downloaded 1725 times

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: model railroad track planning

Post by Clive » Fri Jan 09, 2015 11:54 am

smf wrote:Oh, tutorial 2 or step 2 in tutorial 3? The create-dialog should appear immediately after QCTrack / Create... :?
No Nothing for me On Windows 8.1, any ideas?
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 1:30 pm

No Nothing for me On Windows 8.1, any ideas?
Hm, I only use Linux, no Windows here... So the menu item is existing and clickable, but after clicking nothing happens? Could you please start QCad with the following options:

Code: Select all

qcad -rescan -enable-script-debugger
Perhaps the debugger tells us more.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: model railroad track planning

Post by Clive » Fri Jan 09, 2015 1:39 pm

smf wrote:Hm, I only use Linux, no Windows here... So the menu item is existing and clickable, but after clicking nothing happens? Could you please start QCad with the following options:
Same results for me in Linux Mint !
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Fri Jan 09, 2015 1:55 pm

:( Hm. :( No idea. The debugger does not pop up? :(

Just to ensure we are talking about the same thing, I recorded the behavor of "Create" with the current version as animated gif on my machine.
Attachments
CreateTest.gif
ScreenCast: create track
CreateTest.gif (770.58 KiB) Viewed 297090 times

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”