PATHFINDER

 |
| 15 Aug 2007 08:23 AM |
|
Hi all,
I have a big excel spread sheet and I would like to use the values in this spread sheet to drive my CATPart. The driving dimensions in excel are scaterred all accross the spreadsheet. Is it possible? if yes how?
Thanks in advance. |
|
Pathfinder |
|
|
ITSMYJOB

 |
| 15 Aug 2007 08:45 AM |
|
| The only way I know to link parameter to Excel is with Design table. May be you have to use another sheet where you gather all information in a way Design table can work with it. |
|
Eric N
INDOCTI DISCANT ET AMENT MEMINISSE PERITI |
|
|
HAASEBERT
 |
| 15 Aug 2007 08:54 AM |
|
You might also be able to use VBA to open an Excel file and read values from it, then pass the values into your Parameters, depending on where the Excel file is located.
-CH |
|
|
|
|
PATHFINDER

 |
| 15 Aug 2007 09:21 AM |
|
Thanks Eric, Is there any way I can make catia to look at any perticular sheet in excel... currently it looks at only the first sheet.... that way At least I will be able to avoide some cofusion in the spreadsheet...
Thanks Haasebert, but I am new to KBE area and quite unfamaliar w/VBA... are there any readymade macros performing similar tasks... may be I will be ablt to band-aid them to get the required results... |
|
Pathfinder |
|
|
DBEZAIRE
 |
| 15 Aug 2007 11:55 AM |
|
Pathfinder, I break down my large sheet. When you connect the design table change the sheet index number from 1 to what ever number the sheet is.
Regards, Derek |
|
|
|
|
HAASEBERT
 |
| 15 Aug 2007 01:23 PM |
|
Hi Pathfinder - try this. Unzip the attachment below into your C:\Temp directory. Open the CATPart and change the "Go" Parameter to True. The lengths should change. Open the Excel sheet, change the values, and save it. Then change the "Go" Parameter again.
The reaction watches the Go parameter for a change and fires off the script, passing the List as an argument. The script launches the VBA module, which takes care of the Excel interaction.
I'm sure others out there can do this more elegantly... I am still very much a newbie to VB and KBE.
-CH |
Attachment: 1815233093578.zip
|
|
|
|
ROARKJE
 |
| 17 Aug 2007 07:26 AM |
|
What about using Excel as the user interface? I saw this idea presented at an Auto COE.
The first worksheet in Excel must be reserved for the design table. Create a new worksheet in the same xls file to serve as the GUI. You can paste images in Excel or draw your own graphics. Cells can be linked from the GUI worksheet to the design worksheet. When you change values on the GUI worksheet you are changing the linked values on the design table worksheet as well.
See the attached example.
|
Attachment: 181726851279.zip
|
|
|
|
PATHFINDER

 |
| 17 Aug 2007 07:45 AM |
|
ROARKJE, That's what I want to avoid. I do not want to reserve the first worksheet for design table. I think my spreadsheet is confusing enough for the users in the current stage itself...- Derek, It's not working for me. Changing the sheet index no is not changing the target worksheet. It's always looking at the first worksheet. Do I need to change some setting somewhere... |
|
Pathfinder |
|
|
DBEZAIRE
 |
| 17 Aug 2007 07:57 AM |
|
Pathfinder - I have 3 pages of information for users to fill in. I then break this down to several design tables. I hide these design tables to simplify things for the end user using Format - Sheet - Hide (In Excel). Is it a horizontal/vertical thing on the design table causing your insertion to fail?
Regards, Derek
|
|
|
|
|
PATHFINDER

 |
| 17 Aug 2007 10:17 AM |
|
Hi Derek, When I keep the target worksheet as 1st worksheet I get everything OK, but as soon as I move it to any other position (say sheet no 5, but worksheet name is still "sheet1") and change the sheet index to 5, I get an error "the design table contains no data or file wasn't found. Use Edit...." |
|
Pathfinder |
|
|
DBEZAIRE
 |
| 17 Aug 2007 10:42 AM |
|
Do you have a sheet 5 in your excel? Name is not considered. In my example file I have 3 sheets with variables in each. Insert a design table with sheet index 3 and horizontal variables.
When you create parameters you will see variable 'c'. In Excel this variable is located on index sheet 3 which is actually labeled Sheet1
Regards,
Derek
|
Attachment: 1817425726590.zip
|
|
|
|
BPRASAD

 |
