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

Automotive
Oct. 15-16
Troy, Michigan

 

Aerospace & Defense
Oct. 27-28
Wichita, Kansas

   

Register Today!

COE DISCUSSION FORUM
Subject: Tough Paramater Changes

You are not authorized to post a reply.   
Page 1 of 212 > >>
Author Messages
CARBAHOLIC

27 May 2005 09:33 AM
I've got a good problem for you Knowledgeware guru's. Well, I actually have two good problems for you.

1) I have a line and a surface. How would you go about detecting if the line passes through the surface, and deactivate it if it does.

2) I have a point defined by xyz coordinate paramaters and a lot of lines. How would you detect if it is within a given distance from any line, and if it is, deactivate its coordinate paramaters, and move it to the nearest location on the closest line.

Thanks for any help
Eric
CRAIG HELM


29 May 2005 07:56 PM
You could just use reference contraints and check their value. It would be a lot of work if you had a bunch of reference elements, but it is the only way I can think of off of the top of my head w/o code.

-craig helm
Catia V5 R16 | Windows XP SP2 | Intel P4 3.4GHz | 2GB RAM | ATI FireGL V3100 128 MB DDR
COE-Member

30 May 2005 01:39 PM
Hi ,
Answer for question 1 :
Supposing you have a line "Line.1" and a surface "Surface.1" , you have to create a KWA rule with the following lines :

/*Rule created by JLIRANI 30/5/2005*/
if distance(`Geometrical Set.1\Surface.1` ,`Geometrical Set.1\Line.1` ) == 0mm
{
`Geometrical Set.1\Line.1\Activity` = False
}
else
{
`Geometrical Set.1\Line.1\Activity` = True
}



It worked for me. Is that what you were looking for ?

cheers,

JP
CARBAHOLIC

31 May 2005 09:53 AM
I think that if statement will work well for my first problem. Can rules have an output?

As far as the second one goes, I'm pretty sure programming will be involved, which is not a problem. I was just wondering if anyone has done anything like that before.

Eric
BPRASAD


31 May 2005 01:13 PM

Dear Eric:
You are right, Knowledge Advisor Rule is not enough to perform the required manipulations you are asking to perform herein in the second problem.
Stated below, I have provided a method based on "Knowledge Expert" rule-body.
This example identifies the Line (by name) from a list of numerous lines, which has the shortest distance from the selected "KeyPoint."
From what I read, I thought this is what you were interested in doing without extensive (such as VBA or VB Scripts) "programming".
If the problem is not exactly the same, hopefully from what I have provided herein, you would be able to perform a variation of the enclosed rule-body contents to fit your "particular needs."

If not let us know......
=================================================================
/*Rule created by bp51136 5/31/2005 */
/* Rules written by Brian Prasad from Parker Aerospace, Irvine, CA. */
/* Please Refer to this KBE Focus Group Source when using this Hint */
/* This Knowledge Expert Rule has 3 -- All Parameters as follows: */
/* "PP: Point; LL:Line; BB: PartFeature " */
/* Before you could run this Rule, you must do the following */
/* copy and Paste "PP: Point; LL: Line; BB: PartFeature " into the ALL PARAMETERS Field */
/* Assume that you have created a CATPart with a bunch of 3 Lines and 7 Points */
/* One of the Point is the KeyPoint, Let us assume that you have renamed this Point as "KeyPoint" */
/* Furthermore, you are measuring the shortest distance from this "KeyPoint" towards each lines */
/* Let us assume that you have renamed your Part with bunch of random Lines and Points as */
/* Your Part is named as the "NearestLine.CATPart". You can do this by right click & "Properties" */
/* Now Add/define 2 New Length parameters : "Distance_Min" and "Distance_Calc" */
/* You will also add/define 1 Integer Parameter: LineCounter using the <Formulae> icon */

