LDraw.org Discussion Forums

Full Version: Announcing mklist2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi all,

Following recent discussion on changes to the parts library (specifically new leading characters for aliases and longer filenames) I've written a new version of mklist to ensure that backwards compatibility can be maintained, while also giving a little more power to the users.

Features not appearing in mklist are:
  • Ensure <=64 character titles using a shortening technique
  • Ignore parts with user supplied leading characters (eg. =, _)
  • Strip off leading characters (eg. ~)
  • Remove parts with duplicate names (experimental feature)

The code is also open source so it can easily be modified in future.

Find it here with a pre-compiled Windows executable. The code itself is exceedingly basic C++ so should compile on any OS using a gnu (or compatible) compiler with minimal changes.

Tim
Dear Mr. Gould,

since you've put much effort and knowledge in the creation of this program - for which I'm eternally thankful - I would humbly suggest that you go all the way. May I suggest that:
  • You add a user-friendly GUI with checkboxes for the different options.
  • Add the possibility to sort out also Unofficials based on the 0 !LDRAW_ORG meta, which might be helpful for all those who simply dump everything into the Parts and P folder and do not work with Unofficial\Parts, Unofficial\Parts
  • Write a deep tech tutorial with just a little bit more information as one can find in the current help, explaining what the [C] stands for, why there are quotes in "mklist2 -d -h=_ -1~" and to what it leads to ripping the ~ character from the description.
  • Add a feature which will place all pattern versions at the end of say "Bricks" or "Plates" bases on the p character in the part number and also sorted by description or number in order to have:

    Brick 1x1
    Brick 1x2
    Brick 2x2
    Brick 1 x 1 with Angry Eye Left/Sad Eye Right Pattern
    Brick 1 x 2 with Classic Space Logo Pattern

  • May I further suggest a name change and in the spirit of the LDraw System of Tools call it LDList, or LDPartsListMaker, or ...

Yours sincerely,

w.
Thanks Willy,
  • You add a user-friendly GUI with checkboxes for the different options.

    This is a bit difficult for me to do as I really don't have the tools to write a GUI. That said the code is out there so for someone who did it would be very straightforward to process.

  • Add the possibility to sort out also Unofficials based on the 0 !LDRAW_ORG meta, which might be helpful for all those who simply dump everything into the Parts and P folder and do not work with Unofficial\Parts, Unofficial\Parts

    Processing that line is on my todo list but will require a bigger change. It will happen though.

  • Write a deep tech tutorial with just a little bit more information as one can find in the current help, explaining what the [C] stands for, why there are quotes in "mklist2 -d -h=_ -1~" and to what it leads to ripping the ~ character from the description.

    I shall. Actually I think all these could be illustrated neatly with an example.

  • Add a feature which will place all pattern versions at the end of say "Bricks" or "Plates" bases on the p character in the part number and also sorted by description or number in order to have: Brick 1x1, Brick 1x2, Brick 2x2, Brick 1 x 1 with Angry Eye Left/Sad Eye Right Pattern, Brick 1 x 2 with Classic Space Logo Pattern

    Interesting thought. I'll have a think about how this might be implemented but I can't think of a trivial way to do so, or for that matter any way that's not highly complicated. Unless... they have more info in the header. (eg. Part_Patterened).

  • May I further suggest a name change and in the spirit of the LDraw System of Tools call it LDList, or LDPartsListMaker, or ...

    This is a good idea. I will rename it.
[*] Add a feature which will place all pattern versions at the end of say "Bricks" or "Plates" bases on the p character in the part number and also sorted by description or number in order to have: Brick 1x1, Brick 1x2, Brick 2x2, Brick 1 x 1 with Angry Eye Left/Sad Eye Right Pattern, Brick 1 x 2 with Classic Space Logo Pattern

Interesting thought. I'll have a think about how this might be implemented but I can't think of a trivial way to do so, or for that matter any way that's not highly complicated. Unless... they have more info in the header. (eg. Part_Patterened).

I have an idea now.

Tim
+1 for this feature
Another interesting possibility (already present in an Arezey tool) is to give the possibility to add primitives to the list. Useful for parts authors...
And one would need them also for LSYNTH bent parts generation...

To me, the files where LSYNTH generates bent parts from are primitives.

I find it not a good idea to put them into Parts just to see them im MLCad.
One can see them there as well when adding the "P" folder to mlcad.ini,
and creating a custom parts tree entry for LSYNTH.
I'd prefer to see these become primitives.
Worked some more on it. 0.9.2

Changes
  • Renamed to LDList
  • Can now strip unofficial files (see comment later)
  • Can sort patterns to the end of parts.lst. Doing it as Willy asked is just too hard for now but the current version should ensure MLCad shows them last
  • Can include primitives in Parts.lst

Stripping unofficial files is presently crude. I plan to write a better way to get all the part header info. One further question though: should this happen by default and be switched off or vice versa?
Quote:Renamed to LDList
I suggest you edit the title of this post to "LDlist update 1" and make things clear Wink
Quote:Can include primitives in Parts.lst
Thanks! unfortunately I can't run ldlist on this machine (XP), after a relatively long run it quits with a "ungetc failed" message. Parts.lst is not created. Anything I can do to find problem origin? (it's quite possible that I have a very queer file in my LDraw folder!)?
Quote:should this happen by default
I see no reason to strip unofficial files by default!
Another very minor quirk: compression in your zip file is not managed by XP integrated unzipper.
Quote:Thanks! unfortunately I can't run ldlist on this machine (XP), after a relatively long run it quits with a "ungetc failed" message. Parts.lst is not created. Anything I can do to find problem origin? (it's quite possible that I have a very queer file in my LDraw folder!)?

That's kind of strange. If you have a file that's less than 4 lines long I can see it potentially having problems but I don't see why it would exit with that error. But C file input can be pretty odd and I've had to avoid the default line processing to make sure it works for newline in DOS or unix format.

I've uploaded a 0.9.3 executable to narrow down the file with the problem. If you could send me the file I'll see what's going wrong.

Tim
Pages: 1 2 3