Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to extract the points from design table in CATIA (please at least help me this time)

Status
Not open for further replies.

Prafulbari

Mechanical
Oct 24, 2013
5
Could anyone please help me in creating a code for my following requirenment,
I have a geomtery which is driven by parameters (W,X,Y,Z). The parameters are extracted from excel. so for one set (I have around 200) of parameters I have one geomtery so, for 200 sets I have 200 geometries. Now I want to extract the points(different points) on a geometry for each of these sets. How can I do that in VB code? Any suggestions?
I was thinking of using design table to create all those sets and then use VB code to extract those points but no idea how I am going to do that, so any suggestions will work.......
Please help me............
 
Replies continue below

Recommended for you

Did you manage to get your Design Table?

That would be the first step.

Then, like you said, with VB, go from one configuration to the next and get the required info.

Did you check the faq560-1377 , it might help???

Provide your code and your problem so we can help.

Eric N.
indocti discant et ament meminisse periti
 
thanks for the reply. I realy appreciate your inputs. I was able to create design table.
This is my idea so,problably not a best way go (i don't know), if you have any other good way to solve this please let me know.
Here is my code
I am trying to Create a new Geometrical sets for each set of parameters (configuration) and trying to save each configuration and corresponding geometrical sets in the same file, so that I will have all together 200 geometrical sets:

let me know if you want me explain more.

Sub CATMain()

Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim relations1 As relations
Set relations1 = part1.relations

For loopcount = 1 To 4

Dim designTable1 As DesignTable
Set designTable1 = relations1.Item("DesignTable.1")

designTable1.Configuration = loopcount

Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Add()
hybridBody1.Name = ("Geometrical Set." & loopcount + 1)

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

Dim selection2 As Selection
Set selection2 = partDocument1.Selection

selection1.Clear

Dim hybridBody2 As HybridBody
Set hybridBody2 = hybridBodies1.Item(1)

Dim praful1 As String
praful1 = hybridBody2.Name

selection1.Add hybridBody2

selection1.Copy

selection1.Clear

selection2.Add hybridBody1

selection2.Paste

part1.Update

Next

End Sub
 
if you just need to measure info from each configuration, you do not need to create all geometry in your file. This is not really memory saving.
You should:
go to first configuration
measure what you need
go to next configuration

you're almost there

not saying you need copy/paste in your code but if you want to use it check copy/paste from other thread like this one: thread560-347550

Eric N.
indocti discant et ament meminisse periti
 
I don't just want to measure any distances. Here is my requirement. Sorry if I have not made it clear before. I want to sweep geometry through guiding curves. This geometry changes its shape for certain amount till it completes a circle in all three directions. Now this three directions are driven (parameters) from excel file. so what I am trying to do here is
1) get the geometrical set at first location (first set of parameters) (geometrical set I already created in CATIA)
2) run the loop to go to the second locations( second set of parameters)for second geometrical set
3) I want to repeat this for 200 times.

then I will create a guiding path

Let me know if you need more elaboration
 
You know, when my colleagues are asking me to create a macro, usually I'm asking them to show me how they are doing the task manually (even if is a long repetitive task) or if they have time to show me exactly the steps in a ppt file. I'm asking them exactly the correct inputs data and the structure of the files (CATIA, EXCEL or whatever) and what they want to obtain.

Many times, a picture is worth then a million of words...

So, from this thread and from the older one, what should we understand, do you have different files in different locations, containing points coordinates? Do you want to create all those points and lines or curves in a single part file or in different part files and all those parts inserted in a CATProduct? How is looking the excel file ?

I believe you need to explain much more clear what you want and be aware that no one will give you a complete solution if this is requiring a lot of time to be solved (don't forget, there are a lot of companies earning good money from solving others problems).



Regards
Fernando

 
Ferdo/itsmyjob,
Thanks for explaining, I will keep that in mind, I did work around some script which might work for my work. But this is a great place to discuss VBA problems, thanks for response. I don't have internet access at my office..........[sad]

Could you guys please tell me how should I write the code for multisection loft. I have two curves in catia and want to connect those with loft using vb code. I did record macro, which I might be able to post tomorrow but it is not helping that much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top