Wednesday, 10 June 2009

search and find all supressed features in proe

How to find all supressed objects in Proe (Pro Engineer) easily.. Yes, its easy.. no manual search is needed... Thanks to to ProE seach method..

Go to Edit -> Find and the rest is in the picture.



Select all the items in the left list, add all to the right, Click Close.

Now you can do what ever you want with it. Say delete all at once!

This is also applicable for the assembly models. Make sure that the check box "Include Submodel" is clicked. By default it will be checked anyway. Try and let me know.


NOTE:
We have used option in some other way as well. We normally rename the dimension symbol to some meaningful text and the same name will be coming in different parts when it represents the same data.

What if we want to change one such dimension in all parts. Use this option. Search for Dimension. In the attribute tab, put the dim name and it gives all such dims. Select all. Close the window. Now you can modify all such dimensions at once. Regenrate and you are done.



Hope this helps....

.

Tuesday, 19 May 2009

Proe Function / Relation to round the decimal places

Its strange that ProE does not have a ROUND function. At least I counldnt find it.

It has two funtions.
Ceil will always round it up.
Floor will always round it down.

I have used both to get the ROUND functionality.
here is the relation


X is the original value.
D is the number of decimal places.
X_New is the rounded value.

X = 1.334
D = 2

X_ = X * 10^D
XFLOOR_ = FLOOR(X,D) *10^D
IF X_ - XFLOOR_ < 0.5
X_NEW = FLOOR(X,D)
ELSE
X_NEW = CEIL(X,D)
ENDIF


try and let me know if it works.

Saturday, 28 March 2009

How to use VLookUp in Microsoft Excel.



Tool : MS Excel.
Topic : The function - VLOOKUP.



This is a very useful function to extract data from the table.

Microsoft says..
"Searches for a value in the leftmost column of a table, and then returns a value in the same row from a column you specify in the table."

The format.
VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)

where..
lookup_value = search key for the first column.
table_array = Table where the data is located.
col_index_num = is the column where the data has to be extracted from.
range_lookup = TRUE or omited then finds an approximate match. FALSE then finds an exact match and returns #N/A if there is no match.


Lets take an example. Let the data table be the following one.



From this table, you can find how are you feeling [ :) ] and how many days are left for the next weekend [ :)) ].
it will look something like this..



if you replace TUESDAY with another valve, the other two values will get extracted from the table.


How it works.
the formula for the cell C11 is this.
=VLOOKUP($C$10,$B$3:$D$7,2,0)


the formula for the cell C12 is this.
=VLOOKUP($C$10,$B$3:$D$7,3,0)

where,

C10 is the feed data or the data you want to search in the first column.
B3:D7 is the table shown in the first picture. (the source data)
next is column where you want the data from. Its 2 and 3 respectively,
next is 0 [ equal to false ]


Note (1):
You can ignore the $ symbols if its complicated.
$ sign is to lock the movement of the reference cell when the cell is copied to another one.

Note (2):
You can define a name for the table which can be used in functions.
Insert -> Name -> Define.
Put the name as "Data_Table"
Put the value as "B2:D7"

So the formulae will change as
=VLOOKUP($C$10,Data_Table,2,0)
=VLOOKUP($C$10,Data_Table,3,0)


Hope this is a good introduction for you to start exploring it further yourself.
put a comment if there is anything you want to let me know.


Tuesday, 24 February 2009

How to Start with VB Programming (VBA) in MS Excel






The possibilities of using VB (VBA to be precise) is almost endless and it’s not too complicated (to do simple stuff) if you put bit of an effort and with a small programming background.



Step 1. Security Settings

Ensure that the security setting is appropriate.
Go to TOOLS -> MACRO -> SECURITY
Select either MEDIUM or LOW. If you select MEDIUM, make sure that you select the option ENABLE MACROS when you open the excel with VBA.




Step 2. Set Excel ToolBars

In Excel window, it’s better to have the following ToolBars selected. (You can do that at VIEW -> TOOLBARS)

Visual Basic
Control ToolBox




Step 3. VB Editor

Press and you will see the VB Editor.
In that window, make sure that the following are visible. (In View Menu.)

Project Explorer
Properties Window




Step 4. Create a macro.

Enter 10 in Cell A1
Enter 20 in Cell A2
Enter 30 in Cell A10

Click the Cell B1.
Click RECORD MACRO (in Visual Basic Toolbar).
Click OK in the pop up window. Now it will start recoding your actions.
Enter the formula, =A1*10 to Cell B1
Click STOP RECORDING.
Recording is finished.

