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

Register Today!

COE DISCUSSION FORUM
Subject: How to build an associative Join ?

You are not authorized to post a reply.   
Author Messages
COE-FORUM-USER

04 May 2005 12:21 PM
One of the key features in KBE developing is quantification (instantiating an object several times).
In my particular case, I'd like to build a Join (GSD) that gathers the elements of a list (or of a Geometrical Set) that are quantified.
The Join tool works fine for a given set of elements but once this set of elements changes, the join becomes out of date.
My interest in building an Associative Join is that when the list changes, the Join will also be updated.
My initial approach is :
- to build a list which contains the desired elements
- to build a reaction so when the list changes, a VBscript is executed.
- The VBscript removes the elements of the join and adds the current elements of the list to it.
This approach works for my Part. The quest is how to embed it in an UDF.

This kind of works when built inside a powercopy, the join is updated but several error boxes appear along the instantiation (highly undesirable for the end-user!).
Nevertheless, for an UDF using the same procedure it does not work at all.
Any suggestion about what is wrong ?
Any suggestion about how to solve this issue ?

Thanks in advance,

JP
CARBAHOLIC

12 May 2005 05:21 PM
What About Creating a New Join button Through VB that has a built in update functionality.
COE-Member

18 May 2005 07:23 AM
I'm not sure of what you meant - could you be more specific ? (or explain in more details) ?
If you meant to build a macro in VB that does the update - that's what I've done. But a single VBScript won't do - you have to build a reaction linked to it to allow automatic Update. The problem is - I'd like to put all this inside a template (UDF) so it's easier to store (I could use a catalog) and to deploy.
IPHILLIPS

30 Jun 2005 06:26 AM
Have you tried pitting the reaction inside the UDF?
When the the reaction starts it reads the contents of a Geometrical Set and in a For-Next loop(R14+) would add all of the features to a join.

I will have a closer look at this in case I have missed anything

Ian Phillips. FORCEFIVE AG, Munich, Germany
YRETTER

12 Jul 2005 12:52 AM
The following approach is based on a solution for placing lines on a list of points. When points are added/deleted the list is updated automatically and the required lines are added or removed. I am not sure if this will work for the Join problem but for the "lines – points" case it is a quick and elegant solution:

- Required license: MD2 + KWA (knowledge advisor)
- Create an empty list in KWA
- Populate the list using a Query , for the points I used: 'OpenBodyXXX'.Query("Point","")
- Use the list content to create the Join

Again, this is not a proven solution but if successful will require only a very little programming.

Hope this helps

Yoram Retter
IPHILLIPS

12 Jul 2005 02:54 AM
Yoram

This was basically the method I suggested. However I have been unable to finish the knowledge script. See my query here: this thread.
If you can help, all the better.

cheers

Ian

Ian Phillips. FORCEFIVE AG, Munich, Germany
COE-FORUM-USER

08 May 2006 02:37 PM

Hi Guys-
This is my first post, and first time to the forum. I must say, I am glad to see others are struggling with the same issues I am. Not that I am happy for other people's suffering, but I know the collective effect of headaches is an eventual solution. I'm glad I found this forum!!

I have also been wrestling with automating an associative Join. I have read this thread, as well as Ian's linked thread within this post. I guess I'm not fluent enough to "get it", or maybe my problem is a little different...

JP, in your opening post, you described using VBS to effectivly "repoint" a join to a new list of inputs. This is exactly what I am struggling with. I don't need the join to be art of a UDF (yet), just a basic Join that is fed by KBE. Here is my basic situation-

GOAL:
1.Use aKBE List to to gather a set of points. (Easy enough..)
2.Loop a UDF of a cylindical surface for each item in the list, dumped into a clean Geom.Set. (Done.)
3.Populate a single JOIN with the contents of the Geom. Set. (hmm..)
4.Use the Join to perform a single split action against a main surface (Built in the tree)
5.=The Result is a number of holes equal to the points fed into the list.

The problem I'm having is getting the Join to be fed/refreshed by the UDF loop set. I can clear/reselect the Geom Set each time, but I would like to automate this for the end user.
JP, Ian, could you please help me with the VBScript language you used to automate the feed to the join?

Thanks Guys,
If I can get this to work, I'll try to get in on the UDF embedded version too.. That would be slick.

P.S.- Ian, are you the Big guy or the little guy in your signiture picture? I'm guessing your the guy with the beard, but with these kids and their video games today, you just can't be sure...
IPHILLIPS

09 May 2006 06:09 AM
Just because I'm small it does not mean I cant talk big!

What you want do is exactly what Dassault forgot. A real generative pattern. See other CAD systems!!

Points 4 and 5 are straight forward. But Point 3 is a little tricky. The other thread is all about Point 3. And it works! Tricky in R14 but better in R15 and later. Create this Reaction that refreshes a join if the Geom Set contents change:
-----------------------------------------------------------------------------------------------------------
let i(integer)
let tempcurve(curve)
let Join(curve)
i = 1

/* Loop to add each curve from the list */
for i while i <= List.1.Size()
{
if i ==1 {tempcurve = List.1 .GetItem(i) /*First Iteration only */
else {tempcurve = assemble(tempcurve, List.1 .GetItem(i)) /*Adds next curve to cumulative 'tempcurve'*/
}

`Geometrical Set.2\Curve.7` = tempcurve /* Assigns final result */
-----------------------------------------------------------------------------------------------------------

Ian Phillips. FORCEFIVE AG, Munich, Germany
COE-FORUM-USER

09 May 2006 08:40 AM
Thanks Ian-
I'll give it a try...
COE-FORUM-USER

09 May 2006 09:05 AM
Hello all,

some remarks:

Ian, you do not create a join, you create a datum geometry that is the result of a join (it is sometimes an important difference). And in R16 you can do the same thing writing curve = assemble(List) directly

Most of quantification problems can be solved by R16 Knowledge Pattern feature. It is a really associative AND generative feature. It naturally handles user features and datums (isolated points, lines, curves, ...) but can also be used with VB created features, or PowerCopies ones. It can be embedded in PowerCopies but not in udf (which does not support well generative features)

To solve following pb:
"GOAL:
1.Use aKBE List to to gather a set of points. (Easy enough..)
2.Loop a UDF of a cylindical surface for each item in the list, dumped into a clean Geom.Set. (Done.)
3.Populate a single JOIN with the contents of the Geom. Set. (hmm..)
4.Use the Join to perform a single split action against a main surface (Built in the tree)
5.=The Result is a number of holes equal to the points fed into the list."


1. right, just query, or build it with another knowledge pattern. Let's call it Points
2. Create a knowledge pattern, with one built-in list called udfs with the expression

let udf (udftype) /* it is not mandatory to use udf type, but its better to write knowledge expressions */
let i (integer)

i = 1
for i while i <= Points.Size()
{
/* this is the udf instantiation method. Destination is the destination feature (an open body for example)
udfs is the Knowledge Pattern list, last argument is the index in udfs list
First argument says the udf reference is to look for in the catalog "catalogName.catalog" with the description
udfName and this catalog has to be located in a knowledge path, see R16 documentation for more */
set udf = CreateOrModifyTemplate("catalogName|udfName", Destination, udfs, i)

udf.Input1 = Points.GetItem(i)
/* without udf type definition, should have used SetAttributeObject("Input1", ...) */
udf."Input2 containing forbidden chars" = ...

udf.parameter1 = <value>
...

EndModifyTemplate(udf)
}
/* that's all folks */

3. two solutions.
a : Ian's one :
curve = assemble(udfs). Simple and efficient, but it is not a true join, which can be needed

b: use macros with arguments, that are run by KnowledgePattern execution (at the end of the previous expression) and that update join with list content...
Use this macro, for example

sub main (listparam, join)
size = join.GetElementsSize()

set part1 = listparam.context
set list = listparam.ValueList

for each c in list
set ref = part1.CreateReferenceFromObject(c)
join.AddElement ref
next

' do it after because joins don't like vacuity
for i = 1 to size
join.RemoveElement(1)
next

End Sub

For items 4 and 5, it's just standard stuff...

Regards...
COE-FORUM-USER

09 May 2006 10:21 AM
Thanks dsd2-
I like the knowledge Pattern method, but my company does not have a PKT license at this time.
However, I'll keep this example around to help justify it to my managment.

Thanks Again-
Dave
BPRASAD


09 May 2006 04:39 PM
I have been watching this thread and an associated one with a lot of interests. Looks like you guys have come up with a couple of good ways of solving/attcking this problem/issue.

Could anyone of you expand this into a small "consistent" writeup with examples (say screen dumps)?, so that we could include this into our "KBE Best Practices Document," that we are editing on behalf of COE-KBE Focus Group.
KBE Best Practices TaskForce

Do we have a volunteer?

Ian: can you do this? Thanks!!!

Brian Prasad
COE-DPC/KBE Chairperson
IPHILLIPS

12 May 2006 03:27 AM
Brian. You bet!

Hang on. It looks like the PKT Knowledge pattern means we do not need all this hard work! It seems to be the thing we have been waiting for for years!

The online docs say it is only available in Part Design. I hope it works with GSD well.

I will test it if I can find out where the Icon is. Anyone know how I can start it?
(I have PKT)

Ian Phillips. FORCEFIVE AG, Munich, Germany
COE-FORUM-USER

12 May 2006 09:00 AM
a : Ian's one :
curve = assemble(udfs). Simple and efficient, but it is not a true join, which can be needed

I ended up using this method in R16, and I am very pleased with it. I think we have broken this down into TWO seperate outputs: A true assoc. Join (via PKT Knowl. Pattern), and, a single Datum element produced by Join-like assembly action.

For the later, the R16 "shortcut" works great...

Here's a snapshot of my scenario




IPHILLIPS

15 May 2006 09:43 AM
Dave
Do you know how I start Knowledge pattern? Where is the Icon?

Ian Phillips. FORCEFIVE AG, Munich, Germany
COE-FORUM-USER

15 May 2006 10:05 AM
Knowledge Patterns are part of PKT workbench (PKT licence needed to create them, KT1 to use them)
IPHILLIPS

17 May 2006 06:04 AM
Got it thanks!

I always access these icons from GSD. So I never visit the PKT workbench.

Ian Phillips. FORCEFIVE AG, Munich, Germany
JMSWTLK

26 May 2006 08:01 AM
Throughout the threads, there are defined methods (heuristics, algorithms) that are hard to read in the text mode. These might be collected into a Word form at some point that would be easier on the eye. The motivation might be an improved set of FAQs.

Cheers,

john.m.switlik@ieee.org
316-204-0758
http://en.wikipedia.org/wiki/User:JMSwtlk
You are not authorized to post a reply.
Forums > COE Forums > KBE > How to build an associative Join ?



ActiveForums 3.6

    

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