Stumbling Rocks

May 13, 2008

Flexes, Hexes and Vexes

As the week begins, I feel proud to say that I’ve finally completed one more of the SW training manuals, the Advanced Parts Modeling one. Each day, I’m getting closer and closer to finally feeling prepared enough to try my luck with the CSWP test, but most importantly, I’m learning  tons of new stuff about SolidWorks, getting some practice, and having lots of fun along the way.

Among the exercises in the very last chapter of the manual, there was one that I struggled with for quite a while. The part was a model of a box, probably made out of Styrofoam or plastic, like the ones they provide at restaurants for you to carry leftovers or take out.  The box had a living hinge and the exercise consisted of applying the Flex command to bend the box into a closed position. I tried following the instructions in the manual, with exactly the same numbers and conditions, but my Flex feature kept failing. Frustrated, I decided to  check out the built part, the file that is included as a solution for this exercise, to see how the Flex feature was done there and make sure I wasn’t  making any mistakes.  Well,  I opened the part, edited the Flex feature, and couldn’t find anything different from what I had been doing so far, so I clicked OK and then it happened:  the Flex feature failed for the solution part,  as well! How come? It worked fine when I first opened the file!  It had to work for whoever modeled that part. How did they make it work in the first place? I reloaded the file and it seemed fine again, but then it occurred to me to force a rebuild by pressing Ctrl+ Q, and, just as I thought, the Flex feature failed once more. It was then that I remembered I had the option “verification on rebuild” turned on.

Verification on Rebuild is an option that controls the level of error checking when you create or modify features. By default, without using this option, every time you add or modify a feature, SolidWorks will check it against any adjacent edges or faces. With the option turned on, the features will be checked against all faces and edges. If a feature causes any invalid faces or edges, it will fail when this option is turned on.

I cleared the option and rebuilt the model. The Flex feature was successful this time and the model looked OK, but when I checked the model geometry (Tools, Check), it turned out the Flex feature had created three invalid faces.  That’s why it failed when the option was turned on! I wondered for a long time what this could mean for the model. Did it mean that the design needed to be modified? That a box manufactured based on this model wouldn’t work properly?  I asked Matt Lombard about it, since he’s got plenty more experience than I do, and he had mentioned before that he wrote part of this manual. He told me Flex  features are a bit flaky and can easily create problems like that one,  that is better not to use them with real geometry, but only for “looks like” stuff, like when you want to illustrate how a part would look like in a different position. I think I’m  beginning to understand why.

As an exercise for myself, I modeled  a small plastic bottle cap. This bottle cap is attached to a ring that goes around the neck of the bottle, to help keep track of the bottle cap.

Lid0

Just as it was done in the manual, I applied the  Flex  command to bend it into a “closed” position, to simulate how it would look like.  So, I clicked Flex, from the Features toolbar and got the Flex command  dialog box and, in the graphics area, a couple of trim planes and a triad. The triad is a coordinate system that that sets the center of the flex and the orientation of the trim planes. The bending takes place about the Bend Axis (the red axis in the image) and in between the Trim Planes. The Trim Planes are usually created at the extents of the part, but can be moved to a different location. The triad and trim planes  would assist me in the process of bending the part, but first I needed to reposition them. For this purpose, I had created a centerline sketch, right in the middle of the part. Repositioning the triad can be done through the dialog box or by right clicking in its center and choosing to either move it  or align it with selected geometry in the part.  I moved the triad so it would be located right in between the ring and the cap, and also so that the Bend Axis would be aligned with my centerline sketch. I also repositioned the Trim Planes using the dialog box to select a couple of vertices in the part to reference them.

Lid2

Here is the way it looks like from the front.

Lid3

Once I had that figured out, the next step was to enter the angle for bending. Notice how it bends about the red  Bending Axis.

Lid5

And this is the result. The lid in a closed position. The angle here is 180°.

Lid6

Now, while creating this part, I had the “Verification on Rebuild” option cleared out. So, I decided to check the model geometry for any invalid faces and edges and , yes, there were three invalid faces that were created right after using the Flex feature.

Lid7