How to use the macro.

Click on cell B2. Click the RUN MACRO (in Visual Basic Toolbar). Select the macro you have recorded and click RUN. Click on cell B10 and run the same macro.

You can see that the same relation getting pasted in all selected cells.

Caution: This is an example where the macro was applicable for any selected cell. Not all macros are that direct. For most of the macros, you need to manually edit if you want that to use in different places.

To show that effect, you try this. Start recording a macro. Select a cell, apply a Fill Color. Stop recording. Try using the macro for other cells. It fails. That is because the selection is also getting recorded. Now we will see how to modify the macros.




Step 5. Edit the macro.

Click the RUM MACRO. Click EDIT.

Here you would be seeing the subs (functions) for each macro. In the sub for the first macro you would see the following command.

ActiveCell.FormulaR1C1 = "=RC[-1]*10"

Note: Ignore lines starting with "'". Those are comments and are not evaluated.

In the second Sub, you would see commands starting with following line or similar.

Range("B1").Select

After that you would see few lines starting with "WITH" and ending with "END WITH". We need that. That is what is setting the color. The number represents the color you have selected.

Copy the lines from "WITH" to "END WITH".
Put it in the first macro so that the sub will look like this.


Sub Macro1()
'
' Macro1 Macro
' Macro recorded ---------- by -------
'

'
ActiveCell.FormulaR1C1 = "=RC[-1]*10"
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With

End Sub




Now close the VB editor.

In Excel delete the column B.
Click on Cell B1 and run the first Macro.
You should find that the Formula is placed and Cell is colored.





Step 6: Link the macro to a Button.

From the Control ToolBox, click and place a Button on the sheet. Once it is placed, you are in Design mode. Double click the button and place the following line in that Sub.
Call Macro1 'or with the correct name.

Close the VB Editor.
On the Visual Basic ToolBar, click EXIT DESIGN MODE.

Now verify it by clicking a cell and clicking the button.







Now you have a rough idea how it works. Play with The macro like changing color index. Say put a number in the cell D1. Modify the Sub so that the colorindex is taken from that cell like the following.
.ColorIndex = Range("D1")

Record more macros to understand how to code is doing things..

Have fun!!!




Sunday, 22 February 2009

Basics of Excel functions and relations.





Through this post, I would like to introduce the Built in Functions of Microsoft Excel to a beginner. Let me put some excel functions that could be of use to those who what to make a start.

Before touching upon some of the functions, some introductions. The first thing that I would recommend for a beginner is to browse through the list of functions and its uses. At this stage, forget how it to be used, but keep an eye one what all you can do using functions. For that, go to INSERT -> FUNCTIONS. You will see the following dialog. Here you can either select ALL, or a specific category like TEXT. Now select a function and at the bottom, you will see what it will do. To find more detailed explanation, click HELP ON THIS FUNCTION.



Note: Click the cell with Function(s) and press F2 and you will be able to see the references in different colors.



Some simple functions:


1: Sum.
To find sum of a few numbers.
Eg: SUM(A1, D5, G1:G15)


2: Min.
Minimum of a list of numbers


3. Max.
Maximum of a list of numbers


Some more functions:


4: Concatenate:
Joins several strings into one single string.
Here each string can be a reference to another cell (like A5) or a manual one (like "Hello"). Note that the manual entries should be encapsulated in double-quotes.

NOTE: there is a simpler way to achieve this. just type & in between each string entry. So..
=Concatenate(A5," is the son of ", A10) is equivalent to
=A5&" is the son of "&A10


5: Left, Mid and Right
Left function allows you to get a specified number of characters from the left side.
Right function allows you to get a specified number of characters from the right side.
Mid function allows you to get a specified number of characters from a specified starting position.

Eg:
Assume A5 => "I am not a fool"
Assume A6 => "Joe"

Left(A5, 5) => "I am "
Left(A5, 5)&": "&A6 => "I am : Joe"

This following is an exercise for you.
Left(A5, 5)&Right(A5,6)


6: Substitute
Replaces an old text with a new one.

Assume you have to change a part number format.
What have is 75423.5638.6453 and what you want is 75423-5638-6453. (Replace all .s with -s)
=Substitute(75423.5638.6453, ".", "-") => 75423-5638-6453

Also,
=Substitute(75423.5638.6453, ".", "") => 7542356386453


7: Replace
Replaces a text with another one.
The difference from Substitute is that here you are specifying the positions of the text to be replaced.


