To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 5519
5518  |  5520
Subject: 
Re: Searching for parts
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 6 Nov 2000 16:44:17 GMT
Viewed: 
2047 times
  
In lugnet.cad.dev, Lars C. Hassing wrote:

According to FAQ question 26, LDraw searches for files in the following order:
1.The current catalog.
2.The P catalog.
3.The PARTS catalog.
4.The MODELS catalog.

The FAQ is not quite correct.  Step #1 should be last, not first.

Strictly speaking, LDraw 'searches' by trying to access files, named as
follows.  (This is taken directly from the LDraw code).

'p/' + <filename>
'parts/' + <filename>
'models/' + <filename>
<filename>

Where <filename> is the file specified either on the LDraw command line, or
in a subfile command (linetype 1).

Notice that *all* references are relative to the current directory.  The
only way to get out of the current-directory tree is to put an absolute
path in the <filename>.

L3P/L3Lab search in the above order, with the addition:
5. The catalog of the model  [1]

This is a good thing.

I'm noticing a difference between the way L3Lab renders and the way LDLite
renders.  I've got a multi-file model in a subdirectory, but there are some
files with the same name in the ldraw/models/ directory.  L3Lab renders the
way I want it to :) , but LDLite doesn't. :(

IIRC LDraw/LEdit MUST be started from the LDraw directory to work.
So for LDraw/LEdit step 1 is always the LDraw directory!

True.  Besides the issue with finding the part directories, LDraw needs to
load its graphic drivers, and it looks in the current directory for them.

Maybe "the current catalog" actually means the Ldraw directory?

It might actually be more accurate to say "Request <filename> from the file
system, without specifying any extra path information".  Whether the file
is in the current directory depends on the contents of the <filename>
reference.

If so, I have misunderstood "the current catalog" because I have
programmed L3P (and L3Lab) to actually use the current working
directory from where L3P is started.

Are you specifically looking in a specific directory, or are you allowing
the OS to track the 'current directory'?

And this is why LDRAWDIR is needed for L3P!

So, should I change step 1 to be the LDraw directory?

No, I don't see any point to that.  Long-term, LDraw rendering programs
should (generally) be searching:

1. The document's directory
2. %LDRAWDIR%\p
3. %LDRAWDIR%\parts

ldraw\models should become much less important, over time.  Users should be
able to store their model files whereever they like.

Having ldraw\models is convenient, because you can put unofficial parts
there (and not disturb the 'official' files in \parts and \p), or use it as
a temporary location for other people's models, or even put standard
submodels in it.

I agree with Travis Cobbs that step 5 should be the first step.
Will this have any side effects?

Yes, any same-name files will be taken from the document's directory,
instead of one of the standard directories.  This is generally a good
thing.

Steve



Message has 1 Reply:
  Re: Searching for parts
 
(...) Really! (...) The very first place to look is inside the model-MPD... (...) Indeed, but we've just learned that P, PARTS and MODELS come first. So step 1 is not the first step, but comes after step 4. (...) It happens automatically, I simply (...) (23 years ago, 7-Nov-00, to lugnet.cad.dev)

Message is in Reply To:
  Re: Searching for parts
 
According to FAQ question 26, LDraw searches for files in the following order: 1.The current catalog. 2.The P catalog. 3.The PARTS catalog. 4.The MODELS catalog. L3P/L3Lab search in the above order, with the addition: 5. The catalog of the model [1] (...) (23 years ago, 5-Nov-00, to lugnet.cad.dev)

10 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR