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 / 5504
5503  |  5505
Subject: 
Searching for parts
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 1 Nov 2000 09:27:56 GMT
Viewed: 
2990 times
  
Awhile back there was a thread about seams, subparts, and relations between
them with respect to L3P and L3Lab.  After a great deal of confusion on my
part about what was causing the problem, I had an e-mail conversation with
Lars Hassing which finally got things settled for me about what was going
on.

The thing to realize here is that I could not reproduce the problems people
were experiencing in either L3Lab or my own program, LDView.  The reasons
for this turned out to be related.  As it turns out, L3Lab only produces
seams between subparts in a part if you do the following:

1. View the actual part which contains subparts, and not some model which
contains that part.  This was fairly obvious from the posts.
2. Specify the filename on the command line.  This was not obvious to me
from the posts.  However, they were talking about L3P, and files are always
specified on the command line there.  So, while L3Lab uses the same loading
code, the results turn out to be different when a file is loaded via L3Lab's
UI.

The reason turns out to be the search order that L3Lab uses when looking for
submodels.  The first place it checks is the current directory.  The last
place it checks is the main model's directory.  (In between it checks the
LDraw P, Parts, and Models directories.)  When you open a file in L3Lab
using the UI, it changes to the directory containing that file, although
there is know way for the user to know this.  This means that if you open a
part, subparts will be found in step 1.  If, however, you specify the
filename on the command line, it doesn't change to the file's directory,
meaning that subparts get found when it searches the LDraw parts directory,
thus qualifying as a part, and producing seams.

LDView doesn't ever get into this situation because I always change to the
directory containing the main file, whether it is specified on the command
line, via a dropped file, or via the standard Open Panel UI.  I noted to
Lars that checking the model's directory immediately following the current
directory would resolve the seams problem.  He thought perhaps people in
this group might have some comments.

So, I'm posting this for two reasons.  First, I'd like to know what people
think with regards to L3Lab and LDView.  Since both of these are Windows
viewers, their behavior should ideally be the same for consistency's sake.
It is my belief that, given that Windows programs don't normally have much
concept of a current directory from the user's point of view, having the
"current" directory always be the model's directory makes sense.  This is
the current behavior of LDView, and also of L3Lab when a file is opened
using the Open Panel UI.

However, given that L3P is a command line tool, the current directory has
more meaning.  I still lean toward the belief that the model's directory
should be searched before any of the standard LDraw directories, but this
means that custom part files in the model's directory would override the
same part files subsequently installed in the LDraw parts library.
Currently if you run L3P from the model's directory, you already get this
behavior.  It's my opinion that it is more consistent, but others may
disagree.

Any comments?

--Travis Cobbs (tcobbs@san.REMOVE.rr.com)



Message has 2 Replies:
  Re: Searching for parts
 
(...) Sounds like the only way out of your dilemma is for the programs to be smart enough to recognize that the current directory *is* the ldraw\parts\ directory, and proceed accordingly. Steve (23 years ago, 1-Nov-00, to lugnet.cad.dev)
  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
    

Custom Search

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