After playing with the options for a bit, I noticed that the problem disappeared if I suppressed the fillets, so I reordered the features in the part and placed the second set of fillets right after the flex feature. Then,  I checked the model geometry again (Tools, Check). This time, there were no invalid or even inconsistent faces or edges in the model geometry.

Lid8

So, one more reason to leave fillets for the very end? Well, yes, it would seem like it, but for me is more a reason to be careful when using the Flex feature, and to follow Matt’s advice, and use it for “looks like” stuff, rather than design.  I’m still curious to know what could keep the Flex feature in the box from failing. Matt promised to take a look at it as soon as he has some time. I’ll be waiting!

May 01, 2008

Bummer!

It may just be that I’m running a fever as I write this, I’ve been as sick as a dog all this week, but I can’t help feeling this way.  Can I pour my heart out to a listening ear out there on this vast cyber universe?  Well, it’s like this. My own copy of the newest SolidWorks book I had been (un) patiently waiting for so long finally got here just a few days ago. It is, indeed, a great book, great quality, lots of colorful illustrations, plenty of examples and lengthy explanations, and written by a famous bestselling author. Who could ask for more, right? Well, it is really great, only I have a bit of a problem. You see, I’m using an educational version of SolidWorks 2007, and all the files and examples contained in the book were created in SolidWorks 2008. Why is this a problem for me? Well, simply because  there is no way I will ever be able to open  the files  in SolidWorks 2007, there’s no way to convert the SW2008 files into something I can open and still benefit from (parasolid won’t do for the purposes of the tutorials in the book), and at least for now, this is the only SolidWorks I can have. Bummer!

I’m not complaining, really, I’m not. Well, OK, maybe just a bit. But I’m not complaining about the book, because when I ordered it, I already knew what I was getting into. It didn’t take me by surprise. I knew the examples were modeled in SW2008, and that I would not be able to open them, but I bought the book just the same, because I also knew how hard it is to get reliable information on this particular area of SolidWorks and I just wanted to learn. I tried really hard to win the SW2007 training manuals for this particular topic on eBay, but it’s a task that proved to be impossible for me, someone always snatched out of my hands 10 seconds before the end, so I went for the book instead.   Hmmm, I wonder if you know what book I’m talking about. Chances are you own one too!  Did you guess?  Yes, of course you know!  It’s Matt Lombard’s  new Surfacing and Complex Shape Modeling Bible. Really nice book! It’s a soft cover, but it has the quality, looks and feel of a hard cover book.  I hope I can still get a lot out of it, even when I’m not able to open the files and examples. I have been browsing through it and it looks like I may as well be able to.

Like I said, I’m not complaining, but I do feel  bummed out about this reality of what using an older version of SolidWorks means. It means not being able to open files and share documents with users of the new version. It means not being able to fully benefit from books like Lombard’s, because they mainly target the new version. It feels like missing out on a lot of good stuff and not getting the materials you need to learn, unless you can pay thousands to attend the special training at the VAR or you are lucky enough to win a manual on eBay. I feel like I’m on the outside looking in. And  in many ways, I guess I really am,  especially since I’m only using an educational version of the software, that will expire in a year and months, and after that, well… I really don’t know.  I wish I could buy my own license of SolidWorks, and I’m saving some money, but for now it’s only a dream. SolidWorks is not cheap, and, as Vic Leventhal said to us during that first Tri Valley SWUG meeting, it’s not likely to ever become cheap. So… It is more likely that in a year or so  you may find me working for a company in the area and who knows what version of SolidWorks they’ll use, or if they’ll use SolidWorks at all. I hope they do, because I love the software and I’m putting a lot of effort into learning how to use it. In the meantime, all I can do is make the best of what I have and the resources available, and keep at it, even on those days when it feels that I’m merely muddling through it. Even though I’m on the outside looking in, I’m still grateful for that little window that was left open for me to gaze into all this marvelous world that revolves around SolidWorks and that, otherwise, I would’ve never known it existed at all. Maybe someday I’ll manage to get in, who knows? You got to have a few dreams, right?

March 27, 2008

Never underestimate the power of a midget

