Generate LDCad parts bin custom list.


Generate LDCad parts bin custom list.
#1
You can generate LDCad parts bin lists using this modified version of BrickUtils: BrickUtils-0.2.0.0(trev).jar, (.exe version).

Other modifications include the ability to create part-mappings. For a complete list of BrickUtils modifications see the ChangeLog.

This application is distributed under the terms of the GNU General Public License. You can download the source code here.

BrickUtils is free software developed by Mario Pascucci and is available on SourceForge.

For example, after importing bricklink .xml set into BrickUtils(trev)...

Following are the steps to generate a .pbg file (LDCad parts bin list):

   


.png   BrickUtils_02.png (Size: 7.54 KB / Downloads: 186)


.png   BrickUtils_03.png (Size: 6.86 KB / Downloads: 184)

   

   

Do not hesitate if you have any questions or remarks.

Cheers,
Trevor
Reply
Re: Generate LDCad parts bin custom list.
#2
Very handy indeed.

This is now (as far I know of) officially the first 3rd party support tool for my LDCad, thanks Smile
Reply
Re: Generate LDCad parts bin custom list.
#3
Trevor I'm trying to run this on Ubuntu, which .jar file is the one to start? I tried to create a runme.sh of a few but couldn't get it to go.
______________________________________________
OS = Ubuntu 14.04 LTS (64bit)
Reply
Re: Generate LDCad parts bin custom list.
#4
Hello Jason - sorry, the previous executable jar file contained only Windows library jars (gluegen & jogl), as it was the dev version ;-).

I have since updated the download jar. The current download now contains the full cross-platform compliment of library jars.

I suspect the missing linux platform glugen and gogl jars may have caused your issue. Please try the current download and let me know if you continue to have unexpected behavior.

To answer your question, start the BrickUtils-0.2.0.0(trev).jar file. The launch class is brickUtils.

java -jar <filename>.jar should do - I would rename the file:-).

Please note that I did not run/test on linux; however, I do not believe my updates would have impacted the original BrickUtils cross-platform compatability.

Cheers,
Trevor
Reply
Re: Generate LDCad parts bin custom list.
#5
You are welcome! LDCad is an excellent application.
Reply
Re: Generate LDCad parts bin custom list.
#6
Well it worked Smile Fantastic I must say.

The only issues I had was it wouldn't run until I renamed it, more specifically I had to remove the () from the file name. For some reason it ran after removing just those.

Then it just hung on downloading the LDraw library zips, it just sat at 0% forever. So I simply copied the two zips into the folder and it started right up.

I went through your steps above with a recent moc of mine and it all worked great.

Great work, thank you.
______________________________________________
OS = Ubuntu 14.04 LTS (64bit)
Reply
Re: Generate LDCad parts bin custom list.
#7
Excellent, you are welcome!

Cheers,
Trevor
Reply
Re: Generate LDCad parts bin custom list.
#8
I used your tool to build this http://forums.ldraw.org/showthread.php?t...0#pid15670 - very handy!
Actually the only thing I struggled with was downloading xml from Bricklink...

