SubFile resolving - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html) +--- Thread: SubFile resolving (/thread-9772.html) |
SubFile resolving - Jan Jirout - 2013-08-26 Hello, I'm trying to write simple program that parse .dat files and build tree representation of LDraw model in memory. I have problem to read some sub file references. For example line: Code: 1 16 290 0 230 1 0 0 0 1 0 0 0 1 stud.dat Thanks Jan Re: SubFile resolving - Travis Cobbs - 2013-08-26 The file stud.dat is a primitive, and is in the p/ subdirectory of the LDraw parts library. File loading in LDraw involves a kind of search path. The standard search path is as follows:
If your project is in C/C++, you might consider using's Lars C. Hassing's LDrawIni code to find sub-files. (LDView uses this.) Re: SubFile resolving - Roland Melkert - 2013-08-26 stud.dat is a primitive, those live in the "ldraw/p/" subfolder. When resolving any type 1 line you need to fist look into the file's own folder, if it's not there look in "ldraw/parts/" if also not there look into "ldraw/p/". If still not found it's a missing file or the user needs to supply additional search paths to your program. Also if the file is an MPD document, you need to search the "0 FILE " lines before searching the fs. hope this helps. [edit] Travis was a bit quicker Re: SubFile resolving - Jan Jirout - 2013-08-27 Thanks you both for reply, it helps me to move forward. But I'm still struggling with following. When I look at file: Code: <LDraw Dir>/parts/10.dat Code: 1 16 290 0 230 1 0 0 0 1 0 0 0 1 stud.dat Thanks Jan Re: SubFile resolving - Max Martin Richter - 2013-08-27 As written by Roland and Travis, this file must be in <LDraw Dir>/p folder. There are many other primitives, too. You can try to redownload the complete package... Unfortunately I am writing on my phone, so that I can't give you the link. /Max Re: SubFile resolving - Jan Jirout - 2013-08-27 Thanks, it was my fault. For some reason I don't have "stud.dat" in my <LDraw Dir>/p directory. I found this file is in downloaded complete.zip. Thanks Jan Re: SubFile resolving - Travis Cobbs - 2013-08-27 The parts library update zips only work if you already have the previous version installed. In other situations, it's best to just go with complete.zip. |