I put the question under "Solidworks" because I know many of you are on this software, but this question might be suitable for other parametric 3D CAD software.
Let's imagine, I have 3 pieces (A, B, C), these 3 pieces have the same width, the same thickness but different lengths:
I want the CAD software to read an Excel file (via a macro but which is not the order of my question) and to be able to insert parts in my assembly according to the order described in Excel.
For example, in the Excel file and via macros, I get the sequence " C, A, B "
How could the CAD software insert these blocks one after the other?
I had imagined that all the parts would be inserted at the point of origin of the assembly, C would be inserted 1st on the original, then that A would have its origin offset by the length of block C, then B would be offset by the lengths " A + B ".... But in this case, I would have no "link" between the parts, no constraint would attach part A to room C.
As usual, I'm quite vague in my explanations so don't hesitate to ask me questions to understand mine:)
Yes, how can we automate the insertion of these parts? Knowing that the lengths of these documents will be indicated in the same Excel file as the one that fills in the following.
If you go through an Excel sheet, you can have the length of your "blocks" A, B, and C.
So via the macro, insert your new component by putting a coincidence constraint of the RIGHT planes (of the previous element and the new one), coIncidence for the TOP planes and finally the distance between the FACE planes of a value of (A+B)/2.
Assuming your origin is centered in your 3Ds like any good CAD file! :)
Thank you @.PL, I'm going to look at all these links on VBA programming, however we try to limit developments of this type as much as possible (simplifying a lot of LISP programs by using software like Solidworks or Inventor).
Nevertheless, these links are very very interesting for when I start my training on this subject!
@Benoit.LF, this is exactly the strategy I tried to explain in the attached image, it reassures me in any case on the way to go:)
Another solution is to position the elements by the XYZ coordinate system and set them as a constraint reference, so that each element lands in the final assembly in one click.
For the length question you just have to make an excel of the part family and declare varaible with the "Configuration Publisher" see help below.
@Benoit: These "blocks" represent machined parts where a fluid passes, each block has different machining depending on the desired characteristics (pressure, speed, friction, ...). The blocks are put end to end so that the fluid passes from one block to another changing these characteristics.
@Coyote: Thank you for the constraints references that I didn't know about Solidworks, this will indeed be part of the ;) procedure!
If I understand correctly, your blocks are primatic, so the assembly constraints are simple.
So a macro with the elements of .PL should work well, since you know the last inserted block.
If tomorrow your blocks evolve in length, the assembly will follow without any other manipulation unlike the assembly according to their length at the time T (unless the constraint calls for the length dimension, but it will be complicated).
@gt22, thanks for the info, I'm going to get closer to Axemble to get more information about this utility!
@stefeno, yes that's exactly it, so I'm thinking of going with this strategy:
Let be the sequence "A, C, D, A",
The macro inserts block A at the origin, and then inserts block C behind block A (let's imagine planes created on each block, one from the beginning and one from the end), so I have a constraint between the end plane of block A and the beginning plane of block C. And so on, block D will be hooked to block C via the planes, etc. . . .