I initially expected LDCad to decrease part count as they are used in the model, but I realize now that it is far from obvious to do when using submodels!
Reply
Re: Generate LDCad parts bin custom list.
#9
I download my xml files from Rebrickable, that's a lot easier than Bricklink.
Reply
Re: Generate LDCad parts bin custom list.
#10
Philippe Hurbain Wrote:I initially expected LDCad to decrease part count as they are used in the model, but I realize now that it is far from obvious to do when using submodels!
That's a planned feature Smile
Reply
Re: Generate LDCad parts bin custom list.
#11
Hi Trevor,
I like this tool a lot, problem is that the database that makes the link between Bricklink and LDraw part numbers is no longer updated by Mario (see http://www.eurobricks.com/forum/index.ph...try2402478), any idea how this could be done?
Reply
Re: Generate LDCad parts bin custom list.
#12
Hi Philo,

I imagine if you follow the url in the settings window (BrickUtills update URL) - you can download the last copy of the mapping input xml file. Then you can update and host it as you want.

In fact here's the url https://sourceforge.net/projects/brickut...s/updates/.

Pointing BrickUtils to your URL should allow you to automate the import.

Perhaps it could be good to find a source (BrickLink ?) that could provide a consistent part mapping data feed - then it would not be too much to process for BrickUtils needs.

Cheers.
Reply
Re: Generate LDCad parts bin custom list.
#13
Mmhhh... I slowly start to understand things but...
Editing the xml is tedious at best. I have the feeling that the "Part Mapping" tab of Brickutils should be able to define new mappings but despite many attempts I can't figure out how it's supposed to work - Mainly how to add a new entry ???
Reply
Re: Generate LDCad parts bin custom list.
#14
Ah, good question. I remember when I added this functionality, I wanted to respect Mario Pascucci's original intent to keep the system closed. To this end, you cannot add mappings from the UI; instead, upon BrickLink XML dump import the application will automatically transfer unmapped parts to the Part Mapping tab. At this time, you have to functionality to 'manually' create mappings and save them to the database.

So one way to add new mappings is to create and import a BL XML dump formatted XML file with the parts '<ITEM>' you want to add. The format is pretty simple. Here is an example:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<INVENTORY>
   <ITEM>
      <ITEMTYPE>P</ITEMTYPE>         <!-- P=Regular Part             -->
      <ITEMID>2431</ITEMID>            <!-- Part Number                -->
      <QTY>2</QTY>                       <!-- Part Quantity              -->
      <COLOR>1</COLOR>                <!-- BrickLink Color Code       -->
      <EXTRA>N</EXTRA>                 <!-- Extra in set (Default=N)   -->
      <ALTERNATE>N</ALTERNATE>     <!-- Alternate Part (Default=N) -->
      <MATCHID>0</MATCHID>             <!-- Set Alternate (Default=0)  -->
      <COUNTERPART>N</COUNTERPART>  <!-- Part Assembly (Default=N)  -->
   </ITEM>
</INVENTORY>

Let me know if this helps.

Cheers,
Reply
Re: Generate LDCad parts bin custom list.
#15
Not yet completely sure to know what I am doing, but I was able to define a few new mappings, so I should finally get it... Thanks Wink
Reply
Re: Generate LDCad parts bin custom list.
#16
On a related note, I'm trying to track down a number of parts that don't have an LDraw ID in the imported brick list I get in the modded version of BrickUtils. What is the smartest way of gong about finding those references?

I'm looking at the WeDo 9580-1 set inventory and I'm missing a couple of minifig parts (heads and torso)
Reply
Re: Generate LDCad parts bin custom list.
#17
I click on column "LDraw ID" header. The table gets sorted by LDraw id and the missing ones are on top.
Reply
Re: Generate LDCad parts bin custom list.
#18
I know which ones I am missing. I was hoping for some pointers on how to located the correct LDraw reference for those parts.
Reply
Re: Generate LDCad parts bin custom list.
#19
Sorry, misunderstood your need. I have no good solution for your problem, except (perhaps) enter portions of description in LDFind...
Reply
Re: Generate LDCad parts bin custom list.
#20
OK. So I'm not really missing any obvious better methods. Thanks for confirming. The parts that are missing are not really important, I just thought I'd ask in case I this comes up again.
Reply
Re: Generate LDCad parts bin custom list.
#21
Hi,
I am unable to run both exe and jar versions of brickutils.
What do I need to run it?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#22
I use the exe version, and as far as I remember I did nothing special to get it work (Win 7 home, or win XP). Any error message?
Reply
Re: Generate LDCad parts bin custom list.
#23
Win XP.
Nothing happens. Starting the exe says am I sure to open a downloaded programm > Yes.
Few seconds activity, then nothing. No errors, no messages, no program started, not even in the task manager....
Strange.
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#24
??? Sad
Reply
Re: Generate LDCad parts bin custom list.
#25
Ok, I got the original jar file of SF for the last "official" version of BrickUtils and that one starts.
After downloading a lot of stuff, I can at least work with it (not that I know what to do yet)
The main reason I wanted to look into this is creating the custom part bins for sets.

Now why can I not run Trevor's version of the jar? Does it need additional files?
I see the original created a folder and made some files and downloaded a lot of stuff.
And why does the exe nothing?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#26
Not sure why it won't work on your system. I installed it on Windows 10 and on Windows 7 without trouble.
It did take quite some time to download files before the program was ready the first time and some of the window it opened were extremely well hidden behind other applications that were open at the time.
Reply
Re: Generate LDCad parts bin custom list.
#27
OK, so I closed all other programs. I have shotcut icon to the original version of brickutils jar file on my desktop.
When I click that a small popup shows the logo and Starting.... this takes a few seconds.
Then another pop up says checking Update site, takes a few sconds more en the brickutils starts up nice in a new window.

When I do this with the jar file Trevor made nothing happens. This file is in the same folder that the original is, so it could find all databases and stuff.

So I took a look in the taskmanager. When the original is loaden a process called javaw.exe is active.
When I start Trevors version with the taskmanager visible I briefly see this process being started and then it closes again.
It seems that a full startup is not working. I does something, but no errors show.

Any ideas?
I would love to be able to make a custom part bins for LDCad.... :-)
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#28
I ran into another curious issue:

