Inserting Parts into an Assembly Following a Sequence

Hi all

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:)

Thank you!

Oops, small layout problem! Here is the image: 

 


suiteinsertion.jpg
Hello, what is the question exactly? Automating this with a macro is possible and easy if the lengths are known.

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.

I think the problem is to create constraints between the parts so that if they evolve, the assembly follows.

I imagine the 3 pieces have no connection with each other: it's not a simple change of dimension that makes you go from one to the other.

No, no, let's imagine that each part represents a specific process. They have no links with each other except that they have to be behind each other.

1 Like

So it's possible with SolidWorks.

You need to use AddComponent5 to insert a part, an example is available here:

http://help.solidworks.com/2013/english/api/sldworksapi/Add_Component_and_Mate_Example_VB.htm

Then AddMate3 to constrain it, an example is available here:

http://help.solidworks.com/2011/English/api/sldworksapi/Add_Distance_Mates_Example_VB.htm

Edit:

For a SolidWorks Excel link, see these links:

http://www.lynkoa.com/forum/autres/vba-excel-pour-solidworks

http://webcache.googleusercontent.com/search?q=cache:YB6dOOlqCUsJ:www.cadsharp.com/blog/using-microsoft-excel-with-the-solidworks-api/+&cd=1&hl=fr&ct=clnk&gl=fr

Google's cached version for the latter link, as the site returns an error.

1 Like

Hello

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! :)

2 Likes

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:)

Wanting to automate this with a macro and limit developments seems contradictory to me!
2 Likes

@.PL, we misunderstood each other, indeed I want to automate the insertion of parts but limiting the use of macros all the same to have flexibility.

I know that I will need to do some macros and the previous links will help me preciously, but I want to simplify before the process.

Isn't the easiest way to do the assembly of the "blocks" directly on SW???

Do your "blocks" represent machines, single parts, diagrams?

Hello

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.

http://help.solidworks.com/2015/french/solidworks/sldworks/c_configuration_publisher_top.htm

 

@+

 

 

2 Likes

@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!

Won't Piloy Assembly MyCAD Tool Be Able To Do Business

http://www.mycadblog.fr/wp-content/uploads/2015/03/Pr%C3%A9sentation-des-utilitaires-2015.pdf

@+ ;-))

 

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. . . .