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

 

Get Answers to Your V6 Questions
Dassault Systèmes answers user questions about CATIA V6.  Discuss these answers and propose new questions with end users from around the world in the CATIA V6 Forum.

COE DISCUSSION FORUM
Subject: Is it possible that to create the variable objects?

You are not authorized to post a reply.   
Author Messages
STONE

18 Apr 2008 12:44 AM

Some difficulty has made me puzzled,so may be i need some help.
i am trying to create a large number of objects,but the total number of these objects is variable following the  fact of case,
for instance creating some points,the coordinates of the points save as a xls file.
Down  list is what i want to do:
Sometimes ,
i need to add or delete some coordinates in the xls file ,i wish that the points canbe added or deleted auotomatically according the counts of coordinates in the xls file.
Can the idea be realizable in  CATIA ?May be you have a good idea already, could i share in it ?
Welcome to participate to discuss this theme .
Mandy

knowledgeds

18 Apr 2008 02:35 AM
It is easily feasible with Knowledge Patterns (available in PKT workbench):

for example (you have create a KP list named KP\ListPoints, and a Body named BodyPoints, you have a design table with 3 columns that are points coordinates):

let p (Point)
let i (Integer)

i = 1

/* loops until the cell of the first column is empty. The first row contains the column title*/
for i while DesignTable.1\Sheet.CellAsString(i+1, 1) <> ""
{
set p = CreateOrModifyDatum("Point", KP\ListPoints, BodyPoints, i)
p = point(DesignTable.1\Sheet.CellAsReal(i+1, 1) * 1mm, DesignTable.1\Sheet.CellAsReal(i+1, 2) * 1mm, DesignTable.1\Sheet.CellAsReal(i+1, 3) * 1mm)
}

And that's it!
The first method creates the point under BodyPoints, put the point in the KP list to enable associativity.
The second one valuates the point with a point coordinate.

Set the update method of the KP to Automatic Update

Now you can change the design table. The points will change accordingly.

Regards
STONE

18 Apr 2008 03:49 AM
Hello,Knowledgeds,thanks for rely so quick,
i have little method about Knowledge Patterns (in pkt workbench) ,so i need some instruction from you ,i will try it on the weekend,if difficulty about Knowledge Patterns ,i'll ask you,
Have a wonderful weekend.

Mandy
STONE

20 Apr 2008 09:09 PM

Hi, Knoweledge,you are great,As you instruction with Knowledge Patterns ,i have achieved my purpose seeming creating the variabling object,
when i am using Knowledge Patterns,i get a knowledge report,the message is "The execution of Knowledge Pattern Knowledge Pattern.1 has created holes in its lists.
The list have been compacted.
It can be a normal behaviour or problem with index management.
It can raise performance loss"
i don't understand the meaning of the report,what is holes in its lists?
How the list is compacted? and so on,
see my code:









knowledgeds

21 Apr 2008 03:05 AM
Hello,

the index used in CreateOrModifyDatum ranges from 2 to n. So the list has an "hole" in position 1. The "compacting" operation means that all objects have been moved in the list to ensure that there is no hole (so object in index 2 of the list has now index 1, ...).

If you did not understand, it means that it is not clear. If you could provide me with a better explanation to give, I will change the associated message.
STONE

21 Apr 2008 03:49 AM
hello,
Could you give me you e-mail?i want to give my CATpart file to you ,may be you can change the associated message,
my e-mail is wangming1983318@163.com ,
knowledgeds

21 Apr 2008 03:54 AM
mmmh, no, sorry.

I'd risk to be overwhelmed by direct help requests...

About the message, I don't need your part. The problem in your pattern is the line CreateOrModifyDatum : the last argument should be i-1 instead of i.

If you have suggestion for a better message, just propose.
STONE

21 Apr 2008 04:23 AM
yes ,your suggestion is right,the reason that there is warning message is the item(1) of list is no object,so it has created a hole in its list,
thank you,
STONE

21 Apr 2008 04:32 AM

when i was reading the technical documentation on line,i have found it is possible instantiate a User Feature using the Knowledge Pattern.
it is wonderful,but i don't know how to use it .
According technical document instructing,the user feature file that will be instantiated from the Knowledge Pattern is saved in "C:\Soft\CatiaR17\CATInstR17\intel_a\resources\knowledge\knowledgeResources"
the file containing the information about the typed User Feature is saved in "C:\Soft\CatiaR17\CATInstR17\intel_a\resources\knowledge\knowledgeTypesCustom"(i konwe nothing about meaning of this file,what is the function of the file?)
the ARM catalog file referencing the physical resources is saved in "C:\Soft\CatiaR17\CATInstR17\intel_a\resources\knowledge\knowledgeResourcesCatalogs"
when i instantiate a User Feature using the Knowledge Pattern,i get a error report as the error message"No resource with logical name UserFeature2 has been found in the catalog PktARMcatalog3 (extended search not activated)"
i am sure that the catalog file contain the udf file ,and the association beween them is well,
where my error is ?any suggetion about it ?






knowledgeds

21 Apr 2008 05:01 AM
To use user features in a Knowledge Pattern, there are two solutions:
- either the user feature definition is in the same part, and you can access directly by its name (CreateOrModifyTemplate("", ...)
- or you have to use a specific catalog found in resources located in runtime environment, see Knowledge Architect setting (the goal is to be able to build applications and to be able to easily "install" them). So please check that Knowledge Architect setting is set to C:\Soft\CatiaR17\CATInstR17\intel_a\resources\knowledge

This catalog must have only one chapter, with four keywords : Name, Logical Name, Type, Usage.
The Logical Name keyword enables to be language independant (default names are translated when changing the language). This keyword should contain UserFeature2 in your case.

About the CATGcript file : it is the file defining the "type" of the user feature. It is not mandatory to use it, but it eases user features manipulation in the language :
imagine you have a user feature modelizing a Pad with an input named Sketch and a published parameter named Length, with some additional behaviour. You define its type (MyPad) in dedicated property sheet in user feature definition panel. It generates a MyPad.CATGScript in KnowledgeTypesCustom directory. Now this type is known by the system, and you can write expressions like :

let udf (MyPad)

set udf = CreateOrModifyTemplate(...)
udf.Sketch = ...
udf.Length = 30mm
...
EndModifyTemplate(udf)

You can also use the Search to find instances of this given udf, or write expert rules that applies only on instances of such udf.

If you don't want to use types, you can replace the above expression code by following one:

let udf (Feature)

set udf = CreateOrModifyTemplate(...)
udf.SetAttributeObject("Sketch", ...)
udf.SetAttributeDimension("Length", 30mm, "LENGTH")
...
STONE

21 Apr 2008 11:29 PM

Hello,Knoweledgeds
According your instruction and technical document ,i believe that i has understanded how to use Knowledge Pattern,
as you point out ,the catalog must have only one chapter, with four keywords : Name, Logical Name, Type, Usage.it was my mistake before,
Thank you for your helping

You are not authorized to post a reply.
Forums > COE Forums > KBE > Is it possible that to create the variable objects?



ActiveForums 3.6

    

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