/* To Run this Rulebody you must insert (Copy and Paste) this Rule contents */
/* into a KnowledgeExpert Workbench --Expert RuleBody */
/* Set the Initial default value of the "Distance_Min" to a very large (say 1.0E05in) */
/* Set the LineCounter to 0 as an initial value for controlling the Iteration in this Expert Rule */
/* Once the Expert Rule is inserted, you right click and do a "Manual Complete Solve" */
/* Expert Rule Starts Here */

if (BB.Name () == "NearestLine"
and PP.Name () == "KeyPoint"
and BB->GetAttributeInteger ("LineCounter") <= 7
)
{
BB->SetAttributeReal ("Distance_Calc", distance (PP, LL) )
Message ("When LineCounter = ", BB->GetAttributeInteger ("LineCounter"), " LineName is ", LL.Name, " PointName is ", PP.Name, " Calculated Distance Between KeyPoint and this Line is ", BB->GetAttributeReal ("Distance_Calc")/1.in , "in")
BB->SetAttributeReal ("Distance_Min", min (BB->GetAttributeReal ("Distance_Min"), BB->GetAttributeReal ("Distance_Calc") ) )
BB->SetAttributeInteger ("LineCounter", BB->GetAttributeInteger ("LineCounter") +1)
}

/* Rule Ends Here */

==================================================================

Is this what you were Looking for?


Brian

Brian Prasad
COE-DPC/KBE Chairperson
CARBAHOLIC

31 May 2005 04:03 PM
Yeah, that looks pretty good. Next I would include a statement that would deactivate the point's position constraints and add a coincedence constraint to the nearest line.

I think the hardest part is going to be moving the point to the best location on the adjoining line.

as far as programming goes, I don't mind programming in VB or even CAA. I'm just trying to find the best way to do it.

Thank you for your help
Eric
IPHILLIPS

01 Jul 2005 12:34 AM
1) Detecting if a line passes through a surface

This is the easy way:

let P1(point)
P1 = intersect(Surf.1 , Line.1)
if (P1.Error==true)
{
Message("No Intersection")
Line.1\Activity\=true
}
else
{
Message("Intersection OK")
Line.1\Activity\=false
}

Ian Phillips. FORCEFIVE AG, Munich, Germany
CARBAHOLIC

01 Jul 2005 09:51 AM
Yeah, that would have worked. I just got number one working yesterday via a VB app. It creates a measure between the two elements and finds the shortest distance. If that distance is zero, than my code deactivates the line.

I could use a similar method for number two, the hard part would be deciding exactly how to change the point definition.

I'm sure knowledgeware could do all of this, and I wanted to try using it, but when it comes down to it I'm just more comfortable with VB automation.

Eric
IPHILLIPS

03 Jul 2005 06:02 AM
Funny. It the opposite for me. I never made the change from IUA to VBscript.
I find VBS not easy to "read" with those long words and so many lines just to make a selection. IUA was much more readable in V4. Even us designers can understand it. Now it seems you have to be a programmer to do even simple tasks.

Ian Phillips. FORCEFIVE AG, Munich, Germany
CARBAHOLIC

05 Jul 2005 10:15 AM
I can see how you would be intimidated after looking at the brep reference selection method they use in the macros, but that is a selection method that I avoid. There are easier ones, and as you build up your own classes and get the hang of your own variable naming convention your vb programs start to read like bad english.

Eric
CRAIG HELM


05 Jul 2005 01:49 PM
Compared to me, they read like good english.

Seriously though, with the more "complicated" nature, you get much more power. If you wrote a lot of IUA's, and you have any type of coding background in virtually any language, you will be able to pick it up quickly. At least understanding what is going on. And to second what eric said, ignore the BREP stuff. It is very confusing and means relatively little to a beginning programmer in vb anyway.

-craig helm
Catia V5 R16 | Windows XP SP2 | Intel P4 3.4GHz | 2GB RAM | ATI FireGL V3100 128 MB DDR
IPHILLIPS

07 Jul 2005 03:32 PM
I have no other background of coding. I'm a design engineer. We didnt have access to computers when I studied. But I squeezed a lot out of the IUA language in the mean time. And IUA translates very nicely to the V5 Knowlege script for rules and reactions. (Apart from all those curly brackets). But, aside from the BRep references in VBScript, making a selection or just dim ing some hybrid factory for some reason is all very longwinded when we just need a "simple" programming language and not just a "powerful" language.

