Several file formats can be imported into SolidWorks but some are more effective than others. When you have the choice between multiple formats, you should pick the best one: the one which contains the most information. One should not just simply import a model into SolidWorks, there are good importation practices to follow.
In this article we will assume that you already have a components database. If you don’t, you should take a look at the article about the Folders Structure. Sure it takes time to do things properly but it has to be seen as an investment, everything you do now will save a lot of time for the next person that needs to use this component.
Most of the time you are importing a model from a vendor website, so the component will have to go in the components database as it is not a custom part or assembly specific to the project.
- After you have selected a component for your design, the first thing to do before even thinking of downloading a CAD model is to look into the components database and verify that this component doesn’t already exist. You don’t want to spend time to do something that is already done. Searching for a component is not that easy with Windows Explorer. It is more convenient to use PDM or SolidWorks Explorer because you can search for specific properties. Since you know the vendor reference, you can just search for it in the database. See the article about the Search possibilities.
- If the CAD model is not already into the database, you will have to download it. If it does not exist on the manufacturer’s website, try CADenas, traceparts, GrabCAD, etc… If you can’t find it anywhere you will have to model it yourself the old way or you can use the tricks described in the article Sketch From 2D.
- If the component can be downloaded you will have to choose a file format and do some tweaks.
Native SolidWorks files vs neutral CAD files
You should avoid downloading native SolidWorks files. The simpler the construction tree is, the faster the component get resolved by your computer. It will be really noticeable in your big assemblies during loading. The file size will also be smaller which saves you precious hard drive space. If you are downloading something, it is probably a purchased component and you are not supposed to modify anything. It will be delivered to you as is so you don’t need to have a whole construction tree: you just want the overall shape.
The component on the left is a directly downloaded SolidWorks file and the one of the right has been generated from a neutral CAD file:
The construction tree is much bigger and not everything is actually showing on the screen!
What if you want to modify a purchased part? Should you download a native file? No because you are still buying the component to modify it! You have to treat it as any other component and follow the same rules! See the article about Modifying Purchased Components.
In conclusion, avoid native SolidWorks files (*.sldprt/*.sldasm) and even worst SolidWorks Macro files (*.swb) as you have to get trough a lot of popup messages and clicks to execute it.
Order of preference of neutral CAD files
Now that we agree to use only neutral CAD files, we have to choose the right one. Some formats keep more information than others. The best format for SolidWorks is Parasolid as it is written in the same language as the SolidWorks modeler. Prefer binary (*.x_b) over text (.x_t) files as they are smaller and they speak the same language as your computer which means faster processing.
STEP (*.stp) files are the most commonly used and it is usually a good alternative if Parasolid is not available. If you have to choose between STEP versions use the latest AP214b as it contains more metadata than AP203, in particular the colors which is convenient to have good looking imported components.
Standard ACIS Text (*.sat) files are also an option. Usually it keeps less information than STEP files. You might loose the assembly structure and end up with a single part with several volumes or you have an assembly but with identical parts repeated instead of instantiated.
IGES (*.igs) file type is an outdated format that has not been updated since 1996 and should not be used anymore.
So you have in the end in the order of preference:
*.x_b > *.x_t > *.stp (214) > *.stp (203) > *.sat > *.igs > *.sldprt > .*swb
Once downloaded on your local hard drive, the component has to be tweaked to be usable. It is a good practice to do it directly because at this time you have all the info, with probably the vendor website still open on your screen. Otherwise someone else might have to do it later…
- The first thing to do is to clean the model. Sometimes the models comes with additional plans and axis. Delete what you don’t need, since the model is just a volume with no SolidWorks function it won’t error out. If the volume is not properly positioned, you can move it and add the equivalent of assemblies mates to put it where you want.
For example, we have that sprocket with its front plane on the side face. To facilitate the assembly, it would instead be better to have the plan centered on the teeth.
Click on “Insert” > “Features” > “Move/Copy…”. Select all the bodies and add a distance mate between the plan and the face.
- If the colors where not present in the file and you get a monochrome model, if you want to be a bit more realistic, you can select the faces you want and manually “paint” the volumes.
- When you import a component that is made of several components and that translates into an assembly file, sometimes identical parts are not instantiated. That means instead of loading one model and repeating it, you load a new model each time it is repeated. This is some serious waste of CPU calculation.
If we use this sensor as example, the nuts are two different parts:
Just delete one and copy the one you kept. It is a good practice to fix one of the parts that will be the reference for the others. Position it on the planes and axis you want and click on Fix, (f) will appear next to its name:
- On the other hand, when you import a component that is made of multiple components but translates into a single part file, you get several fixed volumes:
If you want to have movements between those volumes you need an assembly. Here is a small trick to quickly create an assembly: just click on File > Make Assembly from Part and you will have directly the part inserted into an assembly!
Copy-paste your part as many times as you have mobile parts. In this example we have the body and the nut repeated two times so you need three parts in total. Right click on the first instance of the part and select Make Virtual. This will save you the hassle to save each instance in a specific file. You can find more information in the article about Virtual Components.
At this point you have tree instances of the same virtual part. You want to make each unique part independent as you are going to modify them. In this case you have the body and two identical nuts so you just need to make one part independent from the two others. Right click on the first part and select “Make Independent”.
Now you want to rid of the nuts on the first part that is going to be the body. Expand the construction tree, select the volumes that you don’t want to keep, right click on it while holding CTRL key and click “Delete”.
Do the same thing on the second virtual component to only keep the volume of one nut. Since the third virtual component is also an instance of the second, it will also have only one nut after the operation.
In the end you get exactly what you wanted, a sensor body and two instances of the nut. You can now add some mates to have the movements you want. Don’t put any distance mate between the nuts and with the body because in the assembly this component will be inserted you want to make it flexible so you can add mates between the nuts and the sensor mount. See the article about Flexible Components.
Sometimes, depending on how you mount your sensor, you might need to use only one nut, or no nut at all. Just create additional configurations where you suppress the nuts. Once again, maybe you only need one nut in your assembly but in another project, if you reuse this component and you need the two nuts, you want to have that configuration too. See the article about the Configurations Naming.
- Furthermore, if it is not movements between volumes but movements inside a volume that you want, you can split the volume into more volumes.
We would like to be able to rotate the shaft of this gear motor but currently, the gearbox and the shaft are the same volume. Select the volume and click on “Insert” > “Features” > “Split…”. Select the bearing face as the “Trim Tools”. Check all the “Resulting Bodies” and make sure “Consume cut bodies” is unchecked.
You can now select the shaft as an independent body from the gearbox. This mean that you can make a configuration with and without the shaft. To do that click on “Insert” > “Features” > “Delete/Keep Body…” and select the bodies that you don’t want in that configuration.
Now you can proceed like previously explained: you form a new assembly with that part and select the configuration without the shaft. Insert the part again but this time with the configuration with the shaft only. Add some mates and you now have a rotating shaft! On a side note you could have just used an “Extruded Cut” instead of the “Split” and “Delete” combination but on more complex shapes it is not always possible to cut exactly what you want.
- When you import a component that has a lot of parts, most likely some are fixed and some are supposed to move together. The idea is to group the parts by mobile sub-assemblies.
We have this flat cylinder with 20 parts but in reality we have only two groups moving against each other. Right click on the body component and select “Form New Subassembly”. Do the same for the moving plate.
Here is a small trick: hide those freshly made sub-assemblies so you can see clearly what has not been assigned yet.
Now drag and drop the rest of the parts to their respective sub-assemblies: the one fixed or the one moving. With the assemblies hidden they will disappear as you drop them. You can now fix the first assembly and put some mates.
At this point we still have 20 parts to load. We don’t need mates between those parts as they are fixed. The sub-assemblies are virtual for the moment but to change their type, you have to save them as external temporary files. The trick is to transform those sub-assemblies into parts, the parts inside them will becomes volumes by selecting “Part” in the dropdown menu “Save as type”.
Right click on the virtual assemblies and replace them with their respective parts that you just saved using the replace tool. By default the “Replace Components” function does not appear, you have to click first on the chevrons at the bottom of the menu.
You now only have 2 parts made with multiple volumes. Right click on them and “Make Virtual” so once again this way you will only have to save one unique file in your database that will contain everything. Add some configurations to have the cylinder in a position extended or retracted for example.
- If you end up with an assembly, you might want to adjust the Scope of Supply to make sure that this component will appear in only one line in the BOM.
- One of the last thing to do is to specify the mass of the component if you know it. It might not be useful for you but someone else could be interested to know an accurate weight of his assembly to dimension properly the actuators for example. If it is not given by the vendor, try to apply the principal material from what the component is made of, it will probably be a good approximation. If you have the component on your desk, just use a scale and you will have the real mass! Use a generic material if the material does not exist in the database like Alloy Steel or Alloy Steel (SS). If you have detailed material info, the density in particular, you can create a new material and save it to the Shared Material Database.
Click on the “Mass Properties” icon and select “Override Mass Properties…”. Check the “Override Mass” box and enter the mass. You can also reposition the center of mass if you have a component with different densities.
Make sure you select the configuration you want to apply the overridden mass.
- The last step is to save the single file you obtained by one of these techniques into your shared database and follow your File Naming and Files Structure rules. Then you will have to fill the properties that you are using in your drawings BOMs, in miniPDM, in your ERP, etc… See the article about the Properties.