TrueDimensions

How to determine if a part is printed?

Recommended Posts

There doesn't appear to be any response data associated with any of the API calls to determine if a part is printed or not.

Is there? Or do we just use the naming convention to determine this? IE. any part with px000, pe000, pr000, pb000, p000 is printed? Is that a safe assumption?

Along the same lines, in the regular web interface for searching parts there is an 'Include Printed Parts' filter that can be applied. Is there any way to apply a similar filter when using the '/api/v3/lego/parts/' api call?

No real worries if this isn't part of the API. Just wanted to make sure I'm not missing anything.

J

Share this post


Link to post
Share on other sites
Posted (edited)

it should be safe to check for a "p" in the part id, if the id start with a number. I don't think we will reach "p" in molds and if we do we probably should skip that letter...

for parts with just a name and such as pouch and pillow might be printed but you will not know with any simple logic.

Not sure if the word "print" is used in all part descriptions for those.

Edited by biodreamer

Share this post


Link to post
Share on other sites

Every part with a print should have a print relation. I’m sure there’s some that slip through the cracks. However I do not know how relations present themselves in the API. 

Share this post


Link to post
Share on other sites

The Include Printed Parts filter relies on the part relationships. The /lego/parts/{part_num}/ api shows these in the prints, molds, and alternates fields... but you are correct in that they do not show the reverse relationships. So you can see the prints of a part, but not if a part is a print of another part.

I will look at adding some extra fields for this.

Share this post


Link to post
Share on other sites

I've added a print_of field to the part detail view which should help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now