Ian Phillips. FORCEFIVE AG, Munich, Germany
CRAIG HELM


08 Jul 2005 12:10 AM
Don't be discouraged by what you see. It seems very longwinded and impossible at first. I assure you that it is very easy, even for the novice programmer. If you understand logic and loops, then you will get vba for catia. You will find that the object model follows the part/product/etc tree very closely. As far as the hybridshapefactory stuff, you will see that things like this as collectors that just help organise.

To put it in the manner of a filesystem. If you went to work and had a new filesystem with 100's of folders and each of them having many subfolders and so on, it would be very discouraging. You would however find it very easy to navigate once you "gain your bearings." This is exactly the trouble that you have with vba. Once you get oriented, you will find that it is a very easy language to use. The trouble that you have is due in part of the groups that everything is put in rather than the language itself. In all honesty, if you were starting from scratch, I would say that the KW language is actually more difficult to learn.

-craig helm
Catia V5 R16 | Windows XP SP2 | Intel P4 3.4GHz | 2GB RAM | ATI FireGL V3100 128 MB DDR
IPHILLIPS

08 Jul 2005 08:21 AM
Thanks Craig

So its "programming panic" I'm suffering from then. I'll persevere then. Thanks for the advice.

Ian

Ian Phillips. FORCEFIVE AG, Munich, Germany
CARBAHOLIC

08 Jul 2005 10:06 AM
I agree with Craig, their is an initial "Lost" stage when you can't seem to find anything, but after a little while you get used to the documentation and become familiar with the API and it's not so bad.

Eric
BPRASAD


15 Jul 2005 10:58 AM
Cheers to you all...
I agree it all boils down to "what you know?" and "how comfortable you are in each?
But setting aside that question, let us assume you are very well-versed in both and you get identical results.
The real question is --> what additional "characteristics" you like to have that would satisfy your long-term strategic (or investment) goals?
For example?
    Do you want your code to do many things (produce outputs) with very little changes to inputs?
    Do you wish that your written code was portable from one release V5 release cycle to others?
    Do you wish that it was very compact in size?
    Do you want it to be modular -- one "small code" to do many things?
    Do you wish it was quite general - same code applies to many types of problems (or class of problems)?
    Do you wish it worked all the time, on all computers, on all operating systems?

Now let me ask this question. If you have a method (or whatever, say a process or technique) that yields the above characteristics -->Will that interest you?
-->Will that be of any value to you or to your organization?

Brian Prasad
COE-DPC/KBE Chairperson
CARBAHOLIC

18 Jul 2005 01:46 PM
Of course. I believe that's the solution we're all trying to come up with.

Eric
COE-Member

18 Jul 2005 02:02 PM
Methinks he set you up Carbs...now that you agreed to all the questions/goals the answer of course is Dassault's Knowledgeware tools (or as Prasad likes to call them - KBE).
CARBAHOLIC

18 Jul 2005 02:07 PM
I know he's TRYING to set me up, but a bear in a trap is still dangerous.

Grrr
BPRASAD


18 Jul 2005 04:27 PM
No I have no intention of setting anyone up. Frankly, I don't believe any KBE tool, today, does possess all those "value-added" characteristics. Most "embedded KBE tools" -- like "KnowledgeWare" -- provide many good "KBE" type behaviors. Some tools' features provide better environments in some KBE areas than others (in every new release). If we seek for such "true KBE" challenges in "building new applications," I am hopeful, one day, we would achieve our desired goals. My point was, if we know what qualifies an application to be a "true KBE application," we may be able to seek desired capabilities/functionlities. And one day, may be we would be able to "do exactly what you and I am talking about."
After all, needs are the pillars of inventions.

Brian Prasad
COE-DPC/KBE Chairperson
You are not authorized to post a reply.
Page 1 of 212 > >>

Forums > COE Forums > KBE > Tough Paramater Changes



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)