| 17 Aug 2007 11:14 AM |
|
Looks like, when you create a design Table from the pre-existing file (say an Excel Spreadsheet), you have to decide on the index number. Thus, design table has to be atttached multiple times, if more than one sheets from the same excel spreadsheet ought to be accessed.
A better approach would be to bring it once and change the index number (referencing sheets) by a KWA rule body depending upon the user needs?
Does Knowledgeware, V5 R17 provides such a capability of switching between multiple index numbers via a rule?.
If not when this would be available?
Brian |
|
Brian Prasad COE-DPC/KBE Chairperson |
|
|
ROARKJE
 |
| 17 Aug 2007 12:00 PM |
|
Brian,
That is an interesting idea.
The other thing I notice about Excel is, what ever worksheet was active when you save the file is the one that is displayed by default when it is opened again. I know this can also be confusing. I see this situation with engineering documents all the time. It becomes guess work to know what worksheet to switch to. |
|
|
|
|
PATHFINDER

 |
| 17 Aug 2007 12:07 PM |
|
OK.. Found my mistake... I am using a comlex spreadsheet develoved by somebody else. it had a few hidden sheets and after unhiding them I found that my target sheet is sheet7 and sheet 5 only had a few images...
thanks again.
|
|
Pathfinder |
|
|
DS_DEVELOPER
 |
| 19 Aug 2007 10:21 AM |
|
Hello all,
it is possible to use design tables in both directions for any cells. CATIA control or Excel control : the way to do this is to use KWA rules, and use design table specific functions (CellAsReal, CellAsString, ..., SetCell). Also, reactions can be triggered by file change on design tables (file time stamps are looked every 30s).
So you just have to create a deactivated design table; and use it thru various rules or reactions.
Bye |
|
|
|
|
BOBTHEBUILDER
 |
| 20 Aug 2007 05:35 AM |
|
|
Hi all
....getting a little bit away from the original question....but anyway.....I have found that Design Tables are nice for small models, that a few "simple" users use. Try to use them in a large company where the model exists in a PDM system and is used over say a 3-year development process, and I have found that you get problem after problem.
For 2 years I have worked as DS developer suggests....but I have found design tables to be totally instable
- associations always getting lost/broken
- all the KWA rules and reactions required for bi-directional functionality are too manual for large models
- some strange problems between releases of Catia regarding rules/reactions that drive design tables - resulting in having to re-write all the KWA code over and over.
- The.SetCell method is totaly slow, it seems to open and closes the excel/text for each parameter in the design table. Again, ok for small models, but try to manage a large model with 500 inputs, you have users waiting 10 minutes for Catia to write a simple bit of text that should be almost instant.
I now do everything directly over 1 central VB script. It still functions like a design table, but there is no Design Table in the tree. Works 1000 times faster/stabiler, and is worth the investment if you have many people using your models in a large company.
You certainly would have total freedom over what sheet and cells the data is located anyway....
|
|
|
|
|
PATHFINDER

 |
| 20 Aug 2007 08:37 AM |
|
| I think I have started facing the problems Bob is talking abt. My system moves all the files stored on desktop to a folder using a script. This script has moved my excel sheet also. Now when I open the CATPart it's not able to find the excel (understandable...), I try to use the desk command to locate the file, but unable to link the file. Is there anyway I can change the link to the excel file??? or I will have to recreate the link?? |
|
Pathfinder |
|
|
DBEZAIRE
 |
| 20 Aug 2007 08:41 AM |
|
Contextual menu - Design table - Properties. From here you can change the path to the new location.
Regards, Derek
|
|
|
|
|
PATHFINDER

 |
| 20 Aug 2007 08:45 AM |
|
| Thanks Derek, for the quick response. |
|
Pathfinder |
|
|
BPRASAD

 |
| 20 Aug 2007 10:11 AM |
|
DS_Developer: Thanks.
I know rules & reactions can be used if two design tables (each referencing a separate sheet in the excel spreadsheet) are exposed to the tree a priori.
The question is -->>Is the Index number for a design Table is exposed in KWare -- so that it (index number) is accessible thru a KWA rule?
Why expose?: By exposing index number, one would be able to access several sheets of an excel spreadsheet simply via a rule without the need to expose every sheets as a separate design table.
Brian |
|
Brian Prasad COE-DPC/KBE Chairperson |
|
|