Coach Mark, who trained my son during last year’s baseball season, was proud to lead a great team of “midgets”.  He led them from mere midgets, all the way to becoming last year’s champions of their own division. Most of the kids in the team, including my own gentle giant of a son, were not as big or tough as many kids in the rival teams. Some were scared of being hit (yet again) by the ball. But, whenever in doubt, Coach Mark would always say to them: “Never underestimate the power of a midget”.  And he was right! Midgets can grow, and they often do, in amazing and unexpected ways. They can also become stronger, resourceful, skillful, and develop character, often as a result of being treated like a midget.  That’s a good thing for the midget (guess who’s already making the MVP list this year), but not so good for those that never saw it coming and certainly would’ve never expected it from a “midget”, like that coach of the rival team that lost the championship to Coach Mark’s bunch of midgets.  It is also not a good thing if the midget in question happens to be a small error in any of the features in your model. It may be an insignificant error, but one  that has the power to cause most or all of the features in your model to fail.

The following example is something that actually happened to me while preparing for the CSWA test. I was working on the exercises in Planchard’s guide that required changes to be made to models that had been previously created.  Just for extra-practice, I decided to edit this particular one that you see in the picture, and change a few of its dimensions.

Midget1

I made a mistake, however, and added a tiny extra line to one of the sketches. The line was on top of another one, and was so small that I didn’t even notice it. Well, guess what happened to my model. This happened.

Midget2

One small mistake and now 90% of the features in my part fail! What do you do when something like this happens? Do you…

a)    Tap your heels three times and reload, wishing that the errors will be magically gone?

b)    Proceed, from the bottom of the tree up, deleting dangling relations and dimensions left and right, in hopes that it would all be better once they’re gone?

c)    Make use of the different editing tools that SW offers in order to find information and repair the model?

Well, if you know exactly what you did that may have caused the problem, just go and undo it, but if you have no clue, then letter c is your best bet. Now, how do you find out what’s wrong with the model? Well, the way SW will handle the errors when they occur, depends on your choice of settings. If you go to Tools, Options, System Options, General, you will find that you can check the option “Show errors every rebuild”.  This ensures that an error dialog box appears after every rebuild, showing a list of everything that is wrong in the model, including errors, that prevent features from even being created, and warnings, that don’t prevent them from being created, but will still show problems, usually with dangling relations and dimensions. You can also display the “What’s wrong?” list of errors if you right-click the name of the part in the feature manager and select “What’s wrong?” from the menu. The list you will get looks more or less like this for a part (it can look much worse than this).

Midget3

And can look like this (or worse) for an assembly.

Midget4

OK, so now we have a list of errors, what do we do next? Well, we start editing and repairing the model from the top, from the very first feature that shows an error or warning, and go working our way down. It could be that solving just one or two errors that were made early in the process will solve all the problems in the part. OK, this doesn’t always happen this way, depending on the complexity of the part, but it could. Remember to always hope for the best, even when you are expecting the worst.

In my case, at least, it happened that way, because the mistake I made was located precisely in the base sketch. This extra line in the geometry was causing the base feature, Extrude 1, to fail, and creating all sorts of problems all throughout the model, since all the other entities that depended on that first feature were now failing too and/or had dangling relations and dimensions, now that part of the geometry was missing. When I edited the base sketch, and with the aid of the Check Sketch for Feature command, I was able to pinpoint the culprit. The extra line in the geometry is highlighted in green and now I could simply delete it, rebuild my model, and proceed to repair the next error(s), if any. In my case, there were no more errors and my part was finally able to rebuild correctly.

Midget5

There are many other midgets that can be causing the features in your model to fail. Some will be easier to spot, like if you made a typo and wrote a value for a fillet that is way too large. Some may not be that easy to spot, but can also be repaired, like if you established relations or dimensions that reference to things that no longer exist in your model. For this situation, you can use Display/Delete Relations while editing the sketch, in order to find the entities that are used by those dangling relations or dimensions and, if possible, replace them according to your design intent, so the model makes sense again.