I opened a new working list, imported an XML from the 45544-1 set and named it as per the pop-up dialogue.
I then modified the list to include missing elements and change a colour.
I then tried to export as LDCad Parts-bin set and get a pop-up window saying:

"Please add ste/lot/moc description"

No matter what changes I make I cannot get the set/lot/moc information to stick - each time I change the description I get the same error and each time I open the window to change it that window has no previous data.
Also, I cannot use the search function next to the Official set id field as the next window to open will not run the search (the top field never shows anything to choose from)

What am I missing?
Reply
Re: Generate LDCad parts bin custom list.
#29
Does anyone have a clue as to why Trevors version won't work on my system?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#30
On a related note, would it make sense to create a repository of .pbg files for sets?
Reply
Re: Generate LDCad parts bin custom list.
#31
Do you have Java installed?
Reply
Re: Generate LDCad parts bin custom list.
#32
Jetro de Château Wrote:Do you have Java installed?

Sure. The original BrickUtils runs fine.
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#33
Would there be another way to create a pbg file?
The inventories are on Bricklink or Rebrickable, right?
Can we not create it another way?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#34
Installed it on a different system and works fine. Maybe I should simply delete it entirely and start afresh...
Reply
Re: Generate LDCad parts bin custom list.
#35
You can do it manually, following the file specs, but that's tedious work.
Reply
Re: Generate LDCad parts bin custom list.
#36
Trevor Sandy Wrote:[attachment=1456]

Hmm, looking at this I think it would be possible to create a pbg file manually using a dump from Bricklink or Rebrickable and with some Excel work perhaps. I'll try some things...
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#37
I've found that Brickutils will not apply the correct colour for some elements. I applied metallic silver for the castor ball in the EV3 set and when I checked the file the number that came out was -1
I also cannot set rubber colours in Brickutils so I did that manually
Reply
Re: Generate LDCad parts bin custom list.
#38
OK, I've succesfully created a pbg of an official set by hand. Using an inventory on Brickset I copied to Excel and create the right format of the text. It was actually not that hard or much work, though I have to add the ribbed hoses and tubes.

Code:
[options]
kind=basic
caption=Set 8246
description=Parts in the 8246 set
picture=8246.png
sortOn=description

<items>
2780.dat:[color=0] [count=2]
2825.dat:[color=0] [count=2]
2905.dat:[color=14] [count=2]
3069bp28.dat:[color=0] [count=1]
32000.dat:[color=71] [count=1]
32013.dat:[color=0] [count=2]
32013.dat:[color=14] [count=2]
32014.dat:[color=0] [count=2]
32039.dat:[color=0] [count=2]
32062.dat:[color=0] [count=1]
32063.dat:[color=0] [count=2]
32068.dat:[color=71] [count=1]
32073.dat:[color=0] [count=3]
32123b.dat:[color=71] [count=3]
32125.dat:[color=4] [count=1]
32138.dat:[color=14] [count=1]
3482.dat:[color=0] [count=3]
3705.dat:[color=0] [count=3]
6558.dat:[color=0] [count=3]
6589.dat:[color=71] [count=2]
85543.dat:[color=15] [count=2]
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#39
Rebrickable has a lot of export options for inventories and parts lists. Maybe they'd like to include LDCad's pbg format too. I'll ask Nathan (from Rebrickable) to see what he thinks Smile
Reply
Re: Generate LDCad parts bin custom list.
#40
Merlijn Wissink Wrote:Rebrickable has a lot of export options for inventories and parts lists. Maybe they'd like to include LDCad's pbg format too. I'll ask Nathan (from Rebrickable) to see what he thinks Smile
Oh, that would be nice :-)
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#41
Don't know if this has been posted before, but would it be nice to have a PBG repository too?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#42
"though I have to add the ribbed hoses and tubes."

You can add templates to pbg's too. See for example the 8071.pbg in the sets folder:

-------

[options]
kind=basic
caption=Set 8071
description=Parts in the 8071 set
picture=8071.png
sortOn=description


<items>
path\rigid3mmHose.ldr:[sourceInv=templates] [color=0]
3623.dat:[color=0] [count=2]
2444.dat:[color=0] [count=4]
61409.dat:[color=0] [count=2]

-------


