Documente Academic
Documente Profesional
Documente Cultură
Training
www.driveworkssolo.com SOL.V8.R2
www.driveworkssolo.com
www.driveworkssolo.com
Concepts
This covers the concepts of DriveWorks Administrator, including best practice advice and tips. The Concepts section can also be used post training as a reference. Concept: Concepts are formatted like this.
www.driveworkssolo.com
Exercise
There is an exercise for each lesson. The exercises all work on the same models. 1. Exercise instructions are formatted like this. Jumping between different exercises is not recommended as there is a flow of implementation from one lesson to the next.
Image Update
This manual uses images taken from earlier versions of the rule builder, the latest version has been updated as highlighted below: Rule builder image used in this manual Latest version of the Rule builder
www.driveworkssolo.com
Contents
DriveWorks Solo Training Overview ............................................................................................... 3 About this Manual ......................................................................................................................... 3 Imagine you design Wooden Doors ............................................................................................... 7 Lesson 1 ............................................................................................................................................ 9 Basic Setup .................................................................................................................................. 11 Opening DriveWorks Solo ........................................................................................................ 11 Creating a Project .................................................................................................................... 11 Capturing your Models ................................................................................................................ 14 Captured Assembly Structure .................................................................................................. 15 Capturing Individual Models .................................................................................................... 17 Lesson 2 .......................................................................................................................................... 29 Project Designer .......................................................................................................................... 31 User Interface .......................................................................................................................... 31 Form Design ............................................................................................................................ 33 Lesson 3 .......................................................................................................................................... 39 Building Rules .............................................................................................................................. 41 Variables.................................................................................................................................. 42 Variable Categories .................................................................................................................. 43 Model Rules............................................................................................................................. 47 Lesson 4 .......................................................................................................................................... 55 Running your Project ................................................................................................................... 57 Lesson 5 .......................................................................................................................................... 59 Improving Your Project ................................................................................................................ 61 File Name and Relative Path Rules ........................................................................................... 61 Lesson 6 .......................................................................................................................................... 69 Static Replacement Files .............................................................................................................. 71 Lesson 7 .......................................................................................................................................... 75 Tables .......................................................................................................................................... 77 Lesson 8 .......................................................................................................................................... 83
www.driveworkssolo.com Form Navigation .......................................................................................................................... 85 Lesson 9 .......................................................................................................................................... 87 Enhancing Your Forms ................................................................................................................. 89 Lesson 10 ........................................................................................................................................ 91 Dynamic Replacement Files ......................................................................................................... 93 Lesson 11 ........................................................................................................................................ 99 Driving Custom Properties ......................................................................................................... 101 Lesson 12 ...................................................................................................................................... 107 Documents ................................................................................................................................ 109 Lesson 13 ...................................................................................................................................... 117 Drawings ................................................................................................................................... 119 Capturing Drawing Detail ....................................................................................................... 119 Building Rules for the Drawing ............................................................................................... 130 Appendix ....................................................................................................................................... 137 Preparing Your Models for Automation.................................................................................. 137
www.driveworkssolo.com
First lets look at the design. As you can imagine, the hole that a builder leaves in a wall could be any size (within reason) and because this is a wooden door, each piece of wood needs to be designed and a drawing produced. We will need to create a set of forms for someone to fill in, which will guide them through the selections we make available to them. That way we know that whatever they enter can actually be manufactured. Also, it would be great to be able to produce a General Arrangement drawing automatically that shows the exact requirements. There will be rules that take the opening dimensions and calculate the sizes of each component. We also need the ability to have a round or rectangular window in the door, which could also be a custom size. The steps required to do this in DriveWorks Solo are as follows:
Basic Setup
Decide which Models and Drawings will be driven, and what is driven in each case.
Form Creation
Create forms for our users to enter data to specify a new door and frame.
Rules
Add rules to drive the models and drawings from the inputs on the form.
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 1
DriveWorks Ltd 2011 | All Rights Reserved 9
www.driveworkssolo.com
Basic Setup
Hopefully at this point you have DriveWorks Solo installed and licensed. If not, please visit www.driveworks-solo.com.
Now we need to create a project to store our automation information. Concept:DriveWorks Solo stores the information that you enter into a Project. Each Project can drive any number of models, or combination of models from a set of forms. Each different product that you wish to automate would normally have its own Project, unless the data entered to design each one is similar or the same. The project file has a .driveproj extension, and also uses similarly named accompanying files.
Creating a Project
DriveWorks Solo incorporates a wizard for creating and opening projects. At this point, we are only dealing with creating Projects.
11
www.driveworkssolo.com
Concept:DriveWorks Solo uses helper links to guide you through the set up of your automation products. The links will either be a way to perform an action, or a link to the help file covering the relevant topic. Either way, its a great idea to click on the links.
1. Click on the Link Please open a project before continuing at the top of DriveWorks Solo to activate the wizard. 2. Select Create a new project from the options and click Next. There are now three options for creating a new Project: Empty Project This will create an empty Project that you can add your own models to. Import from DriveWorksXpress If you already have models captured in DriveWorksXpress, you can import them into DriveWorks Solo. Using a Template DriveWorks Solo ships with built in templates. These are great for getting to know DriveWorks Solo and investigating a completed Project.
12
www.driveworkssolo.com For now, we are going to create a Blank Project 3. Select Empty Project from the list. 4. Click Browse to select a location for your Project. 5. Browse to the location that you wish to store your Project. It doesnt matter where you store the Project, although for this training, browse for the same location as the Door and Frame models that were shipped as part of this training. If you do not have these files, you can download them from www.driveworks-solo.com Concept:DriveWorks Solo applies validation in all important areas. If you see the warning icon next to a text box, hover over it to see a validation and hint tooltip. You will also be prevented from proceeding until the validation criteria are met.
6. Click Finish to create the DriveWorks Solo Project in the chosen location. DriveWorks Solo will automatically use the folder name for the name of the Project. Type a new name if required. You will now have a Project open, and a Link at the top of DriveWorks Solo indicating the next step.
13
www.driveworkssolo.com
1. Click the link, and browse for the SolidWorks Part or Assembly that you wish to automate. For this training, browse for the SolidWorks assembly Wooden Door and Frame.SLDASM that was shipped with this training material. With the Wooden Door and Frame model now open, the link at the top of DriveWorks Solo will change to: Click here to capture the active model
14
www.driveworkssolo.com Once captured, the Task Pane will show all of the options for capturing model information in the Capture Explorer.
Concept:Capturing is split into different sections that appear at the bottom of the DriveWorks Solo task pane. Click on each section header to activate the required section. Click and drag the bar to resize the section headers as you become more familiar with their use.
15
www.driveworkssolo.com
Another link will now appear at the top of DriveWorks Solo stating that No components have been captured for this assembly. If clicked, the help file will open at the relevant page. This step controls which of the models in the main assembly are controlled by DriveWorks Solo. It is not always necessary to capture every component or sub assembly. 3. Check all of the models in the tree APART from any of the hinge models and the lock in the Door Assembly. These files will not be driven or controlled as part of this training.
Note:If you check a part in a sub assembly, the sub assembly will automatically be checked as well.
16
www.driveworkssolo.com
Captured dimensions and features are given their own name in DriveWorks Solo, to make it easier to build rules for them later on. Each feature can also have its advanced properties captured, depending on the feature type. For instance, if you choose to drive a sheet metal feature, you will be able to capture properties such as its K factor, or Bend Table.
Custom Properties
Select an existing custom property in your model to be able to control its value dynamically, or add a new custom property into your model, that will be driven. DriveWorks Solo has 3 special custom properties that, if used, will allow you to drive the Color, Material or Texture from a rule.
Drawings
Browse for each Drawing that you want to control. You can have more than one Drawing for each part or assembly. Once captured, each Drawing can then be further controlled.
Replacement Models
Rather than overload your master models with every permutation of model that you would ever need, DriveWorks Solo allows you to browse for replacement models that will be swapped into the assembly based on your rules.
File Formats
When DriveWorks Solo creates new variations of your models, you can also choose to export those files to other file formats (for instance eDrawings, Tiffs etc)
17
www.driveworkssolo.com
Concept:To open any captured model in order to further capture its parameters, click on the Captured Models section header. This will display a tree view of all captured models in the current Project. Double-click a model in the tree to open it in SolidWorks.
4. Activate the Captured Models section by clicking on its heading within the Capture Explorer.
This section controls which of the dimensions and features are controlled by DriveWorks for each component you selected in the previous section. You do not need to capture dimensions and features for every component. Concept:SolidWorks has its own name for each Feature or Dimension. This step ensures that each captured item has a name that means something to you. Selecting a feature or dimension in the model or SolidWorks feature tree adds its name to the SolidWorks Name text box in the DriveWorks portion of the feature tree.
18
www.driveworkssolo.com
Concept:At this point, you need to understand the design intent that we have applied to the models. We have mostly used planes in the models and then attached the sketch geometry to the planes. Changing the plane offsets therefore changes the size of the model. At the end of this tutorial is a section on modeling for automation, so that you can apply it to your models. For now, we have listed below where each dimension or feature can be found in the model. For the Wall, we are going to capture the opening size. This is driven by 2 planes called SOW and SOH. (These stand for Structural Opening Width and Structural Opening Height) To allow you to select the dimensions for these, you need to double-click each plane in turn. Tip:If you double-click the TEXT of the plane, SolidWorks will prompt you to change its name. Dont do this. Instead, double-click on the icon for the plane. If you do this, you will see the dimension of the plane appear in the model window.
2. Double click on the icon for the Plane SOW and click on the dimension that appears. The SolidWorks name for this dimension will appear in the DriveWorks Solo Task Pane.
19
www.driveworkssolo.com
Tip:If you are having problems selecting the dimension, you may have Instant3D switched on. This will prevent you from selecting dimensions for capture in the model window. If this is the case, a link will appear in the DriveWorks Solo Task Pane. Turn Instant3D off to continue
. 3. In the Name text box, type a meaningful name, enter Structural Opening Width and then click Add. Dont forget to click Add. 4. Follow the same principal for the SOH plane, and for its dimension. Give it the name Structural Opening Height. 5. Click Add again.
20
www.driveworkssolo.com We have now finished capturing the parameters of the Wall. Now lets capture the Frame. This is made of 2 parts; both have a dimension that needs to be captured. 6. Activate the Captured Models section by clicking on its heading within the Capture Explorer.
7. Double Click the model Top Door Jamb in the Task Pane Tree.
21
www.driveworkssolo.com
2. Select the dimension in the model window and enter the name Length. 3. Click Add to capture the dimension. There are no features to control in this part however we do want to be able to control some custom properties. 4. Select the Custom Properties Section Header. To capture existing custom properties, check them in the list. You will then be able to create a rule for each captured custom property. 5. Check the custom property Date. 6. Check the custom property Description.
To add a new custom property to the model, and capture it at the same time, enter the name in the text box and click Create.
22
www.driveworkssolo.com
Concept:DriveWorks Solo has special names for some custom properties. These allow you to control color, material and texture of your models and are DWColor, DWMaterial and DWTexture respectively. These are not case sensitive, and DWColour can be used instead of DWColor based on your spelling preference. The second frame part is called Door Jamb. 8. Activate the Captured Models section by clicking on its heading within the Capture Explorer.
9. Double Click the model Door Jamb in the Task Pane Tree.
23
www.driveworkssolo.com
Concept:- For each new part or assembly that you create from your masters in DriveWorks Solo, you can have one or more Drawings associated with it. These will also then be created based on master drawings. The Drawings section of DriveWorks Solo allows you to reference which drawings will be generated for each part or assembly.
4. Browse for the drawing Door Jamb.SLDDRW in your training files folder. We will capture more information for this drawing (such as view positions, and dimension text) later on in the training
The next component is the wooden door itself. As well as dimensions, the Door also has features that will need controlling. Let's capture the dimensions first. 5. Activate the Captured Models section by clicking on its heading within the Capture Explorer.
24
www.driveworkssolo.com
6. Double Click the model Wooden Door in the Task Pane Tree to open it in SolidWorks.
The next step is to capture the window cut out, so that we can choose to have a window or not. 3. Select the feature Square Cutout in the SolidWorks feature tree.
25
www.driveworkssolo.com Notice that the name of the feature is automatically added to the Name text box. This happens because DriveWorks Solo recognizes when the name of a feature has been changed from the default name given by SolidWorks.
Note:This also happens with dimensions. If you have already named a dimension in SolidWorks, DriveWorks Solo will pick up on that name and enter it into the Name field automatically You should now have the parameters captured in line with the picture below.
The final item to capture on the door at this point is to add a driven custom property called DWMaterial. This will allow us to drive the material of the door based on rules. 5. Select the Custom Properties Section Header. 6. Enter DWMaterial in the text box and click Create.
You may have noticed the filter box underneath the header on the Task Pane. This allows you to filter the list, and is particularly helpful when you have a lot of custom properties, and the list needs filtering for ease of selection.
26
www.driveworkssolo.com The last model to capture at this stage of the training is the Rectangular Window. 7. Activate the Captured Models section by clicking on its heading within the Capture Explorer
8. Double Click the model Rectangular Window in the Task Pane Tree to open it in SolidWorks 9. Double Click on the feature Extrude1 in the SolidWorks feature manager. Capture the two dimensions for the overall size of the window, calling them Width and Height. The final task is to associate a Drawing with the top level assembly. 10. Click on the Captured Models Section Header to show all of the captured models within this Project. 11. Double Click the model Wooden Door and Frame in the Task Pane Tree.
This will open the model Wooden Door and Frame in SolidWorks and automatically select the Dimensions and Features section. 12. Click on the Drawings Section Header 13. Browse for the drawing Wooden Door and Frame.SLDDRW in your training files folder.
27
www.driveworkssolo.com
All of the models we need for now have been captured. The next step is to set up a form to fill in. To save your DriveWorks Solo data click on the save button on the DriveWorks Solo Command Bar. This will save your Project data, but not the SolidWorks files. Click the SolidWorks save button to save your models.
28
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 2
DriveWorks Ltd 2011 | All Rights Reserved 29
www.driveworkssolo.com
Project Designer
DriveWorks Solo has an inbuilt Project Designer that allows you to create your forms, create tables of data, build rules for your models, and configure your quotation. The Project Designer is split into 3 sections in the Task Explorer Stage 1: User Interface Set up the navigation through your forms, and design each form using the inbuilt form controls Stage 2: Data and Rules Create tables, and build variable rules that will be re-used within your Project Stage 3: Output Rules Create and manage the rules for driving your models and drawings, as well as the rules for creating dynamic documents The Project Designer also has a command bar that will show in-context tools relevant to the section you are working on.
User Interface
The user interface section is split into two elements: 1. Form Navigation Here you will set up the dynamic navigation through the forms of your Project. Rules can be used to set the navigation based on other inputs 2. Form Design Use the inbuilt controls to create your form. Form controls have dynamic properties that allow you to build rules that will dictate their behaviour. DriveWorks Ltd 2011 | All Rights Reserved 31
www.driveworkssolo.com
Concept:DriveWorks Solo uses one or more forms to specify new variations of your products. These forms are then linked together to form a navigation.
Form Navigation
Whenever you create a new Project, DriveWorks Solo creates the first form for you, and creates the navigation from start to finish. Concept:Navigation requires a Start and a Finish. This ensures that you always have a starting point when you start using the forms to create your new models. It also requires a Finish point, which lets DriveWorks Solo know when to show the finish button so that you can finalize your design and documents. The default navigation, with a single form, therefore looks like this:-
The command bar now has buttons specific to form navigation, including alignment tools to help tidy up your navigation, and buttons for adding and deleting forms and decisions. Concept:A Decision is a two way splitter that allows you to show one of two forms based on a single rule. At this point in the training, we are going to just use the default form with no decisions. These will be covered later in the training.
32
www.driveworkssolo.com
1. Open the Project Designer by clicking on the toolbar at the top of DriveWorks Solo.
Form Design
2. Activate the Form Design by selecting the Forms Design task in the Task Explorer. The form designer will default to showing the first form. In this case, there is only one. Tip: - You can also right-click on the form icon in the Form Navigation stage and select: Go To Form Designer The form is empty. You can now start adding Form Controls
Form Controls
Concept:Adding inputs to each form is done by clicking on the appropriate button on the Command Bar above the form designer. A text box then appears asking for a name. You cannot use the same name twice, and try and use meaningful names. Names cannot have spaces in them.
Text Box
1. Click on the Text Box button on the Command Bar. A text box will appear asking for a name for the Text Box. Call it OpeningHeight.
33
www.driveworkssolo.com
2. Click the OK button to create the control. The caption for the text box will be as you typed it, with no spaces. This can be changed by updating the value for Caption in the properties pane. However, if your name has capitalized words, such as OpeningHeight, then DriveWorks Solo will recognize this and add in the space in the caption. Concept:If you select the control on the form, the properties pane on the right will show you all of the properties that you can set for the type of control that you have selected. Some properties are static, which means that you set them and they stay that way until you edit them again, and some are dynamic, which means you can build a rule for its value.
Static properties are shown with a grey icon, while dynamic properties have a green icon
Spin Button
34
www.driveworkssolo.com
A spin button requires a minimum and maximum value, as well as an increment. These are entered into the Property Pane on the right hand side of the Forms Designer. Make sure you have the correct control selected in the Form Designer when you are changing these values.
Set the following values: Minimum = 900 Maximum = 1500 Increment = 50 Concept:You may have noticed that when you type in the values for Minimum, Maximum and Increment, that a button appears to the right of the box. Clicking this button will open the Rules Builder, which means that rather than being static, you could have dynamic values. For instance, the minimum width may change if the door goes above a certain height. Leave them as static values for now. Im guessing that curiosity hat got the better of you, and you have opened the Rules Builder. Click cancel, we will get to the rules builder shortly!!
Combo Box
35
www.driveworkssolo.com
Concept:A Combo Box is a drop down list where any single value can be selected. The list in the drop down can be static or dynamic In order to populate the list in the Combo Box, we need to enter a value for Items in the Property Grid Concept:Lists in DriveWorks Solo are usually represented by a single string, with each item required in the list separated with a pipe bar (|). So, for example, if you want a list with Monday, Tuesday and Wednesday as static values, you would need to enter "Monday|Tuesday|Wednesday". Even though we need static values in the Items property, we are still going to use the Rule Builder. 5. Click in the Items property for the Combo Box. A button will appear to the right of the property value 6. Click the button to launch the Rule Builder
Tip:You need to click in the Items property for the button to appear.
The Rule builder is split into numerous sections, with its own Command Bar, a Rule Editor, Help and Diagnostics and a browser to find your Project Variables and Form Values.
Rule Builder
DriveWorks Ltd 2011 | All Rights Reserved 36
www.driveworkssolo.com
The rule is entered into the Rule Editor, using a combination of typing, and the helper functions on the command bar, and by double clicking on Form and Variable entries. In this case, because we want static values in the Combo Box, we are just going to type in the text "None|Rectangular". 7. Click in the Rule Editor and Type "None|Rectangular".
Note:Since this is static text, make sure that you include the quote marks.
8. Click OK on the Rule Builder. The rule will appear in the Item property in the Property List.
The last 2 controls for now are for the size of the rectangular window. 9. Create a Numeric Text Box control called WindowWidth. DriveWorks Ltd 2011 | All Rights Reserved 37
www.driveworkssolo.com
10. Set the properties for Minimum and Maximum to be 200 and 600 respectively. 11. Create a Numeric Text Box control called WindowHeight. 12. Set the properties for Minimum and Maximum to be 200 and 600 respectively. Your form is now ready, so we can move on to the Model Rules that will link your Form Values to the information that you have captured in your models. You should now have a form that looks a bit like this:
Have a go at changing some of the static properties for each control. Also experiment with the align tools at the top of the Form Designer. Clicking the Test Mode button at the top of the Form Designer also allows you to see what the form will look like and test it. Clicking again returns you to Design Mode. Note: - Any Values you enter into your controls in Test Mode will become the default values for those controls.
38
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 3
DriveWorks Ltd 2011 | All Rights Reserved 39
www.driveworkssolo.com
Building Rules
First of all, lets look at the models. In the following picture, all sizes have been exaggerated.
From this picture, it is easy to see that to calculate the width of the door; you need to take into account the Opening Width, Wall and Frame Gap, Frame Thickness and the gap between the door and the frame. So the rule would be of the form:DoorWidth = OpeningWidth 2 * (WallandFrameGap + FrameThickness + DoorandFrameGap) Our Form already has an input for the Opening Width, and in this case, the other values will be static. It would be very straight forward, knowing the static values, to just type them in, so that the rule would be DoorWidth = OpeningWidth 2 * (5 + 40 + 5) Or even DoorWidth = OpeningWidth 100 And there would be nothing wrong with that, except that if we ever wanted to change any of the gaps, or even make them dynamic in the future, we would have more work to do, and our project wouldn't be as flexible.
41
www.driveworkssolo.com It also makes it easier to track and validate your rules, as they will have a name that can be understood easily. It's therefore better to enter all of these static values as variables, and then use them in a rule.
Variables
DriveWorks can store values for use in your rules. Lets add the gaps around the door and frame as Variables. 1. Select the Define Variables task in the Task explorer. 2. Click Add Variable to create a new Variable.
Note: - As with creating new forms, a text box will appear asking for a name for your new variable. Again, validation is used to ensure your name is valid.
3. Enter the name WallandFrameGap for the name and hit Enter. You will see the new Variable added to the list:
Note: - You can change the name of a Variable at any time by double clicking on the name in the list. You will be asked to confirm the action, as when the name is changed, DriveWorks solo will need to search for every rule in your project to see where that variable has been used, and update those rules where it is found.
4. Enter a value for the variable by double clicking in the Rule column. 5. Type in a value for your variable of 5 and hit Enter.
42
www.driveworkssolo.com
Note:You can also enter the value in the Rule Builder by either double clicking in the Value column, or using the Build button on the Command Bar.
Variable Categories
Concept:Variables can have categories. Since projects may have a lot of Variables DriveWorks Solo allows you to categorize them.
8. Click the Add Category button on the Command Bar 9. Enter the name Sizes and click OK
Tip:You call also hit the Enter Key to accept your name, as long as your name is valid This adds your category to the tree. To add new Variables to this Category, select the Category in the tree before clicking New Variable To add existing Variables to a Category, drag them onto the Category item in the tree
We can now set Variables for the Frame width and height, as well as the Door width and height. 10. Click Add Variable to create a new Variable. 11. Give the Variable the name FrameWidth and hit Enter.
43
www.driveworkssolo.com
12. With the FrameWidth row selected, click Build on the Command Bar to launch the Rule Builder. Have a click around. You will see your Form controls, as well as your new Variables in the Browser on the right. We will be adding the rule for the FrameWidth Variable:OpeningWidth (2 * WallandFrameGap) Although you do not need to type this in. Concept:Double Clicking on an item in the Forms and Variables Browser will add its name to the Rule Editor.
13. Using the tab Forms on the right, double-click on the name OpeningWidth. This will add the text OpeningWidthReturn to the Rule Editor.
Note:DriveWorks Solo adds the word Return as a suffix for Form Controls
14. Then type a minus sign, followed by an open bracket (. 15. Then type 2 * and switch the Tab on the right to Variables and double-click on the Variable WallandFrameGap followed by a closed bracket ).
44
www.driveworkssolo.com
16. You should now have a rule that looks like this:
17. Click OK to accept the rule. 18. Create another Variable called DoorWidth using the rule:
Tip:It is much easier to double click on the variable in the Variable Browser on the right, rather than typing it in manually. If you find you have a lot of variables, use the filter box to limit the variables displayed
OpeningHeightReturn DWVariableWallandFrameGap Don't worry if you get the result #VALUE at this point, this is simply because you have not entered a value for the OpeningHeight on your form yet. Note: - You can change the appearance of the Rule Editor by clicking on Settings button on the Command Bar.
45
www.driveworkssolo.com
Concept:The Rule builder has diagnostic tools built into it, to help you create accurate rules quickly. At the bottom of the Rule Builder you will see a Diagnostics area. On this there are 3 tabs: Values All of the individual elements that make up the rule are displayed here, to help you check your rule. Also included here is the current result of the rule. Steps Here, each rule is broken down into sub rules, so that you can see quickly the cause, if you are not getting the result that you expect. Comment You can enter a comment for each rule. You should now see the following Variables in your list (note: - depending on the values you entered when testing your form, you may have different results for your Variables).
46
www.driveworkssolo.com
Model Rules
We are now ready to build some model rules, and then create some new SolidWorks files based on the information we enter in the form. The first step though is to tell your DriveWorks Solo Project which models to control. Concept:Captured Models are not automatically added to the Project Designer, as you can choose to drive No Models, One Top Level Model or More than One Top Level Model. Therefore you need to tell this project which models to use.
22. Select the Model Rules task in the Task explorer. 23. Click the Add button on the Command Bar. 24. Check the box for the assembly Wooden Door and Frame and click OK.
You will now see the Wooden Door and Frame added into the Component Tree. Note:You only need to add the top level assembly. All of the captured sub-assemblies and parts will be added to the tree automatically
25. Right-click on the Wooden Door and Frame in the tree and click Select Children.
47
www.driveworkssolo.com
This will show all of the rules for all of the components
You will notice that some rules have already been filled in, namely the File Name rule and the Relative Path rule. Concept:FileName is the rule for the file name that will be created when you run your project. RelativePath is the rule for the location of the new file relative to a folder called Results which will be created inside your Project folder The default given for these is the name of the Project, followed by an incremental number (shown as 9999 during the design or your Project). For the file name, the result of this rule will be appended to the original file name of each model.
48
www.driveworkssolo.com We will be changing these rules later in the training, but for now we will leave them as they are. Each Model has a rule for Configuration. Only create a rule for these if you wish to change the configuration you wish to use in your model. Again, we will do this later in the training. Let's create rules for the dimensions first. Rather than scroll up and down looking for the dimension rules, you can type a filter in the filter box at the top of the Rules List. 26. Type dim in the filter box to only show rules with dim in any of its values
27. Select each one in turn, and click the Build button on the Command Bar Since we have been to the effort of creating the Variables for most of these, or because we are using a straight mapping from some Form Controls, the model rules are very straight forward. We will add more complicated rules later in this training, but for now set the following rules. Name Width Height Window Width Window Height Height Width Length Length Structural Opening Width Structural Opening Height Component Rectangular Window Rectangular Window Wooden Door Wooden Door Wooden Door Wooden Door Door Jamb Top Door Jamb Wall Wall Rule WindowWidthReturn WindowHeightReturn WindowWidthReturn WindowHeightReturn DWVariableDoorHeight DWVariableDoorWidth DWVariableFrameHeight DWVariableFrameWidth 2*DWVariableFrameThickness OpeningWidthReturn OpeningHeightReturn
49
www.driveworkssolo.com
Again, don't worry if the Values differ from yours as these will depend on the values you entered on your form in Test Mode Tip:If you multi-select rules in the Model Rules List (by holding down Shift or Ctrl while selecting with the mouse) and then click Build, you can build all of the selected rules at once. If one of these rules already has a rule, that rule will be displayed in the Rule Editor.
28. Change the filter box text to be feat to show the rule for the feature that we captured. We want to Suppress or Unsuppress this feature based on the Combo Box we added earlier. 29. Click on the Name in the Model List for the Feature rule. 30. Click Build on the Command Bar to launch the Rule Builder. 31. You will see a new Help Tab on the Help and Diagnostic section at the bottom of the Rule Builder.
Tip:Click on this tab to see Help specifically related to the type of rule that you are building. This will show whenever you are building rules for models.
32. The rule will be using logic, known as an IF function. The Rule Builder has built in Function Wizards to assist you when building functions.
50
www.driveworkssolo.com
33. Click on the arrow at the bottom of the Functions button on the Rule Builder Command Bar. 34. Click on the IF entry to activate the Function Wizard at the bottom of the Rule Builder.
For an IF function, three text boxes allow you to enter the three arguments. These arguments are:IF Then Otherwise This is the condition that will be evaluated If the condition is evaluated to be TRUE, use this value If the condition is evaluated to be FALSE, use this value
We are going to enter the following IF Then Otherwise WindowReturn = "Rectangular" "Unsuppress" "Suppress"
This means that if the Combo Box value is set to Rectangular, then the feature will be Unsuppressed (it may already be unsuppressed, in which case no action will be taken), and if it isn't set to Rectangular, then it will be Suppressed. Tip:If any of the three text boxes on the function wizard have focus, then double clicking on an item in the Form and Variable Browser will add that item to the focussed text box.
35. Click in the First of the three boxes on the Function Wizard. 36. Browse to the Forms on the right, and double click the Window Control Name. 37. Then type ="Rectangular"
38. Click in the second text box on the function wizard and type "Unsuppress".
51
www.driveworkssolo.com
39. Click in the third text box on the function wizard and type "Suppress".
40. Click Finish to add the function to the Rule Editor. 41. Click OK to apply the rule.
Concept:If you have text that is likely to be entered into the Rule Editor numerous times, you can store it as quick text. Click the Quick Text button on the Rule Builder Command Bar, and type in your frequently used text, hitting return between each item. Once you close the Quick text Dialog, clicking on the arrow will display your Quick Text. Click on the text to add it to the Rule Editor.
The last rule we are going to build at this stage of the training is to suppress the Rectangular Window model, if the Form value is set to be "None". 42. Click the Refresh button on the Command Bar to clear the currently selected Components, and clear the Rules List. 43. In the Component tree, check the item Rectangular Window. The Rules List will now show the Rules only for that component.
52
www.driveworkssolo.com
We are going to change the File Name rule to Suppress the rectangular window Component when the form value in "None". 44. Select the Rectangular Window File Name row in the Model List 45. Click Build to launch the Rule Builder 46. Clear the current rule by clicking on the Clear button on the Command Bar 47. Use the IF Function wizard again by clicking on the arrow on the Functions button, and selecting IF 48. Enter the following values in the three text boxes of the Function Wizard IF Then Otherwise Note:DWSpecification is a special variable used by DriveWorks Solo that is made up of the Project Name followed by a sequential number that is incremented each time you fill out a new set of forms. It can either by typed in manually, or added automatically by clicking on the arrow on the Quick Text button, and selecting: Special Variables>Specification Name Note also that DWSpecification is a variable and therefore does not need quotes around it whereas "Suppress" is static text, and therefore does need the quotes. WindowReturn = "Rectangular" DWSpecification "Suppress"
49. Click Finish to add the result to the Rule Editor and Click OK to apply the Rule.
53
www.driveworkssolo.com
The meaning of this rule, when applied to this file name, is that if the form value for Window is set to "Rectangular", then a new file will be created based on the master, with the Specification Name as a suffix, otherwise the master model will simply be suppressed. Note:Now you have your rules, you can sort and filter in a number of different ways. Checking or Unchecking models in the Component Tree adds and removes them from the list. Type in either the filter box above the Component Tree, or above the Model List to filter each one in turn. Click on any column header to sort by that column. Repeated clicks will toggle between sorting ascending, descending and unsorted. There are a few more rules we could build now for Captured Custom Properties, which we will do later in this training. You should now be ready to create some new models based on your Form and Rules. Close the Project Designer, and click Save on the DriveWorks Solo Command Bar at the top of the SolidWorks Task pane tab.
54
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 4
DriveWorks Ltd 2011 | All Rights Reserved 55
www.driveworkssolo.com
Concept:When filling out your forms in DriveWorks Solo, you can preview your models in SolidWorks at any time. If you have previewed your models at least once, then you will also be able to preview any Drawings that you captured for the top level assembly. You can also preview any documents you have captured. At this stage of the training, we have not captured any documents.
3. Change the values on the form 4. Click the Preview button on the DriveWorks Solo Command Bar to see your models being created based on the inputs and the rules that you created.
A copy of the top level assembly will now open in SolidWorks, and all of the files will have been given temporary file names.
57
www.driveworkssolo.com Change the values in your form, and click Preview again to see the updated model. Note:Once the models have been opened initially, the preview will work on the opened file.
5. Click on the Drawings button to see a preview of the Drawing that you captured for the Wooden Door and Frame
Don't worry at this point if the scale of the drawing doesn't look great, or if there are misplaced views or dimensions. Controlling these will be covered later in the training. 6. When you have finished previewing your models and drawing, click Finish at the bottom of your form. A Finish Dialog will appear.
Uncheck the boxes for the results that you do not wish to create. Click Finish to update all of the files with the correct names, and to save them into the correct folder. It will also at this point create all of the drawings captured, and not just the ones associated with the top level assembly. Note:The files that DriveWorks Solo creates during the previews have temporary file names and are stored in a temporary folder. Even if you save them, they will be deleted after you click finish on your Form, as they will already have been saved to the final location at that point.
58
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 5
DriveWorks Ltd 2011 | All Rights Reserved 59
www.driveworkssolo.com
60
www.driveworkssolo.com
61
www.driveworkssolo.com
Concept:DriveWorks does not create new configurations in parts and assemblies. Instead it creates new copies of those files. DriveWorks can however switch the used configuration based on this rule, if the part or assembly has more than one configuration. If you do not want to select a configuration to use based on a rule, then you can leave this rule blank. First of all, we are going to add a text Box to our form so that an Order Number can be typed in, we will then use that Order Number to name our files. 1. Open the Project Designer. If you are still running your forms, either click Cancel or Finish. 2. Go to the Form Design task in the Task Explorer. 3. Create a new Text Box on your form called OrderNumber. Since we are going to use this order number to name files, we need to make sure that whatever is entered is valid for a file name. The first validation is to make sure that something is entered. We do this by building a Form Warning using the Error Result dynamic property. The Error Result rule will need to either calculate to be a text string, in which case that text string is used as the form warning, or be calculated to be an empty text string which would mean that the entry is valid. 4. Click in the Error Result property for the Text Box on the Property List. 5. Click on the button that appears which will launch the Rule Builder.
62
www.driveworkssolo.com
We can further enhance this by adding the function ISVALIDFILENAME, which will make sure that valid characters are entered suitable for a file name. 7. Update the rule to use a nested IF function as below.
Concept:Nested IF functions are created by placing a completed IF function, with its 3 arguments, inside either or both of the last 2 arguments of an existing IF function.
8. Click the Function button on the Rule Builder Command Bar to find the ISVALIDFILENAME function.
The above rule has had carriage returns and spaces added to make it clearer to read. While this is not necessary, it does help if you need to re-visit the rule at a later date. 9. Click OK to apply the rule. Now we can link the file name of our models to this OrderNumber. 10. Go to the model rules by clicking on Model Rules in the Task explorer 11. Right Click on the Wooden Door and Frame in the Component Tree and click Select Children DriveWorks Ltd 2011 | All Rights Reserved 63
www.driveworkssolo.com
12. Type file name in the filter box at the top of the Rules List 13. Multi-select all of the file name rules (except for the rule for the Rectangular Window, we have already changed that so will need to modify it separately).
Tip:To multi select with exclusions, click the first rule, <shift>click (click with the mouse while holding down the Control key) the last rule and then <control>click the one to exclude.
14. Click Build. You will see the existing rule in the Rule Editor For now, we are going to append the value typed in the OrderNumber field on our form, onto the end of the original file name. So if we type QT123 into the OrderNumber field, the new version of this assembly will be called: Wooden Door and Frame QT123 Note: - DriveWorks automatically adds the space between the original file name and the new suffix.
15. Click the Clear button on the Rule Builder Command Bar to clear the Rule Editor. 16. In the Form Browser on the right, double-click on OrderNumber. This creates the rule OrderNumberReturn. 17. Click OK to save the rules. The Rules and Values will be updated automatically in the Rules List. Unless you entered a value for OrderNumber when you created it, the value will currently be blank.
64
www.driveworkssolo.com
18. Next, select the Rectangular Window File Name rule and click Build. 19. Double click on the word DWSpecification in the Rule Editor. 20. In the Form Browser on the right, double-click on OrderNumber. This will replace the selected text in the Rule Editor with the OrderNumberReturn
21. Click OK to apply the Rule With the Order Number being used this way, and assuming an OrderNumber of QT543 is filled out in the form, the following assembly structure would be produced.
There are however, a couple more things we could do at this stage with File Naming. We could decide not to use the original file name in our new file name, or we could use a different rule so that the new file name includes the parameters that drive it. Lets create a file name that does not use the original name. 22. Select the Wooden Door and Frame file name rule in the list of rules, with nothing else selected. 23. Click Build to launch the Rule Builder.
65
www.driveworkssolo.com
Concept:You can string different bits of text together as well as variables, constants, form values etc, using double speech marks around text, and linking text and variables together using the ampersand character (&). The rule should now look like this: "*" & OrderNumberReturn Concept:Having the asterisk (*) at the start of a file name rule tells DriveWorks Solo to exclude the original name when it calculates the new file name. Going back to the original example, we would now get the following results based on entering the order number QT543:
Note the new name for the Wooden Door and Frame. We can now take this one stage further by building up a text string for the new name for the component Top Door Jamb. 25. Select the Top Door Jamb file name rule in the list of rules, with nothing else selected. 26. Click Build to launch the Rule Builder. 27. Click on Clear Rule and then build up a new rule using the Variable for FrameWidth and adding the word long on the end. Since DWVariableFrameWidth is a named value, and the word long is plain text, the rule should look like this:DWVariableFrameWidth & " long" Notice the space after the first speech mark and before the word long.
66
www.driveworkssolo.com Now based on an OrderNumber of QT543 and an OpeningWidth of 1350 (which would calculate the variable DWVariableFrameWidth to be 1330), the new assembly structure created by DriveWorks Solo would look as follows:-
Note the driven name for the component Top Door Jamb 1330 long. As DriveWorks Solo will use existing files if they exist, and create them if they don't, by using the length in the file name, if DriveWorks Solo calculates that it has a requirement for the same file, it will not be re-created, provided that its folder rules are also the same. We can therefore change the Relative Path rule for the Top Door Jamb to place its files in a folder called C:\MyModels\Standards 28. Select only the rule for the Relative Path of the Top Door Jamb. Filtering the Rule List or only checking the Top Door Jamb item in the Component Tree may help you find this. 29. Click Build to open the Rule Builder. 30. Enter the new rule:
"C:\MyModels\Standards"
Note:The folder structure inside a Relative Path rule is created using the \ separator. However you should not have a \ at the start or end of the Relative Path rule.
32. Close the Project Designer, click on the save button on the DriveWorks Solo Command Bar and Specify more models by filling out the forms. When you click finish, note the names and locations of the files created.
67
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 6
DriveWorks Ltd 2011 | All Rights Reserved 69
www.driveworkssolo.com
In the Training files folder, there is a file called Ball handle.SLDPRT. 3. On the Replacement Models section, click the Browse button and browse for the Ball Handle.SLDPRT part.
This tells DriveWorks Solo that we may want to swap in the Ball Handle to replace the Lever Handle. Now we need to tell DriveWorks Solo when to swap it in. For this we will need to add another form control. 4. Open the Project Designer, and go to the Form Design section by clicking on the Form Design task in the Task Explorer.
Option Groups
71
www.driveworkssolo.com
1. Add an Option Group to your form, giving it the name Handle. Option groups behave in a similar way to Combo Boxes, in that they have a dynamic or static list of options where you choose one from many when you fill out the form. 2. Build a rule for the Items property of your new Option Group 3. Type "Lever|Ball" in the Rule editor and click OK.
Picture Box
1. Add a Picture Box to your form. Call it HandlePicture. Picture Boxes have a File Name property. This uses the Rule Builder to help create a file name.
Note:The Picture file name rule can either be a full path, or relative to your Project Folder.
2. Select the File Name property in the Property List, and click the button to launch the Rule Builder.
3. Click on the File button on the Rule Builder Command Bar. 4. Browse for the Ball Handle JPEG picture in the content folder of the training files. If this folder is relative to the Project Folder, then the path of the Project Folder will be removed. This will help when you either move your project, or distribute it to others.
72
www.driveworkssolo.com
This will now display the Ball Handle Picture at all times, unless we make it dynamic. We can do that by editing the rule to use the value selection in the handle option group. 5. Change the rule to
"Content\" & HandleReturn & " Handle.jpg" Notice that the word Ball has been replaced with a dynamic value, and since this is a combination of static text and dynamic values, the ampersand (&) character is used along with quote marks.
6. Click OK on the Rule Builder. Your Form should now look something like this.
If you don't see the picture change based on your selection for handle, there are two possible reasons. Either the files are not where you have referenced them (have a look in the folder, and make sure your rule points to that folder bearing in mind the Project Folder) or the pictures are
73
www.driveworkssolo.com bigger that the picture box and therefore you are only seeing the top left corner of the picture. If this is the case, try changing the Size Mode property for the picture box to StretchImage or Zoom.
We now need to update the rule for the Lever Handle file name to swap in the Ball Handle if that option is selected.
Model Rules Replacement Files
1. In the Model Rules, build the rule for the File Name of the Lever handle. The Rule will be as follows
2. Use the IF Function Wizard as before to help you build the rule. 3. Now, if the Lever Option is selected in the Option Group, then a new Lever will be created with the Order Number as a suffix to the original file name. If Ball is selected, then the Lever Handle will be replaced with the Ball Handle. 4. Close the Project Designer and test the swapping of the file by filling out your form and previewing.
Concept:You will notice that the Ball Handle swaps in successfully for the Lever Handle without errors in the mates. This is because the internal ID of the mates is the same in both models. To achieve this, the Lever Handle had been copied to be the Ball Handle, and the geometry then changed.
74
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 7
DriveWorks Ltd 2011 | All Rights Reserved 75
www.driveworkssolo.com
Tables
We can take the replacing of files even further with the ability to drive the replaced file once swapped in. We will do this by swapping in a Circular Window to replace the Rectangular Window There are a few tasks that we can do now: Use an existing Table in Microsoft Excel to update the Window Combo Box to include the Circular window, and reference a picture. Add a dynamic picture to the form, which will update whenever the Window Combo Box is changed. Capture the circular Windows dimensions. Capture the Round Cut Out in the Door. Update the rules for the Rectangular Window file name, and add a rule to Suppress/Unsuppress the cut out. 1. Open up the Project Designer and select the Define Tables task in the Task Explorer. 2. Click the Add button on the Command Bar to add a new Table to your Project. 3. Assign a name for the Table. Call it Windows. 4. Click Finish on the New Table Dialog. 5. Open up the Excel File ExternalData.xls located in your training folder. 6. Highlight the table on the Sheet Windows and Copy the data onto your Clipboard. Make sure you include the headers. 7. Select in the Cell A1 in the DriveWorks Table and Paste the data.
77
www.driveworkssolo.com
Concept:DriveWorks Solo tables can either be manually typed in, or have their data copied and pasted from excel. It is important to have your data structured as a table, with appropriate headings that mean something. This will become more obvious when we start to reference this table in our rules.
8. Go back to the Form Design in the Project Designer, and select the Combo Box for the window. 9. Click in the value for the Items Property in the Property List, and click the button to launch the Rule Builder.
10. Clear the current rule. We are now going to build a rule that will result in a list of every value in the first column of our table, except for the header. Click on the arrow below the Functions Button. Select LISTALL. The Function Wizard will show at the bottom of the Rule Builder with two drop downs. The first is a list of all the tables you have in your Project, at this stage only one, and once you have selected in the first drop down, the second will have the column headers of that table. Tip:This is the reason why we mentioned earlier that having meaningful header names is important.
11. Select the name of your table in the first drop down ( Windows). 12. Select the first header in the table in the second drop down (Window). 13. Click Finish. DriveWorks Solo will build the rule for you as shown below.
78
www.driveworkssolo.com
Note:The actual arguments passed into the function are the name of the Table, with a DWLookup prefix to help DriveWorks Solo identify it as a table, and a number which is the column number in the table.
14. In the Help and Diagnostics section at the bottom of the Rule Builder, select the Values Tab. The result is the same format as the static value that we had before with the Pipe bar as a separator. i.e. <Value1>|<Value2>|<Value3>| etc 15. Click OK to apply the rule and close the Rule Builder. Since we now have a table of values, we can lookup other values in that table based on our selection 16. Add another Picture to your form and call it WindowPicture, and click in its File Name property and Launch the Rule Builder. Rather than using the File button on the Command Bar, we are going to perform a lookup into our table and find the corresponding picture for the Window selected in the Combo Box.
VLookup Function
The function we are going to use is VLookup. Since this is a common function, you will find it by clicking on the arrow below the Functions button
79
www.driveworkssolo.com There are four arguments of a VLookup: Lookup In Column Match Type This will be the value from the form (Window) and is used for the search The table that the data is in The column where the resultant value is located True if a nearest match is required, False if an exact search is required
Setting this to True is useful if you have numbers in your first column Clicking VLookup will activate the Function Wizard for the VLookup function. 1. Click in the Lookup text box to give it the focus. Use the form browser on the right and double click on the Control Name Window. As usual, this will add the control name with the Return suffix. 2. In the First Combo Box, select the table we want to find the value in. At this point, you will only have one in there. Select Windows. 3. In the second Combo Box, select the Column header that the result will come from. Select Picture. 4. In the Match Type combo box, select Exact Match.
Note:Nearest match would be used if you had a sequence of numbers, say 1,2,3 and 4, and the value you had to search on was for instance 2.8 in which case the nearest match is 2 You should have the results below
80
www.driveworkssolo.com
6. Switch the form into Test mode in the form designer, and change the Window value to see the picture update dynamically.
Tip:Remember, if you can't see the picture, either the paths are wrong, in which case manually edit the Windows table, or change the mode of your Picture Box to either zoom or stretch We are also going to enhance the form in a number of ways. We will add a new form to enter the Window dimensions, but only if we have chosen a window at all. We will only show the dimensions specific to the type of window we are capturing.
81
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 8
DriveWorks Ltd 2011 | All Rights Reserved 83
www.driveworkssolo.com
Form Navigation
1. Click on the Form Navigation task on the task explorer 2. Click on the New Form button to add a new form to your project. Call the form Window 3. Click on the New Decision button to add a decision to your project. Call the decision WindowReqd
Concept:Form navigation is achieved by dragging the Connection Points from one form or decision to another. The Connection Points are the colored circles that appear either on a Form or Decision, or near the entry point to the next Form or Decision for an already connected item The decisions have a Green and Red Connection point. Forms have a grey Connection Point.
4. Drag the Connection Point on the end of the exit link of the Details form, and Drop it onto the Window Required Decision. 5. Drag the Green Connection Point on the decision and drop it on the Windows From. 6. Drag the Red Connection Point on the decision and drop it on the Finish Node. 7. Drag the Grey Connection Point on the Windows form and drop it on the Finish Node. 8. Your Form Navigation should now look something like this:
85
www.driveworkssolo.com
Tip:Click on a form or decision to drag it around the screen. Use the alignment buttons on the Command Bar to organize your navigation. The final thing to do on the Navigation is to build a rule for the decision so that DriveWorks Solo knows which form to show 9. Click on the Window Required decision. 10. Click the Build button on the Command Bar. The result of this Rule needs to be either True or False. If the rule calculates to be true, then the form with the green link will be shown, if the rule calculates to be false, then the form with the red link will show. If the next form happens to be Finish, then the specification will be finalized. We want our rule to be true if either the Rectangular or Circular Window are selected. 11. Type the following in the Rule Editor:
WindowReturn <> "None" Then if we pick anything other than None, the result will be True, and the Window form will be shown:
86
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 9
DriveWorks Ltd 2011 | All Rights Reserved 87
www.driveworkssolo.com
88
www.driveworkssolo.com
The final task with the forms on this section is to hide the Window Width and Window Height controls when a Circular Window is selected, and hide the Diameter control when a Rectangular window is selected. Concept:Controls can be hidden or disabled based on rules. Every form control has a Enabled and Visible property that can be set dynamically
10. With the Diameter control still selected, click in its Visible property on the Property List. 11. Click the button in the Visible property to launch the Rule Builder.
89
www.driveworkssolo.com
Using this rule, the Diameter will only be visible on the form at run time if the Circular window is selected. 13. Click OK to apply the rule 14. Multi select the other 2 controls on the form Window Width and Window Height.
Note:Providing controls have the same properties, you can multi-select them and build rules for a property that will then be applied to all selected controls.
90
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 10
DriveWorks Ltd 2011 | All Rights Reserved 91
www.driveworkssolo.com
Tip:Remember that if you have changed the name of a feature or dimension from the original name that SolidWorks assigns, then DriveWorks Solo will recognize that, and use the changed name.
5. Double click on the same feature in the SolidWorks Feature Manager, and capture the diameter dimension. Call it Diameter.
Tip:Even though the feature is suppressed, you can still capture its sketch dimensions. That said, you might find it easier to unsuppress it first if the sketch has many dimensions.
6. Open the model Circular Window.SLDPRT which can be found in the same folder as the other training files using the SolidWorks File Open Menu or Command. 7. Click to capture the active model. 8. Capture the diameter dimension (double-click on the feature Extrude1 to display the dimension). Use the name Diameter. 9. Open the Project Designer and activate the Model Rules task. 10. Click the Add button on the Project Designer Command Bar, check the Circular Window and click OK.
93
www.driveworkssolo.com
Concept:You have now added another Component Set to your Project. DriveWorks Solo allows you to have as many Component Sets as you want within an Project. You can then choose, based on rules, whether to create None, One, Many or All of your component sets whenever you fill out your forms. You can also use any component set as a replacement for any model within your main assembly In this case, we will build a rule to replace the rectangular Window with the Circular Window when we choose Circular from the Window Combo Box You will see your new Component Set in the Model Rules Tree.
Note:If our rules dictate that the Circular Window will be required, then it must have its values calculated before the main assembly itself. It is therefore important to move the Circular Window to be above the Wooden Window and Frame in the tree.
11. Select Circular Window in the tree. Click the Move Up button on the Project Designer Command Bar.
94
www.driveworkssolo.com
The next task for the Circular Window is to update the rules. 12. On the Model Rules task, check the Circular Window in the Model Tree. Notice that the rules have already been filled in for the File Name and Relative Path. We need to update the File Name rule to make sure that if we don't select the Circular Window, then it won't get created at all. 13. Select the File Name rule for the Circular Window and click the Build button. 14. Use the IF function wizard to create the following rule.
15. Click Finish of the Function Wizard to add the rule to the Rule Editor. 16. Click OK on the Rule Builder to apply the rule. 17. Select the Diameter Dimension in the Rule List and click Build on the Command Bar. 18. Build a rule for the Diameter using a straight mapping from the Diameter input on the Window form.
Next we need to build a rule for the Round Cutout and Diameter in the Wooden Door Component.
95
www.driveworkssolo.com
19. Check the Wooden Door in the Model Tree to show its rules in the Model List. 20. Build a rule for the feature using the following:
Concept:Features will be removed from the model if the rule is calculated to be "Delete"
21. Build a rule for the Diameter using a straight mapping from the Diameter input on the Window form The final task is to tell DriveWorks Solo when to swap the rectangular window for the Circular window, bearing in mind that we have already built a rule for the Rectangular window to decide whether to suppress it if no window is selected 22. Check the Rectangular Window in the Model Tree and selecting its File Name rule in the Rule List, click Build.
Concept:We are going to use a second IF function, nested inside the existing IF function.
23. In the Rule Editor, delete the word Suppress along with the quotes that surrounded it. Make sure the curser is still in the position where this word used to be.
96
www.driveworkssolo.com
24. Click on the arrow below the Functions button on the Rule Builder Command Bar, and select IF to show the IF Statement Wizard. In the first argument, use: WindowReturn = "Circular" In the second argument we want to use the name of the component set to use, if Circular is selected. Concept:You may have noticed that there is a new tab on the Form and Variable Browser called Components. This gives you an easy way of building a rule to replace one component with another.
25. Once you have clicked in the second argument on the Function Wizard, using the Components Tab, double click on the Circular Window Component. This adds the text "<Replace>Circular Window" including the quotes. 26. In the third argument, type the word "Delete" using the quotes.
Concept:If a File Name rule equates to the text "Delete" then the model will be removed from the new copy of the assembly it is in.
27. Click Finish on the Function Wizard to add its text to the Rule Editor at the place where the curser is. The resultant rule will be a nested IF function, and with spaces and line breaks added for clarity, will look like this:
97
www.driveworkssolo.com
Test your models by running your forms. Preview each option to ensure that you get the results that you expect. Tip:If you do not get the results you expect, make sure you look in the Release Reports and Model Generation reports. Now add some of the other controls to your form, such as Dynamic Labels. These are handy when giving onscreen instructions. Building the dynamic Caption Property based on a rule allows you to give the instruction required dynamically.
98
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 11
DriveWorks Ltd 2011 | All Rights Reserved 99
www.driveworkssolo.com
1. Select the Description custom property for the Top Door Jamb. 2. Click the Build button on the Command Bar. We are going to make this text dynamic based on the length of the top door jamb, which is linked to the Frame Width. 3. Create a rule that builds up a text string.
1. Select the Date custom property for the Top Door Jamb.
101
www.driveworkssolo.com
2. Click the Build button on the Command Bar. We are going to make this text dynamic based on today's date, which will then be Formatted. To do this, we will use the TEXT (<<Value>>, <<Format>>) function We will also use the function TODAY() which will use today's date. 3. Create a rule that builds up a text string based on today's date.
DriveWorks Solo recognises the custom property DWColor (and DWColour) and uses its value to drive the color of the model. The calculated value of the rule needs to be in the format "255|126|126" where the numbers represent the RGB color. The spreadsheet that we used earlier (ExternalData.xls located in your training folder) has a second sheet with a table of Standard Colors. 1. Create a new Table in DriveWorks Solo and call it Colors. 2. Open the Spreadsheet ExternalData.xls. 3. Highlight the table on the Sheet Color and Copy the data onto your Clipboard. Make sure you include the headers. 4. Paste the data into your new table, remembering to paste into Cell A1.
102
www.driveworkssolo.com
5. Create a new Combo Box on your Details form called FrameColor. 6. Build a rule for the Dynamic Items Property by click on the button that appears in the Items Property value box. 7. Use the LISTALL function wizard to create a list based on the first column in the table.
9. Finally, switch back to the Model Rules task in the Task Explorer. 10. Multi-Select the DWColor custom property for the Top Door Jamb and Door Jamb. 11. Click the Build button on the Command Bar. 12. Build a VLOOKUP function rule using its Function Wizard (Found by clicking on the arrow below the Functions button).
103
www.driveworkssolo.com
DriveWorks Solo recognises the custom property DWMaterial and uses its value to drive the material of the model. 1. Add a List Box to your Details Form using the name DoorMaterial. 2. Build a rule for the Items property of the List Box. 3. Use the LIST Wizard to build up a list of Materials (found by clicking on the arrow below the Functions button). 4. Type the values Oak, Pine, Beech, Maple, Mahogany, with each on a new line.
104
www.driveworkssolo.com
6. Click OK to apply the rule and add the values to the list box.
7. Finally, switch back to the Model Rules task in the Task Explorer. 8. Select the DWMaterial custom property for the Wooden Door. 9. Click the Build button on the Command Bar. 10. Build a rule using the new list box value.
105
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 12
DriveWorks Ltd 2011 | All Rights Reserved 107
www.driveworkssolo.com
Documents
DriveWorks Solo is shipped with some template documents. One example of this is a Quotation. The quotation is based on XML and creates an HTML document. 1. Open the Project Designer and click on the Documents task. 2. Click the Add button to on the Command Bar to add a document to your Project. 3. Select the Quotation template and give the document a name. Use Quote. 4. Click Finish to add the document to your Project.
The Document View will switch automatically to edit the details of the document. Here you can build rules to drive the document. Concept:As with models, documents require a File Name rule and a Relative Path rule. Again, as with models, these have been created for you, although you can change them if required to your desired location. Documents then have Values that can be driven based on rules. All of these values are automatically mapped through to Variables that are also added when you created the document.
5. Click the Preview button on the Command Bar. This will open the document in a Browser. Notice that there are default values in the document that are all driven from Variables. The easiest way of updating these values is to update the Variables that drive them.
109
www.driveworkssolo.com
6. Activate Variables by clicking on the Define Variables task on the Task Explorer. You will see two new Variable Categories added to your Project, one called Common and one with the same name as your document. 7. Click on the Common Category in the Category Tree. The Variable List will show the Variables in this Category. In the Common Category you will see Variables for things like Company Name, Company Address (3 lines), Quote Number as well as some dates, and a Customer Contact and Address 8. Click on the Quote Category in the Category Tree. In the Category with the same name as your document (Quote) there is some general information such as some terms, and if you drill down into this category in the category tree, there is a sub category called Line Items, which itself contains a Category for 10 line items. Each of these sub categories has 4 Variables for Quantity, Description, Discount and Unit Price.
110
www.driveworkssolo.com If you build any of the rules for these variables, they will automatically be updated in the document. 9. Click on the Company Name Variable either in the Category Tree (in the Common category) or click the Common category to show its Variables in the list. 10. With the Variable selected, click Build. 11. Change the default text to be your Company Name and since it is static text, use quotes.
13. Drill down into the Category Tree and build a rule for the Description of Quote Item 1 using Variable QuoteItem1Desc. This name could be different based on the name you gave the document. The rule will build up text using static text and dynamic text based on your form selections.
Use the Values and Steps helpers at the bottom of the Rule Builder to assist you in getting the syntax correct. DriveWorks Ltd 2011 | All Rights Reserved 111
www.driveworkssolo.com
14. Next build a rule for the Item 1 Unit Price using the Variable QuoteItem1UnitPrice. This name could be different based on the name you gave the document. At this point, it doesn't matter that our price is in any way accurate. The rule we build will take into account the overall size of the Door, with a factor for the type of window used. Don't use a currency symbol in this rule, just use numbers. The currency symbol is also a Variable, allowing you to change it based on rules. We are also going to format the result to always show 2 decimal places using the TEXT function Start off by multiplying the OpeningHeight and the OpeningWidth, and then divide it by 4000 (arbitrary number)
15. Next, multiple this by a factor based on the type of window selected. There is data in the table we created for this. 16. Use the Vlookup Function Wizard to assist with this.
17. Click Finish to add the resultant text to the Rule Editor. Make sure the Cursor is in the correct place in the Rule editor before using the wizard.
112
www.driveworkssolo.com
18. Finally, make sure we format the text to show 2 decimal places. To do this, we need to use the text we have so far as the first argument of the TEXT function. TEXT( <<Text to format>>, <<Format>> ) 19. Click on the Function button on the Rule Builder Command Bar. In the dialog that pops up, select the TEXT function from the list (use the Filter at the top to reduce the list).
20. Cut and Paste the text from the Rule Editor into the first text box on the TEXT wizard. 21. Type "0.00" in the second argument, which will format the text to always show 2 decimal places. For more information on the formatting options of the TEXT function, look in the DriveWorks Solo Help file
113
www.driveworkssolo.com
22. Click Finish to add the text from the wizard into the Rule Editor.
23. Click OK to apply the rule. 24. Change the Item 1 Qty to be a static value of 1. (For the adventurous among you, create a spin button on your form, and link this quantity variable to the value of the spin button). 25. Change the Description for Line Item 2 to show text based on the Handle selection on the form by building a rule for the Variable QuoteItem2Desc
26. Change the Item 2 Unit Price so that it changes dynamically based on your Handle selection
114
www.driveworkssolo.com
28. Select the Documents task on the Task Explorer and Preview your document.
115
www.driveworkssolo.com
DriveWorks Solo
Design Automation for SolidWorks
Lesson 13
DriveWorks Ltd 2011 | All Rights Reserved 117
www.driveworkssolo.com
Drawings
We can improve the Drawings that we have already captured, by controlling sheet scale, view positions, Annotation text and much more. This section covers the capturing and driving of Drawing parameters.
Once the drawing has opened, the Capture explorer will change to be specific to capturing drawings with different sections to parts and assemblies
119
www.driveworkssolo.com
1. Check all of the Sheets and Views. We are going to control them all. Notice that an image appears at the top of the Capture Explorer showing the layout of each sheet. If you select a View in the tree, it will be highlighted in green in the layout picture.
You can also resize any of the panes in the Capture Explorer by dragging, as shown in the picture above. Information is also displayed about the current size and position of views and sheets, as well as the Captured information that will be driven based on your rules.
120
www.driveworkssolo.com Notice in the picture that the Scale of Drawing View4 will not be controlled as it is linked to the sheet scale.
5. Click Add to capture the Annotation text. 6. Select the text on Sheet 2 which currently reads Frame-FrameSize. 7. In DriveWorks Solo, enter a meaningful name. Use Frame Text.
8. Click Add to capture the Annotation text. 9. Select the text on Sheet 2 which currently reads ContainsWindowReqd. 10. In DriveWorks Solo, enter a meaningful name. Use Window Text.
121
www.driveworkssolo.com
11. Click Add to capture the Annotation text. You can also capture View Dimensions in the section, to enable you to control the text to the left, top, right and bottom. Information on the rules required to do this can be found in the help file.
The selected view will be highlighted in Green in the preview, and the view will be selected in SolidWorks. If the Drawing is not showing the correct sheet, then this will be activated automatically.
122
www.driveworkssolo.com
3. In SolidWorks, draw a fence around the dimensions and balloons on the left of the view.
This will highlight the dimensions and balloons in SolidWorks to the left of the view. 4. Check the Left Checkbox.
5. Click Apply.
123
www.driveworkssolo.com The selected dimensions will be added to the tree. Without the need for Rules, these dimensions will be placed back in these relative positions when a new drawing is created, regardless of the size of the new model and view. We will now do the same for the Top, Right and Bottom. 6. In SolidWorks, draw a fence around the balloons on the top of the view.
Tip:SolidWorks does not always update the selected items collection when selecting balloons. If you <Control>Select a dimension to select it, and then <Control>DeSelect the same dimension to deselect it, then SolidWorks will update its selected items collection allowing you to capture Balloons only.
This will highlight the balloons in SolidWorks to the top of the view. 7. Check the Top Checkbox.
Notice that the Left Checkbox has changed to be a partially selected state. This is because some of the currently selected annotations are already captured to the left, and some of the currently selected annotations are not.
124
www.driveworkssolo.com
8. Click Apply.
9. In SolidWorks, draw a fence around the balloons on the right of the view. Again, you may need to <Control>Select and <Control>Deselect a dimension to get SolidWorks to update its selected items collection.
125
www.driveworkssolo.com
12. In SolidWorks, draw a fence around the dimensions and balloons on the bottom of the view.
Tip:When drawing the fence in SolidWorks, if you draw from Top Left to Bottom Right, it selects everything that is inside the fence. If you select from Bottom Right to Top Left, if selects everything that is inside the fence AND everything that crosses the fence.
126
www.driveworkssolo.com
Notice again that the Left and Right Checkboxes have changed to be a partially selected state. This is because some of the currently selected annotations are already captured to the left and right, and some of the currently selected annotations are not. 14. Click Apply.
You can use any selection method you choose to select annotations, including single click select, and multi click select using the <Control> key. If you move any dimensions around on the sheet after capture, simply click the Update Positions button.
You can also deselect Captured annotations, by selecting them in SolidWorks, and checking the appropriate position check box until it is the state you require.
Capturing Layers
DriveWorks Solo allows you to control the visibility of Layers on your Drawing.
127
www.driveworkssolo.com
1. Activate the Layers section by clicking on its header in the Capture Explorer. The list will then show the current Layers in your Drawing.
To Capture a Layer, check it in the list. For the purposes of this training we are going to capture the Layer Description Text. The annotations you captured earlier for the Door, Frame and Window Text are the only items on this layer. Using a rule to hide the layer will therefore hide these annotations. 2. Check the layer Description Text in the list.
128
www.driveworkssolo.com
In this particular Drawing, the Custom Property PARTNO. is linked to the Drawing Number field in the Drawings border. 2. Use the filter box at the top to filter the custom properties by typing in the word Part.
Note:As with Model Custom Properties, you can add new Custom Properties to your Drawing by typing in a new Custom Property Name and clicking Create.
129
www.driveworkssolo.com
Each time you create a new version of this drawing, you will now get a PDF version automatically.
Layer Rules
We will start by building a rule for the captured Layer. We may want a Check Box on our form, to let the user decide whether or not to show that layer.
130
www.driveworkssolo.com
2. Back on the Drawing Rules, select the rule for the Description Text layer and click Build. 3. Build an IF statement rule such that if the ShowDrawingNotes Check Box is checked, then the Layer will be visible, and if not, it will be hidden.
4. Select the Frame Text rule in the Drawing Rules List 5. Click Build 6. Build a rule that will describe the frame
131
www.driveworkssolo.com
7. Select the Window Text rule in the Drawing Rules List. 8. Click Build. 9. Build a rule that will describe the window. If there is no window, then we should delete the note. The rule also needs to take into account of the type of window. We will use a nested IF function.
132
www.driveworkssolo.com Notice the use of the LEFT function to return the first character from the Window and Lever selections.
Sheet Rules
3. Select the Sheet1-Sheet State rule in the Drawing Rules List. 4. Click Build to build a rule for the sheet state of sheet1. For sheet state, you can build a rule that will evaluate to the result "Delete" if you want to delete the sheet, or to some other text value if you wish to rename the sheet. Renaming sheets can be useful as DriveWorks Solo will automatically export a DWG or DXF file based on that sheet if the name is changed to either of those. We will build a static rule that will automatically export a DWG fine of sheet1 each time a new drawing is created. 5. Create a static text rule that will change the name of the sheet.
The only other items we are going to build for the sheets at this point are the scale values. Concept:DriveWorks Solo allows you to build a rule for both the Scale Numerator and the Scale Denominator. If the Numerator is greater than the Denominator, then the scale will be greater than 1:1 and visa versa. It is normal practice to set one of these values to a static value of 1.
6. Build a rule for the Scale Numerator of both Sheet1 and Sheet2 to be a static value of 1. We now need to calculate the scale Denominator. In this case, because of the orientation and types of views that we have on our sheets, the only dimension that will significantly influence the required scale of the sheet is the Opening Height. Your Sheet scale rules may need to take into account multiple dimensions We will use a simple rule, calculated from the basis that:-
133
Transposed for the New Scale, we get: NewScale = ( NewHeight / ExistingHeight ) * ExistingScale And then to make sure that we only get a whole number, we can add the roundup function with an argument of Zero decimal places NewScale = ROUNDUP( ( NewHeight / ExistingHeight ) * ExistingScale , 0 ) 7. Using this, build a rule for the Scale Denominator of both sheets.
Where 2245 is the current size in the model for the opening height, 20 is the current scale. Tip:This will possibly result in a non-standard sheet scale. If you want to use standard sheet scales, create a table of allowable sheet denominators, and then use the VLOOKUP function to find the nearest value, both looking up in, and returning from, the first column.
View Rules
Since the View scales are linked to either the sheet, or the parent view scale, we don't need to build rules for these for this drawing. If we did, we would build them in exactly the same way as the Sheet scale. Concept:The View state rules can be built to delete a view, if the result of the rule is evaluated to be "Delete". We now need to build rules to position the views on our drawing. When a drawing gets rescaled, the views can be moved to new locations. Building these rules ensures that the views are positioned exactly where we want them. These rules will control the Top Left position of each view.
134
www.driveworkssolo.com You can drive your view positions to be exactly where you want them, although in this case, we are going to build rules to position them back to their original locations on the sheet. The original locations can be found by clicking on each view in turn in the bottom panel of the Drawing Rules List and noting the Top and Left positions in the Information Panel. 1. Build the rules for all of the View Positions to locate them back to their original locations.
Notice that position has been typed into the filer box to limit the rules to the view positions, and also that approximate values have been entered compared with the exact current locations of the views. Tip:If a view is aligned to another View in SolidWorks, then DriveWorks Solo will ignore driving the position in the alignment direction. The work on Drawings for this training is complete. Run your Project a few times to ensure that all of the rules are correct and that you are receiving the desired results. If you are not receiving the results that you expected, re-visit and amend your rules accordingly.
135
www.driveworkssolo.com
Appendix
Preparing Your Models for Automation
The models that were provided for you during this evaluation were created with automation through DriveWorks in mind. They therefore have no design tables, or in-context design, and have been mated together on pre-defined planes. When DriveWorks creates new model sets based on the masters, it is copying files and then re-referencing any associated files. It is therefore wise to construct the models and create mates knowing what is to be driven. For instance, if you mate parts in an assembly based on one of its features, and then delete that feature based on a rule, the mate will error in the new clone. It is therefore important to understand just how models will be driven. It is also important to be able to understand the design logic, especially when building and testing the rules. If incontext design is used, along with design tables and/or equations, and then DriveWorks is also used to drive dimensions, features and custom properties, correcting any unexpected model results can be hard work, as its difficult to know where to look first to resolve the issue.
In-context Design
Be careful with in-context design when drilling down more than one level. DriveWorks is fine with one level of in-context design, but because DriveWorks is creating new files based on the masters, you need to be careful to ensure that the correct model is referenced at all times. Therefore do not have a Part in an assembly that is modelled up to a face on a different part in the same assembly, as the references will not update correctly when new clones are created. DriveWorks will also not update references if a Part is in a sub assembly, which is in an assembly, and the part is modelled in-context of the top level assembly. Stick to one level only. If multi level in-context design is insisted upon, then have sketches or planes in the sub assembly that are in-context with the assembly, and then drive the Part from the sub assembly.
Part Equations
Using part equations is fine, although DriveWorks will only perform the rebuild operation once and after it has driven dimensions, features and custom properties. If the equations are in the wrong order, subsequent manual rebuilds may be required.
137
www.driveworkssolo.com That said there is an argument to say that if you are controlling dimensions from DriveWorks based on rules, there is little need to use equations.
Assembly Equations
Avoid using assembly equations. They can cause unexpected results in the resulting files.
Configurations
DriveWorks can use rules to select an existing configuration to use, but it does not create new configurations. Also when it is driving a dimension or feature, it will do this for all configurations, unless the feature or dimension is configuration specific, then it will only be driven in that configuration.
138