How to determine whether a file is a part or a subpart


Re: How to determine whether a file is a part or a subpart
#3
Official parts will have a 0 !LDRAW_ORG Part meta-statement. To the best of my knowledge all official parts will contain this meta-statement, and furthermore, all official files that contain this statement will be parts (not sub-parts or primitives). Having said that, many official parts are simply references to another file, which is also a part. In the context of a model that uses the first file, that instance of the second file isn't a part; it's a sub-part. So you have to have a run-time rule that state that in order to be a part, none of the file's ancestors can be a part. Or, probably easier, once you find a part, you know all its children aren't parts.

Unofficial parts are harder to recognize. LDView looks for quite a few different things when deciding if something is an unofficial part. I don't remember all of them off the top of my head, but it definitely looks for common meta-statements, as well as paying attention to the directory the file came from. I believe that it is set up so that if a file is loaded from a parts directory, it is considered to be a part if none of its ancestors was a part.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: How to determine whether a file is a part or a subpart - by Travis Cobbs - 2015-06-29, 4:23

Forum Jump:


Users browsing this thread: 1 Guest(s)