A&D (large)

Welcome to the COE Discussion Forums! 

 

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.


 

Follow COE on

COE DISCUSSION FORUM
Extract subsurfaces from surface bundle
Last Post 28 Jan 2010 12:20 PM by LASSEHEREAGAIN. 9 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
LASSEHEREAGAIN
50+ Poster
50+ Poster
Posts:134
Avatar


--
28 Jan 2010 06:24 AM  

Hello,

 

I need to do following with a rule:

- Take as an input a Multi-extract surface that includes several pieces of surface (that are tangent continuous)

- Create a List of subsurfaces of this input surface and start measuring or manipulating these surfaces one by one

If anyone has done something like that, I would appriciate a tip about correct command or even full for - next loop for this task.

 

BR;

Lasse

 

 

Lasse Purma

Sen. Specialist at Nokia on PLM (= my dilbert-like life in a cubicle)
and
MightyBoss at PurmaConsulting (=my company, my rules. Occasional PLM education projects)

Finland

Lasse Purma | Create Your Badge
MBERRY
500+ Poster
500+ Poster
Posts:584


--
28 Jan 2010 08:48 AM  
Hi Lasse,

Based on my experiences, I think you are going to have a very tough time working with faces using knowledgeware tools. Your best bet is to use VB for this or maybe disassemble the multi-extract surface first then try to use rule, etc. to do some operation on each surface element.

-Mike
Increase your CATIA V5 programming skills
v5vb.wordpress.com
CLIFFJOHNSON
500+ Poster
500+ Poster
Posts:553
Avatar


--
28 Jan 2010 09:51 AM  
I agree with Mike. Disassembly and treatment of sub-elements is very difficult.

Over the last week or so I have been experimenting with trying to create a way to dissasemble multi-domain curves into individual domains in the KBE world. It is a pain in the butt.

I have an algorithm that works by performing near() operations on the multi-domain curve using randomish points and then checking the area, cog, and length against previously recognized domains all in a loop until all the domains are found. It's a big mess of spaghetti code and really makes me wish there was a simple dissasemble(curve) function that returned a list of domains.

LASSEHEREAGAIN
50+ Poster
50+ Poster
Posts:134
Avatar


--
28 Jan 2010 10:10 AM  
Hi guys,

Thanks for prompt response! I came to same conclusion when trying to find this, I was hopeful with .Children function of surface, but actually it returns Parents. (easy test myList=MultiextractSurfaces.Children - look to list, there are those faces you selected for extract, not extracted subsurfaces!)

Anyway, I think that reaction with VBaction could save the day, I have already a VB piece that can find subfaces, but when I try to focus that Reaction to correct feature (multiextract surface in my case) I run to another problem. Reaction is connected to this Multiextract so that it is run whenever this extract is updatd (should work with powercopy) but how I focus the VBscript to this feature only; do I really have to use a specific naming rule and search it by that name or is there an easy way to point with VBaction within reaction to Input feature of that reaction. (sounds complicated )

Lasse Purma

Sen. Specialist at Nokia on PLM (= my dilbert-like life in a cubicle)
and
MightyBoss at PurmaConsulting (=my company, my rules. Occasional PLM education projects)

Finland

Lasse Purma | Create Your Badge
MBERRY
500+ Poster
500+ Poster
Posts:584


--
28 Jan 2010 10:15 AM  
Lasse,

In your VBScript, just add an input argument, let's say iSurf. This goes on the line just above the script body. Then within that script, you can use iSurf as a variable that refers to the surface passed in. Finally, in your reaction, pass the extract you want to the script as an argument something like this... VBScript.Run(`GeometricalSet.1\Extract.1`) Hope that makes sense....

-Mike
Increase your CATIA V5 programming skills
v5vb.wordpress.com
knowledgeds
50+ Poster
50+ Poster
Posts:88


--
28 Jan 2010 10:17 AM  
Mike was very fast!

I was just typing that:

"
Hello,

interesting thread!

I heard you about the disassemble function. I'm going to see if we can do something for this.

About the last question: VB Scripts with argument are specifically designed to enable a focus on objects given in arguments (which make them more generic). When a reaction is triggered on an object update, the object is given in the reaction as an argument. You just have to pass this argument to the macro with arguments, and that's it.

Regards
"
LASSEHEREAGAIN
50+ Poster
50+ Poster
Posts:134
Avatar


--
28 Jan 2010 10:37 AM  
Thanks, but I am thickheaded now, can you go a bit deeper with an example? (tried several times, I know that I am close, there must be some minor mistake .... tired on searching for it...)
Lasse Purma

Sen. Specialist at Nokia on PLM (= my dilbert-like life in a cubicle)
and
MightyBoss at PurmaConsulting (=my company, my rules. Occasional PLM education projects)

Finland

Lasse Purma | Create Your Badge
knowledgeds
50+ Poster
50+ Poster
Posts:88


--
28 Jan 2010 10:42 AM  
Create a script with argument. Use let's say surf as argument. Modify your script so that each time you need you target surface you use surf. Test your script (contextual menu, Run, select a surface)

In your reaction, there is an editor telling the action argument (something like :
MechanicalFeature : feature)

use your script that is now more generic (it does not introspect model to find the object he wants to use : they are given):
VBScript.1->Run(feature)
LASSEHEREAGAIN
50+ Poster
50+ Poster
Posts:134
Avatar


--
28 Jan 2010 11:45 AM  
OK,

Thanks, got it working with simple case, but when I try to input surface to Selection and to be used in Selection.Search "Topology.CGMFace,sel" I seem to run to a problem. this is not anymore on inputting the argument, but moving that argument to type of selection, that is needed for this search (search limited to inside of certain selection really returns subsurfaces)

=> I get it working wwith macro without arguments and manual selection, but something is needed to transform "Surface" (hybridshape) to "Selection"...
Lasse Purma

Sen. Specialist at Nokia on PLM (= my dilbert-like life in a cubicle)
and
MightyBoss at PurmaConsulting (=my company, my rules. Occasional PLM education projects)

Finland

Lasse Purma | Create Your Badge
LASSEHEREAGAIN
50+ Poster
50+ Poster
Posts:134
Avatar


--
28 Jan 2010 12:20 PM  

...let's backup a little. Important lesson learned from SW-projects is that we need to have SOME sort of specification before actual coding. Since 'simple' task of extracting subsurfaces has become harder than I assumed, now it is a good time to think more about specification:

So how we can create generic "split my surface to subsurfaces tool". Let's assume that starting point is a singe feature, for example Extract with tangent continuity. (several subsurfaces)

so here we go:

1) Powercopy that takes this Surface as input and generates a new geometrical set called XXX

2) Reaction that reacts to update of input surface and launches VBScript with arguments where input surface is argument; also geometrical set must be an argument (can there be several arguments??!!)

3) VBScript does following:

3.1 Empties Geometrical set XXX

3.2 Run Search inside input surface to get all Subfaces (it's possible, I tried it!)

3.3 Selects subfaces one by one and generates an Extract (no propagation) from each of them under (hmmm... difficult one) geometrical set XXX

4) Inside powercopy also a List feature that populates itself from content of GS XXX by  appropriate rule

5) Inside a powercopy a rule that scans through List and does wanted things to each surface

==> Easy?

Lasse Purma

Sen. Specialist at Nokia on PLM (= my dilbert-like life in a cubicle)
and
MightyBoss at PurmaConsulting (=my company, my rules. Occasional PLM education projects)

Finland

Lasse Purma | Create Your Badge
You are not authorized to post a reply.

Active Forums 4.1