From this experience I learned that it’s always worth trying to repair a model first, instead of going on a deleting frenzy, which may actually make the problem even worse. Of course, how long it takes to do such repairs depends on how complex the model is. I know many of us will probably have to spend several hours repairing something that someone else (or even ourselves while trying to do changes to it) messed up, and I’m sure it won’t be fun. Sometimes it may be easier to start from scratch? Then again, if it’s still possible, I guess it’s worth trying to repair.

Oh, just to share. Here’s a picture of Coach Mark and his happy bunch of midgets.

Midget6

January 11, 2008

I've got the Underdefined Blues

Sometimes, in my efforts to learn SolidWorks, I feel a bit like a child who is eager to play baseball for the very first time. The child doesn’t care much about spending time learning to run the bases, swing the bat or how to figure out whether the ball is inside the strike zone or not. The child only wants to skip to the fun part of the game, the part where he or she hits the ball out of the field and everybody runs home. Well, something similar happened to me when working with sketches versus solid features.

Working with sketches is a new concept for me. In AutoCAD, I was used to creating 2D drawings by placing lines, circles, and any other entity, in the exact size and location where I wanted them to be, right from the beginning. In SolidWorks, however, I simply place the entities first and then define the sketch by applying dimensions and relations. In other words, I’m sketching with parametrics. This is really a powerful concept that took me a while to understand and that still confuses me at times. It is powerful because the sketches are at the core of the most common features that will be used to create the model, because we can change them according to our needs (by the use of equations and design tables, for instance), and because, if properly defined, they should maintain their relationships through those changes. This all sounds really great, but that’s precisely where I stumbled.

While working through the first tutorials and trying to come up with my own models copied from pictures in books or inspired by simple objects around me, I quickly learned to avoid the overdefined sketches, dangling relations and unsolvable geometries, but what about the underdefined sketch? Since most of the time, SolidWorks will allow you to create a model using an underdefined sketch, I didn’t think it was that important. It was until later, while working with configurations and design tables that  I had one of those “Aha!” moments, and it finally dawned on me that it does make a big difference whether you fully define a sketch or not. As an example, take a look at my underdefined model from one of the tutorials.

Undef1_6

This is a very simple part with three sketches. Sketch 2, the underdefined sketch, is a circle that is supposed to be placed in the center of one of the faces of the Box. However, the position of Sketch 2 is not fully defined. It appears to be placed right where it should be for this particular instance, but watch what happened when I tried to create different configurations of the same part by means of a design table.

Undef3_2

Yikes! What happened here? Why would it fail to create a fillet? Now look at this other configuration.

Undef4_3   

Why do you think this happened? Well, let’s take a look at the design table.

Undef2_2

As you can see, the design table was supposed to create several configurations by changing the dimensions of the rectangle (Sketch 1) used to make the Box, as well as the diameter of the circle (Sketch 2) used to create the Knob, then, it was supposed to apply fillets to the outside corners or the Box. However, since Sketch 2 was underdefined, it failed to maintain the relationships with the other entities in the model and even caused the fillet on the second configuration to fail. In other words, it didn’t always end up in the center of the Box’s front face when the dimensions were modified, and that alone affected the whole part.

This example may not seem like a big deal because there aren’t many sketches involved and it’s easy to spot and correct the error. Now think about a similar situation, only this time picture a very complicated part where several of the sketches involved in creating features are left underdefined. Not the same, huh?

Right after this, I vowed to always do my best in order to fully define a sketch before using it to create a model. But I found out this is easier said than done, especially when repairing those sketches already created. Many times, after applying all the dimensions and relations I could possibly think of, there were still a few blue entities left. Even worse, at times, trying to fully define my sketch would actually make it overdefined! Relations are not easy for me.

A few times, I used the Fully Defined Sketch tool, and was actually successful. Other times even that wouldn’t work, the tool would display a message saying that my sketch was still underdefined, and would suggest a few ways to fully define it. Although I continue to struggle, I’ve noticed I have better chances to achieve my goal of correctly applying dimensions and relations for a fully defined sketch when I keep the Automatic Relations option on all the time, and when I think carefully about the model and how I want it to react to changes I (or others) may decide to make in the future. I wonder if I’m the only one who has a hard time with this!