Get the length of multiple parts in assembly and push it onto BOM - VBA?

Get the length of multiple parts in assembly and push it onto BOM - VBA?

magicdl96
Advocate Advocate
972 Views
4 Replies
Message 1 of 5

Get the length of multiple parts in assembly and push it onto BOM - VBA?

magicdl96
Advocate
Advocate

Can anyone help me with VBA code so that I can get the length of each part in the assembly and create a column in the BOM table to bring it up. and can include descriptions in custom iproperties in the BOM table.

Thank You.

0 Likes
973 Views
4 Replies
Replies (4)
Message 2 of 5

johnsonshiue
Community Manager
Community Manager

Hi! If possible, please share the example (iam and ipt files) here. There should be a solution without having to use VBA. You can use iLogic. Without seeing the files, it is impossible to tell.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 5

magicdl96
Advocate
Advocate

I have attached the file.

i have idea get the lengths of all the parts (in the X and Y directions or Z).

in file have "solid1_same_1" and "solid1_same_2" are the same length and the qty is 2?

the same length i will set name the same ("solid1_same") and number for the solid ("_1,2,3,...").

I want to use VBA code because maybe I will convert it to VB.Net.

0 Likes
Message 4 of 5

tdant
Collaborator
Collaborator

The VBA in your case is pretty simple, but the tricky part will be determining what "length" means for each individual part. Is "length" always the longest of the three (x, y, z) dimensions? Are the parts always orthogonal to their axes? Do you want to program for the edge cases where those may not be true?

 

Once that determination is made, creating a BOM column for length will take 10 minutes of programming, which I would be happy to help you with.

0 Likes
Message 5 of 5

magicdl96
Advocate
Advocate

Yep.

Is "length" always the longest of the three (x, y, z) dimensions.

I dont want program for the edge cases, just length longest. and if possible I want the program to manually add columns for length ("Length") and quantity ("QTY"). maybe i need column "Unit" (mm).

Thank for you help.😉

0 Likes