Start NX 5.0 and create a new model file. Now we are going to sketch a rectangle and extrude the rectangle to a block. This block will be parametric and one type of parameters in NX are called expressions. Create a sketch by pressing the sketch button.
Click on the Z-Y plane and click OK in the Create sketch dialog. You now enter the sketcher. Press the rectangle button and draw a rectangle with an arbitrary size.
Create two dimension parameters by clicking the Inferred Dimensions button. Name the parameters h as in height and w as in width. Make w dependent of h in some way (e.g. w=h*2). Change the value for h to examine that the dependency works.
Finish the sketch by pressing the flag button to the left and you return to the Modeling environment. Now we are going to give the rectangle a depth by using the extrude function. Press the extrude button and choose your sketch (the rectangle).
Define the depth either by typing in a value or grabbing the end of the green arrow. Now your wall should look something like this, of course depending on the depth and parametric relations you defined.
Now it's time to take a look at the expressions, i.e. the parameters of the wall. Click the Tools menu and select Expressions (or type Ctr-E). In the Expressions dialog, select All in Listed Expressions. Now you should see the parameters of your wall. Note that the extrude operation has two parameters that define the length of the extrude. Now create a new parameter (user defined) manufacturing_cost and make it dependent of some of the other parameters. You do it by, in the Expressions dialog, simply typing the name, giving it a formula and pressing Apply. Now it's time to save, if you haven't done it earlier.
Now we are going to create two holes; one for a door and one for a window, and parametrize! First we will sketch to rectangles and the we will extrude them into holes.
Click the sketch button and and select the front surface of the wall and click OK. Draw two rectangles using the same rectangle button as before. Now the sketch should look something like this:
Now we will constraint the door rectangle to be Collinear with the wall block. Click the constraints button, select the bottom line of the rectangle and the bottom line of the wall block.
Possible constraint will show in the constraints dialog. Choose collinear. Then constrain the window to be collinear with the door and add dimensional parameters (Inferred dimensions button) to the door and the window. Also add dimensions between the sides of the wall block and the door and window respectively to control the positioning. Rename the dimensions you just created so you later can find them easier in the expressions dialog. When done return to the modeling environment.
Now extrude the two rectangles into two holes by using the extrude button. Reverse direction of the extrude vector if needed and select a suitable Boolean for the operation. Now your wall should look sometime like this:
Open the expressions dialog again and list Named expressions to see the parameters that you have named. Play around with the parameters by changing them, creating more user defined, making them dependent or constant and press Apply to see the changes. Create expressions where you assess the geometry for downstream aspects e.g. manufacturing, cost. Try to find a practical parametrization. When your satisfied, show the results for one of the tutors.
Create a new wall or arbitrary geometry using freer geometry and explore how it can be parametrized using expressions. Try the other drawing tools of the this toolbar:
This is an example for inspiration (extrude if you like or explore other functions of NX):
Now we are going to use a function in NX that let us create an own feature (piece of geometry, often a part of a component) called an User Defined Feature (UDF). We are going to create a UDF of the wall just created and use this UDF to couple several walls into a parametric room. This is one example:
When creating the UDF you have to have something to guide the positioning of the UDF in the space. We are going to use the coordinate system for that issue. So first we'll make sure that the wall sketch is constrained to the coordinate system.
Open the wall sketch by double-clicking on the actual sketch (seen in blue in the 3D-view) or in the Part Navigator. Then use the Contraints button again and click on the left side of the wall and on the Z-axis (the vertical axis). Choose Collinear. Repeat this for the bottom side of the rectangle and the Y-axis. Now your sketch should look like this with the bottom left corner of the rectangle “attached” to the origin of the coordinate system:
Now we will add the UDF.
Now we will insert numerous walls to create a parametric room. Start a new part-file (Type: Modeling) and choose: Tools → User Defined Feature → Insert. Click the wall and the positioning and definition of expression values starts. Firstly choose the values of your expressions. Then start to resolve the references. By checking the UDF Definition window you get a hint of what you need to resolve. When there is a plus-sign in front of the references indicate that it is resolved. Click Apply and your first wall appears. Repeat the process of giving the expressions values and resolving the references and create at least three walls. If your wall gets positioned in a way you did not intend to. Double click the wall and you can edit the references. Use the reverse direction button. Change the room layout by changing the expressions.
In this exercise you will create a parametric volume where the floor guides the sizes of the walls and positioning of foor and window. The window can also be switched to a rectangular window by changing a parameter.
Start NX 5.0 and create a new model file. Make sure that roles is set to “Advanced with full menus”. You find the roles tab to the left.
Click Start and toggle Knowledge Fusion and the Knowledge Fusion Navigator (KFN) tab will appear to the left.
First we are going to create the floor by using a class that creates a block and two attributes (parameters) that we will create.
The attributes are parameters that can be used to govern the geometry objects, e.g. the child rules. We will create two attributes that control the dimensions of the floor in x and y direction.
A child rule is an instance of a class. We will now add a child rule that creates a block and let the attributes we just created control the block dimensions.
Now we will create the wall with a doorway. We will once again use the ug_block class for the wall and the door. We will parametrize the wall and the doorway to adapt to floor changes.
When satisfied with the wall it is time to create the doorway. We will create a block and subtracting it from the wall block. NOTE: It is important that you do all of the following before pressing apply in order for the subtract operation to work properly.
Your module should now look something like this:
Now lets create one more wall for the module and put a nice window opening into it. Besides that both the wall and the window opening should follow when the floor changes in size we should also enable the window to change shape from round to rectangular. Ok, lets do it!
Lets go for the window now! This time we will start by using a class that creates a cylinder; ug_cylinder and then we will use an if-then-else rule to enable a change to rectangular window. But first of all we need to create one more attribute that decides the shape of the window opening.
Your module should now look something like this (depending on the chosen dimensions of course):
Ok, now its time to create the rules that changes the shape of the window opening by changing the instance of ug_cylinder to a instance of ug_block.
Reflect over the need for more attributes to make the module more parametric.