Ps: disabled bbcode as it messes with the [ ] properties.
Reply
Re: Generate LDCad parts bin custom list.
#43
See above Big Grin

Jetro de Château Wrote:On a related note, would it make sense to create a repository of .pbg files for sets?
Reply
Re: Generate LDCad parts bin custom list.
#44
In my opinion: no.

I mean, it's just a bunch of set inventories structured in such a way LDCad can use it. We don't have any repositories for .xml inventories, .bsx inventories or whatever other format because it's all the same; just another format with the same data.

With the right program, it's as easy as choosing a set and pressing a button to get a .pbg file. We don't need a repository for that imho.
Reply
Re: Generate LDCad parts bin custom list.
#45
I agree that a good export function from any inventory website would be much better! Remains the problem of matching database nomenclature between both systems (LDraw vs. inventory website)
Reply
Re: Generate LDCad parts bin custom list.
#46
That's true. Although Rebrickable (which I mentioned earlier) already has a pretty good Lego part # > LDraw part # database in place, including a lot of patterned parts. It's probably not complete and fully up to date (yet?), but it's a pretty good start nonetheless.
Reply
Re: Generate LDCad parts bin custom list.
#47
Merlijn Wissink Wrote:We don't have any repositories for .xml inventories, .bsx inventories or whatever other format because it's all the same; just another format with the same data.

With the right program, it's as easy as choosing a set and pressing a button to get a .pbg file. We don't need a repository for that imho.
If only Big Grin
There are XML repositories (like Bricklink and ReBrickable), but the conversion process is far from "easy".

Philippe Hurbain Wrote:I agree that a good export function from any inventory website would be much better! Remains the problem of matching database nomenclature between both systems (LDraw vs. inventory website)
And that's exactly my point. There are a lot of mismatches, but that's not the only ting.
Yesterday I tried to create a .pbg file for the 45544-a EV3 Core set and I ran into a number of more or less important issues:
  • I tried both Bricklink and ReBrickable. Bricklink turned out to have the most complete information - there were more gaps in the LDraw conversion list with ReBrickable than with Bricklink
  • A considerable number of elements do not have any mapping to their LDraw counterparts. For the most part conversion is straightforward and the Bricklink number can be used adding .dat. However, you need to check case by case since it doesn't always work and sometimes there are surprising mismatches. (e.g. the 25cm EV3 wire is BL ID bb601, LDraw ID 11145.dat
  • Colours information is not reliable either. All the EV3 electronics were referenced as black when they are white and rubber elements were simple black, wires were black, but LDCad knows they are black and requires trans to be set for the connectors...
  • Colour assignment in brickutils is incomplete as it doesn't allow for rubber colours and gave me an error with metallic (256 became -1)
  • Not every part is really a part:
    Roland Melkert Wrote:You can add templates to pbg's too
    This of course also requires tweaking the set. Many Technic sets would benefit from having templates included rather than a part reference to e.g. a Power Functions motor.
  • Ultimately, it would be really cool of LDCad included a feature that allowed for easy access to single set element sets. Not by manually modifying some files in the %appdata% directory, but through a menu in the interface. Imagine the option to load or add a set from a menu so the set is displayed under root/sets/<setnumber>. To make this accessible to the average user (not simply those of us who like to play around with progam settings and are not scared of digging into configuration files) easy access to correctly formatted part lists for specific sets woud be an important asset.
Reply
Re: Generate LDCad parts bin custom list.
#48
Jetro de Château Wrote:Ultimately, it would be really cool of LDCad included a feature that allowed for easy access to single set element sets. Not by manually modifying some files in the %appdata% directory, but through a menu in the interface. Imagine the option to load or add a set from a menu so the set is displayed under root/sets/<setnumber>. To make this accessible to the average user (not simply those of us who like to play around with progam settings and are not scared of digging into configuration files) easy access to correctly formatted part lists for specific sets woud be an important asset.
pbg gui editing is something I have in the pipeline, which should at least make it easier. I could also add a .pbg file drop handler which offers to copy the dropped file to e.g. the sets folder.
Reply
Re: Generate LDCad parts bin custom list.
#49
Found it, Roland! My PBG of set 8246 is now complete.
Building it in LDCad now took less then 25 minutes... :-)
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Generate LDCad parts bin custom list.
#50
Brickstock is usually helpful with that. However, it is not 100% perfect either and - even worse - the author does not communicate at all. I tried to contact him on Bricklink (he prefers that according to his own words) and e-mail and he did not reply me a word. Even I asked for such basic things like program sources. De facto, this is a GPL license violation...
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)