8: Upper, Lower and Proper.
Changes the case of the string to the respective ones.

Upper(AbcD) => "ABCD"


Some Special Functions:


8: VLookUp
Searches for a value in the leftmost column of a table, and then returns a value in the same row from a column you specify in the table.



VLookUp(Value In Column 1, Range of the Table, The Column number of the data to be taken)
based the feed value, the row will be selected and the data from the correct column is extracted.

VLookUp(0.675, A1:C10, 3) => 250

Also..

A15 => 0.946
A16 => 2

VLookUp(A15, A1:C10, A16) => 2.17
is the viscosity for a density of 0.946.

NOTE: Alternately, you can use HLookUp to fix the column and get the data from row.



9: IF
Gets a value based on whether a condition is true or false.

If(Condition, command if condition is true, command if condition is false).

A1 => 10
A2 => First
A3 => Second

If(A1>5, A2, A3) => First
If(A1<=5, A2, A3) => Second


10: SumIf
Adds the cells based on a given criteria.



SumIf(Criteria Range, Criteria, Sum Range)
if Sum Range is not specified, Criteria Range is taken as Sum Range.

SumIf((A2:A5, ">160000", B2:B5) => 63,000
Add cells in column B if corresponding cell in Column A >160000.
SumIf((A2:A5, ">160000") => 900,000
Add cells in column A if corresponding cell in Column A >160000.

NOTE: A similar function COUNTIF counts based on condition.


11: ISBlank
Checks if a cell is blank or not.

A1 = ""
A2 = 10

IsBlank(A1) = TRUE
IsBlank(A2) = FALSE

If( IsBlank(A1), "", 100 / A1) => ""
If( IsBlank(A2), "", 100 / A2) => 10

What if you don't do that check!!!
100/A1 => #DIV/0!
100/A2 => 10.

See the first one returns an error, which you normally don't want to happen. So the check helps to prevent that.



Enough of the functions. You can browse the remaining yourself.
Couple of other related points also.





Relative motion of references.

This is a very interesting aspect of how you can use the functions effectively. And interestingly, less commonly used.
The normal references that you take move with the copying. I will explain.

let B2 is A1 + A2 + B1
If you copy B2 to B3, the relation will automatically be changed as A2+A3+B2.
If you copy B2 to C2, the relation will automatically be changed as B1+B2+C1.
This is the normal way it functions. If copy one cell to the right, all references move one cell to the right. If you copy 2 cells to the bottom, all references move 2 cells to the bottom as well.

You can control this movement. In the sense, you can restrict some or all the movement by putting a $symbol.

a reference that is A1 is free to move in both directions.
a reference that is $A$1 is prevented from moving in both directions.
a reference that is $A1 is allowed to move up or down but not right or left.
a reference that is A$1 is allowed to move right or left but not up or down.

I will take the original example again.
let B2 is $A$1 + $A2 + B$1

copy that to C2 and you will get this.
$A$1 + $A2 + C$1

copy that to B3 and you will get this.
$A$1 + $A3 + B$1

If Row-1 and Column-A are the heading elements, this relation will give you the sum of the heading cells + A1.

Note:
Pressing F4 repeatedly will cycle through each type.




I hope that this will allow you to jump start your excel learning.
Excel is a vast ocean. But don't let that bother you. Keep it simple, Make one step at a time and don't forget to make one new step each day. After sometime, you will be amused at what you are able to do.

Let me know if you have any comments / Qns.



Sunday, 26 October 2008

Pro/Animation: Step 1 - A simple animation.

This post is to get you a very basic Animation that you can use if you are new to animation.
Proe Version : WF2

Quick Introduction:

ProE Animation is a typical ProE Module in the sense that sometimes its not easy to start with. But once you get the grip of it, its so easy and powerful. Most tend to think that it’s a hard think to crack but that’s NOT the case at all. I would try to post a few to get you started.


An Animation can made in few different ways. Main options are...

1. Come to Animation. Create few snapshots. Make a Key-Frame-Sequence. Animation is ready.
2. You can assemble the components as Connections (instead of Mate/Align/…). Come to Mechanism. Define Motors. Start the motors and you have the animation.
3. Further to step 2, you can come to Animation and add these motors appropriately and have an animation.

Option 1 is a simple, quick and easy method. But if the movements are complex, don’t use Option 1. You'll may go mad. In such cases go for Option 2 for a good animation, without any frills (without view manipulation, transparency manipulation etc).. If you really want a complex animation with all (or some) of the extra effects like view manipulation, then Option 3 is the one.

In the coming posts, I would post some of the things related to the Not-So-Simple animations. But today lets have a look at the option 1.


A simple animation:

Before starting, you can download the assembly, see and use, if you want. Link is at the bottom of this post.

Here I would bounce a box.





1. Make a normal assembly.

2. Come to Animation. [Application -> Animation]

3. By default, all parts would be part of the body "Ground". In order to have relative motion, all objects that move together should be defined as a body (one or more parts or sub-assy). Here you need to make the Box as a separate body. Click on the "Define Bodies" Icon. From the new window, select New, select the Box and say OK. You can name it appropriately if you want. Now you should have two bodies - Ground, Body1.

4. Create Snapshots. You need to create three snapshots in this case. At positions 1 2 and 3. Click on the "Define Snapshot" Icon. Drag the bodies to the positions that you need and take a snapshot (Camera Icon at the Top-Left to take a snapshot). Here you have few options to help you. (1) Advanced Drag. You can move or rotate along a specific axis. (2) Advanced Drag. "Packaged Move" help you to move multiple components together. (3) Constraints Tab. You have a few options here as well. You can Mate/Align bodies + others. I have used the mate option to place the box touching the surface for the 2nd snapshot. (4) Update. In Snapshot Tab on the left side you have an yellow triangular icon with a + inside. This is used to update the existing position to the selected Snapshot. Explore the remaining yourself. Use these options and make the three snapshots that we want. It’s a good idea to keep the snapshots organised with appropriate names.

5. Create a Key Frame Sequence (KFS). Click on the "Define KFS" icon. Select the correct snapshot and key in the time and press add. This eg, we have three snapshots. Default duration is 10 secs. We put the 1st @ 0, 2nd @ 5 and 3rd @ 10. Press OK. Now you can see that the KFS has come in the Animation Task Bar. In this, each snapshot would come as a triangle. You can select and drag these as well. To redefine, select the KFS, Right Button and select "Edit KFS".

6. Click "Generate Animation" and say OK if prompted.

7. Click on "Play the Animation" and you can Run the animation. You can use "Capture" and the animation would be saved as a MPG file in your working directory.

8. Additionally, you can optimise the duration by specifying the frame rate / frames. To do this, right click at the time scale at the bottom of the Animation Task Bar and click "Edit Time Domain".


Let me know by comments your suggestions and doubts. Have fun animating!!


[Sorry, I'm not able to upload the ProE files. Please check later for the ProE files].

Friday, 26 September 2008

Wheel Rolling and falling. Made in ProE Mechanism.




This is the continuation of the previous post that I had.

I modified the previous mechanism a little bit, and I got this. I removed the slot-follower connection and instead I added an additional pin connection which makes the wheel rotate about the vertical. That plus the manipulation of the tilting angle resulted in this. I think the rendering also is a bit better. It took almost couple of hours to capture the rendered video! But worth the effort..

Here is the video...



I will upload the assembly later, so that you can try it out yourself and see the mechanisms.. come back later and have a look.. its almost midnight and I need to sleep, because I have lot of stuff (not ProE) to do before I shift back to Bangalore.. Yaa, after a short stay here in Germany, I am raring to go back :)

bye for now..


Link for downloading the video:



Thursday, 25 September 2008

Wheel Rolling and tilting. Made in ProE Mechanism.




This is a Mechanism (with Animation) of a wheel rolling along a guide curve, tilting on its way..


I was browsing through the PTC Forum and found a requirement. He wanted to simulate a wheel rolling along a curve with a possibility of tilting as well.

I have been playing around with mechanism options for my other task. So I thought of giving it a try.

It was not easy for me. Basically I needed three independent drives. One for the Rotation of the wheel on its axis. One for the translation of the wheel along the guide curve. and a third one for tilting. One of the issues was to keep the wheel touching at the ground and on the guide curve during tilting.

So I had to make multiple assembles.

1. The wheel part.
2. An assy with wheel as its part with Pin Connection.
3. Next level assy, with the assy in step 2 inside it so as to get the tilting as a Pin Connection.
4. Top level assy, where the assy in step 3 inside it. Here I used Cam-Follower arrangement and a drive for the translation.

Then take it into the animations and capture with rendering enabled.

(As you can see, my rendering skills are very primitive. ProE doesn't make it any easier also.)

Here is the output.



Now that this was possible, I like to extend it a bit and make it bit more interesting.. Bit busy these days, but I hope I can post that soon..

Bye..


Link for downloading the video: