Hello,
I'm new to the solidworks API and this forum as wel, but I have a rather general question on automating designs in Solidworks with the API. After a bit of research on the internet, I was able to write me a few macro's from scratch to automate a table assembly. This was one of the exercises I did for myself. Anyway, while I was working on this exercise, I came up with a dilemma.
I was wondering what is the best strategie to start automating this kind of projects. To make things clearer I use the table assembly as my example. The first macro used the user input on a form to change the width, height, and the thickness of the table top. I did this by changing all the dimensions in every part in the assembly through the Solidworks API. It worked fine, but the problem is, that if someone else wants to use this API on an other project, it is rather difficult to understand and use it. Especially if you haven't got any programming skills. So the next thing I did was in the same assembly put in some global variables and make the assembly itself a lot more intelligent. then I used the same user input of the same form to change the global variables in the assembly through the solidworks API. This has also a few disadvantages :-) I think this code is a lot less understandable, since you use an array to list all the equations and have to now on wich index a special global variable is.
So I want to know what the best way is to automate anything in Solidworks. Make your assembly as smart as possible and use a lot of global variables and equations and keep the intelligence in solidworks, or just leave the intelligence out of solidworks and put this in the Macro. I guess there are limitations on both strategies. That's why I want your opinions :-)
Greets and thanks in advance
SolidworksApi macros
Take a look at DriveWorks Express. It comes with every seat of Solidworks. It does exactly what you want.
Hello Jesse,
I allready experimented with Driveworks Express and it is indeed a very usefull tool. It is also true that I want the kind of things driveworks Express can with the solidworks API.
As I mentioned before, This was a first exercise for me. I wanted to put a lot more into the user form. This was the point where I couldn't get things done with driveworks express anymore. It is impossible to change custom preferences for example, add complex logic and so on. I know that there is also a driveworks pro version available and I think a solo version as wel, but in my opinion they are very expensive and have also there limitations when it comes to building assembly's and so on. That was the reason I started learning the solidworks API. I want to change the color of the table and put the color as a custom property to the drawings. I also want to choose different styles of tables. For instance when the table is not square, I want an other assembly with an other leg design. If the lengt or width of the table exceeds a certain value I want to have extra support beams with other legs and so on. In short, we have designed a table that is very versatile and can be used in numerous different configurations. In my opninion the only way to generate customer specific designs, is with the solidworks API. As an extra advantage of learning the solidworks API, I hope that I can put the knowledge that I learn with this project to work in Solidworks for extra automation and usefull macro's.
Hi,
I have an update to my earlyer post :-) Like Jesse mentioned before, I could be using Driveworks. So I looked a little further and joined one of the driveworks solo webinars. After the webinar was done, I asked the teacher what he thought of my table design and how it could be driven by Driveworks. I Asked him if I could choose an assembly based on an equation with any driveworks license. It seems to be impossible. There are a lot of other ways to accomplish my needs with driveworks solo or pro. I could add all the different assemblies in one major assembly and then add an equation to supress or delete the assemblies I don't need, or swap parts and assemblies. Does anyone has experience with this because right now I dont see the advantage of driveworks for me. I think driveworks is a really great tool to generate custom instances of the same assembly over and over again but in my opninion you have to find several workarounds when it comes to selecting numerous configurations.
I have added an image to explain my needs. I hope the image make things a bit more clearer. :-)
As you can see, for a single table it would be easy and not to much of a deal with driveworks, but when the table gets scaled up to 5, 6 or maybe more working areas, I think it would be difficult. What I want, is that the user can put in the amount of workspaces and the width, height, and length of a table. Maybe a color and different kinds of table tops and then the table will come out automaticly.
David,
I have been doing design automation professionally for 23 years, more if I include graduate work. I have both done application work and built design systems (currently I build using the SolidWorks API; seven years now).
If you're looking for SolidWorks partner products, a partner product search (CAD, Design, KBE/Design Automation) will list 15 products under this grouping.
Fourteen of them are master model-based configurators. If you are doing configuration of a fairly bounded set of variations, most of these will do what you want to do. They may seem expensive, but if someone is paying you an engineer's salary to deliver design variations, it doesn't take much of a project to justify the cost of a configurator... if (actually that's a big IF) you can get your application into production.
Why are all but one partner products master model-based configurators (I imagine you asking)?
Because, they are the next logic step for CAD. They try to overcome the limitations of parametric CAD by extending parametric variations with topological variations. I like to call this "true parametric" CAD. The goal is to take a set of input parameters to a family of possible designs and deliver a correct alternative by varying both the size and structure of an assembly to solve the problem.
Why is one partner product NOT a master model-based configurator (O.K. I don't imagine you asking that, but I'm going to pretend you did).
Because sometime the next logical step is a dead end.
As you've found, you can't go very far without bumping into their limitations. Part of the problem is master modeling. Another is configuration itself.
Master modeling
Master modeling is a set of techniques that attempt to deliver sets of alternative topologies. It does this by attempting to capture every possible alternative as sort of super-assembly. You suppress and unsuppress components, features and (at least, in theory) mates until you have the desired alternative.
It's difficult to talk about master modeling without bringing in the issues of design tables and top-down design. They are, in principle, separate discussions, but I'm going to talk as if they are a package deal because, for most, they are.
If you follow the forums, each possible way of handling this comes with a set of advantages and an even longer list of disadvantages.
I'm going to give you a short list of headaches:
* if you can't add a component or feature by rule (you can only suppress), then you have to enumerate every possible combination. At some point the combinatorics will kill you unless your problem is trivial.
* CAD systems are designed to work bottom up. You can make them work top-down with great difficulty, while making component reuse almost impossible and making design libraries absolutely impossible.
* as your problems become large, file sizes will become larger and performance will suffer.
* you'll bury design knowledge in multiple locations (parts, assemblies, tables equations, excel files) making understanding impenetrable and maintenance difficult to the point where even the creator of the design will be reluctant to change anything for fear of breaking it.
* mates are a whole additional area of discussion. You have three major alternatives; all bad 1. punt/global coordinates. 2. sketch files. 3. plane files. Every alternative has a raft of issues.
I guess that's my short list. You don't want to see my long list.
Essentially, master modeling seeks to solve the problem using only the CAD model as the primary representation.
Configurators
Configurators, in this context, is short for "engineering" configurators; ones that drive a CAD system ("sales" configurators are just glorified catalogues). I object to this classification for a lot of reasons, but I'll let that go for now.
Configurators provide a user interface and usually some report capability.
Configurators do two other things well. They are (usually) an alternative to sloooooooooow, incapable and annoying CAD system equations and they can (usually) finesse the top down design problem. If you are doing configuration, these two things alone justify their use in my opinion.
Some configurators help go beyond CAD units (angle, length and quantity). Some have their own design tables. Some have an internal constraint engine that make Excel unnecessary.
Configurators are stuck with all the remaining limitations of master modeling: especially complexity limitations and orientation limitations. They have trouble with open-ended problems. If you have "n" of anything (e.g. n nozzles in a vessel with n holes, one for each nozzle), and you can't specify it as a linear or circular pattern, things start to get messy. You need to put n components into the master model. How many is "n"? Exactly. Do you feel lucky?
They are still using the CAD model as the primary representation for engineering, even though it is only the language of geometry.
Configurators are NOT DESIGN AUTOMATION SYSTEMS.
A configurator takes a set of inputs and delivers one design. Just one. Only one.
How many engineering problems are so simple that there is only one answer? If there is more than one answer, how do you deliver one answer. How do you find any answer? At any decision point for a partial alternative, how do you decide which alternative to develop? What if you choose wrong?
Here is a answer: Partition the solutions set at design time.
Well, that works sometimes, but the partitioning is arbitrary and done before you know the customer's evaluation criteria.
I know! You add parameters to the interface to guarantee a unique solution.
That can work, but many of the parameters have nothing to do with customer requirements. They're just there to guarantee uniqueness, and it is almost always done by adding product specific parameters that make it unusable to anyone but an engineer with deep product knowledge, and even he can't tell you how the additional parameters affect relative product performance.
Wait, wait... I know the answer! You let the designer optimize by allowing "what if" scenarios.
OK, now that we can iterate, we can really do design... except for a few details.
1. We've just redefined design automation to be manual.
2. If "what if" only produces one design at a time:
a. how do we know how to navigate the space of possibilities?
b. how do we know how this design compares to the last design?
c. how do we know how this design compares to what is possible?
So "what if" is design automation with out the automation part. It's exploration without a compass and, upon arrival at an alternative, we don't know where we are (so, without the optimization part). Are you beginning to feel like Christopher Columbus without a compass?
OK, enough of this. If I start with a pre-engineered set of components, I can configure with the certain knowledge that any configuration with be valid... problem solved... except, I think we just took the "E" out of "KBE".
So, you probably know, or at least began to suspect all of this. So you want to use the SolidWorks API?
I've got good news and I've got bad news.
First the good news... you can do anything with the SolidWorks API (and a whole pile of additional code).
Now the bad news... you just signed up to solve the general problem of design automation and mixed it in with the problem of how to sequence each step of the process.
I obviously believe that this is a worthy goal, otherwise I wouldn't have spent the last seven years of my life doing this. I'm certainly not such a hypocrite as to suggest that it was worthy for me and it wouldn't be for you. I've enjoyed every minute of it (although, some minutes are better than others). If that's what you want, go for it!
...but here's my question.
Have you got a decade or so to spend on this or would you like to find a shorter path?
Regards,
- Tim
It isnot too challenging to do. you have to set your smooth models into database with its application limits and your rules inside it, and build your master sheets/applications to filter/select these cases with priorities and data transpassing between models/components/functions.
For every new case, you just have to do it from begining and update it into your database/liberary. so it is very important to keep every cases with same logic. To use dynamic matching functions is also of great help, I think.
In a short, you can achieve it if you know programming, database, solidworks, math&logic work and your products.
Good luck!
Hi,
My best advise is first you need to buit the model with design table and save the model some where. Next you can write the macro...
the macro can do the following actions...
The maro user form can ask for input like width or depth
the macro can open the model from your location
the macro edit the design table
the macro passes the values form to the desin table
the macro rebuilt the model.
it is the best method for automation as per my experience.
thank you
Best regards,
K. Raghu
Chennai - India
email : k.raghu@flsmidth.com