Discussion Forum: Thread 316964

 Author: Blooper_trooper View Messages Posted By Blooper_trooper
 Posted: Feb 9, 2022 05:10
 Subject: Obtain item dimensions in 'cm' through API
 Viewed: 54 times
 Topic: Technical Issues
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

Blooper_trooper (59)

Location:  Sweden, Västra Götaland
Member Since Contact Type Status
Dec 25, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: Phax Bricks
Through the 'Get item' method I can receive the dimensions of an item,
but this only seem to return the field 'Stud Dim.'. However in the catalog
entry of an item when viewing it on BrickLink, there is another field called
'Pack. Dim.', which expresses the size in cm. Does anyone know if it
is possible to obtain this data through the API?

Any help is greatly appreciated!
 Author: Hurt View Messages Posted By Hurt
 Posted: Feb 9, 2022 06:06
 Subject: Re: Obtain item dimensions in 'cm' through API
 Viewed: 32 times
 Topic: Technical Issues
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

Hurt (642)

Location:  Austria, Wien
Member Since Contact Type Status
Aug 10, 2015 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: BricksHurt
In Technical Issues, Blooper_trooper writes:
  Through the 'Get item' method I can receive the dimensions of an item,
but this only seem to return the field 'Stud Dim.'. However in the catalog
entry of an item when viewing it on BrickLink, there is another field called
'Pack. Dim.', which expresses the size in cm. Does anyone know if it
is possible to obtain this data through the API?

Any help is greatly appreciated!

Never used the API, but couldn't you just multiply the first two values by
0.8 and the third value by 1.14 in your code?
 Author: Blooper_trooper View Messages Posted By Blooper_trooper
 Posted: Feb 9, 2022 06:40
 Subject: Re: Obtain item dimensions in 'cm' through API
 Viewed: 27 times
 Topic: Technical Issues
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

Blooper_trooper (59)

Location:  Sweden, Västra Götaland
Member Since Contact Type Status
Dec 25, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: Phax Bricks
In Technical Issues, Hurt writes:
  In Technical Issues, Blooper_trooper writes:
  Through the 'Get item' method I can receive the dimensions of an item,
but this only seem to return the field 'Stud Dim.'. However in the catalog
entry of an item when viewing it on BrickLink, there is another field called
'Pack. Dim.', which expresses the size in cm. Does anyone know if it
is possible to obtain this data through the API?

Any help is greatly appreciated!

Never used the API, but couldn't you just multiply the first two values by
0.8 and the third value by 1.14 in your code?

I was thinking about doing something like that, but it seems like different categories
of pieces have different format for stud dimensions. For example a 1x4 slope
is written as '4 x 1 x 1 in studs' while a 1x4 brick is written as '1
x 4 x 1 in studs'. While I guess I could write specific rules for each category
there might be tons of edge cases, which in turn might make it not feasible.
I want to use this for a storage management solution so I might end up using
the stud dimensions, like you said, for common parts, and weight as a rough indicator
of size for other parts.
 Author: SylvainLS View Messages Posted By SylvainLS
 Posted: Feb 9, 2022 07:43
 Subject: Re: Obtain item dimensions in 'cm' through API
 Viewed: 27 times
 Topic: Technical Issues
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

SylvainLS (46)

Location:  France, Nouvelle-Aquitaine
Member Since Contact Type Status
Apr 25, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: BuyerOnly
BrickLink Discussions Moderator (?)
In Technical Issues, Blooper_trooper writes:
  In Technical Issues, Hurt writes:
  In Technical Issues, Blooper_trooper writes:
  Through the 'Get item' method I can receive the dimensions of an item,
but this only seem to return the field 'Stud Dim.'. However in the catalog
entry of an item when viewing it on BrickLink, there is another field called
'Pack. Dim.', which expresses the size in cm. Does anyone know if it
is possible to obtain this data through the API?

Any help is greatly appreciated!

Never used the API, but couldn't you just multiply the first two values by
0.8 and the third value by 1.14 in your code?

It’s not Zx1.14, it’s 0.96xZ+0.18 (approximately, and it’s 0.16 for hollow &
open studs).


  I was thinking about doing something like that, but it seems like different categories
of pieces have different format for stud dimensions. For example a 1x4 slope
is written as '4 x 1 x 1 in studs' while a 1x4 brick is written as '1
x 4 x 1 in studs'. While I guess I could write specific rules for each category
there might be tons of edge cases, which in turn might make it not feasible.
I want to use this for a storage management solution so I might end up using
the stud dimensions, like you said, for common parts, and weight as a rough indicator
of size for other parts.

And a Duplo stud/brick is twice a System stud/brick.

And protrusions (bars, clips…) aren’t included:
 
Part No: 60470b  Name: Plate, Modified 1 x 2 with 2 Open O Clips (Horizontal Grip)
* 
60470b Plate, Modified 1 x 2 with 2 Open O Clips (Horizontal Grip)
Parts: Plate, Modified
is 1x2 in studs
(and a plate, so the third dimension is ⅓, while it’s 1 for bricks).

Conclusion: You can’t accurately or systematically get the packing dimensions
from the dimension in studs.  That’s why they are entered separately and why
some parts have one but not the other.