|
Welcome to the COE Discussion Forum!
|
|
|
|
To participate in the discussion forum, you must be logged in to the website. If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.
If you are new to the COE Discussion Forum and would like to participate, please register.
|
|
|
The COE 2008 Fall Industry Workshops
|
| Experience two days of industry-focused education and hands-on training on the Dassault PLM solutions suite of products. All education featured at the workshop is developed by and for users of CATIA®, ENOVIA®, DELMIA® and SIMULIA®. |
| |
|

|
Automotive
Oct. 15-16
Troy, Michigan
|
Aerospace & Defense
Oct. 27-28
Wichita, Kansas
|
 |
|
| Forum Highlight: CATIA V6 |
|
|
 |
|
 |
| You are not authorized to post a reply.
|
|
| Author |
Messages |
|
THUNDERLASSE
 |
| 31 May 2006 02:13 AM |
|
Hello folks,
In CATIA V5 knowledge advisor application, every feature or object has two names, one is so called Internal name, where the actual relation behind points to and other is the Shown name, that can be modified by user. Internal name of feature is not shown to user. This mechanism allows to update relations, rules etc so that even after change of Shown name of parameter, relation still works and it can update to point to renamed parameter.
... at least that is my understanding how this works...
Anyhow; in some cases I have need to create relation so that it points to Internal name. For example I would like to create a relation that points always to PartBody (aka Mainbody) of part where relation is instantiated. And I want this relation to follow so that if user changes partbody (contextual menu, change partbody) so that this relation really and always points to current partbody.
Any Idea how to do this? I quess that this might be impossible through plain Formula editor, but maybe through Loop I could have access there or maybe in VB I could have an acces to Internal name, I maybe could create reaction that launches a little VB creating that parameter... or something.
Help is once again highly rewarded with a pint of beer in next COE/ECF/DEVCON/CVI or whatever event we might meet.
BR, Lasse |
|
|
|
|
BPRASAD

 |
| 31 May 2006 09:39 AM |
|
| Have you tried "Parameters Explorer" in KWA? If lets you review all types of intrinsic parameters anywhere in your tree. It also contains "properties" where both parameter "intrinsic name" and local name are displayed. Take a look. |
|
Brian Prasad COE-DPC/KBE Chairperson |
|
|
IPHILLIPS
 |
| 31 May 2006 10:00 AM |
|
| That is definately a 3 Pint question! |
|
Ian Phillips. FORCEFIVE AG, Munich, Germany |
|
|
COE-FORUM-USER
 |
| 31 May 2006 12:48 PM |
|
Try creating a list parameter (KWA) and adding the item of interest to the list (maybe you want to keep tabs on one item or maybe many)...in your case just add partbody. A list maintains pointers to the object(s) you select regardless of it's name, where it exists in the tree, etc. Now, refer to the item in the list to do your processing using the list.GetItem method. You can also potentially use a list to check the internal ID of some items, by looping through the list and checking the item.Id property in KWA. The Id property is the unique identifier of everything in the file...Also the AbsoluteId property may be handy.
Good luck,
Mike |
|
|
|
|
COE-FORUM-USER
 |
| 01 Jun 2006 09:23 AM |
|
There are probably several ways. An easy one :
Let partbody (Solid) let l (List)
set l = Part1.Query("BodyFeature", "x.Name == \"PartBody\"")
set partbody = l.GetItem(1)
Volume.1 = smartVolume( partbody )
The query fails with Solid type (don't know why, seems like partbodies don't "say" they are solids)
It is not very good for performance because of the use of query. Could use Part1.Children instead, and afterwards, loop until the partbody is found by name.
Bye |
|
|
|
|
THUNDERLASSE
 |
| 01 Jun 2006 12:28 PM |
|
Hi,
Thanks everyone, there are a lot of good proposals.
ds_developer; are you really sure that this works? Because that query is in my eyes based on Name of solid, which I think is the Shown name... or is it?
Are you sure that this works in following structure:
Part.1 L MyBody1 L MyBody2
Where MyBody2 is actually PartBody, but renamed to MyBody2.
...when I get this working, I'll ask a new three pinter about error handeling for cases when I don't have any solid body. 
BR, Lasse |
|
|
|
|
COE-FORUM-USER
 |
| 03 Jun 2006 06:20 AM |
|
I tested it on a simple example. Of course, it works only if the PartBody is named "PartBody".... but I noticed that when using Change PartBody command the new part body is renamed to "PartBody" (at least on my test level)... so it works when PartBody is not initially renamed (I have small doubt : is part body name NLS? If so, it won't work in another language)
Maybe you can query without name condition (empty string as the second argument) and assert PartBody is the first body you rerieve (it seems to work...). And error handling is quite obvious when you manipulate lists : you just have to check the list is not is not empty.
New code : Let partbody (Solid) let l (List)
set l = Part1.Query("BodyFeature", "")
if l.Size() > 1 { set partbody = l.GetItem(1) Volume.1 = smartVolume( partbody ) } else Volume.1 = -1mm3 |
|
|
|
|
THUNDERLASSE
 |
| 04 Jun 2006 12:32 AM |
|
Hi,
Thanks, Great! I am little doubtful about robustness of this "first from list=partbody" assumption, but if it works, (on this release) it's a good start!
Anyhow; now I found out that in some cases I don't want to calculate volume of Just partbody, but all bodies together (If I have for example Step imported externaly made standard component...) so I need to figure out some more intelligence on this.
After a short thinking I came with following:
1) I'll create a new parameter with name "VolumeCalculation" and three possible values (multiple values) that are "-no selection-", "PartBody Only" and "all bodies". Default Value is "-no selection-"
2) Then in my code I'll have some additional logic: (this code won't work, I don't have cATIA in front of me to test it, but it just shows the logic)
Let partbody (Solid) let l (List)
set l = Part1.Query("BodyFeature", "")
if l.Size() > 1 AND VolumeCalculation="-no selection-" { messagebox("You have multiple bodies in your part, please select a value for Volumecalculation parameter, if you want to calculate volume of all bodies or only partbody")
} else if l.Size() > 1 AND VolumeCalculation="PartBody Only" { set partbody = l.GetItem(1)
Volume.1 = smartVolume( partbody ) } else if l.Size() > 1 AND VolumeCalculation="all bodies" { /**--Other script that calculates volume of all bodies together--/ /** note: is there a direct command for that or do I need to For/While loop all bodies and sum themttogether??/ } else if l.Size() == 1 { set partbody = l.GetItem(1)
Volume.1 = smartVolume( partbody ) } else Volume.1 = 0mm3
=> resulting that when after instantion of this rule user first time updates a part with multiple bodies, there will be a notification about volume calculation method, later when this is selected, he won't get any messages.
... almost perfect Next I'll figre out how to instantiate this to every part in database...
BR, Lasse
|
|
|
|
|
|
| You are not authorized to post a reply. |
|
|
|
ActiveForums 3.6
|
|
|
|