Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to put a file of points into CATIA from a file 1

Status
Not open for further replies.

atn57

Aerospace
Jun 30, 2004
30
0
0
CA
I have over 100 points that I need to put into catia that are in excel. Is there any way to input this other then by hand? Any help will be great!


tony
 
Replies continue below

Recommended for you

look in the online DOC, search for: pointsplineloft

cut / past your XYZ points in this Excel file.

Have an Openbody / Geometricalset in your active CATPart.

Eric N.

catiav5@softhome.net
 
Eric,

I don't know how to open it up in Catia. I have the file.

my sample file is

point # x y z
0 0 0 0
1 0 -8.485 1.217
2 0.914 -8.152 1.103
3 5.156 -3.91 0.233
4 0.914 0.333 -0.102
5 -1.996 -0.726 -1.895
6 -2.196 -9.284 -0.861
7 0.914 -8.152 -1.191
8 5.156 -3.91 -1.921
9 0.914 0.333 -2.171


i have it in excel how do i open it up in catia now?

thanks

tony
 
Hi,

this excel file can also make splines ... In order to make lines or polyline you need to edit the macro in Excel and change some code.

Eric N.

catiav5@softhome.net
 
I am attempting the same thing (inputting points into Catia v5r13 from an excel file). I searched for pointsplineloft and that turned up no results. I want to use the points to make a spline, so anyone have a more detailed way of doing this?

greg
 
Search the Help Documentation files for Create Elements from an external file, this will explain it all.

"PointSplineLoft" is an Excel file that can be downloaded from there and inside it, select Enable Macros. On the front Excel Sheet is some sample data. Select Tools => Macro => Macros, this will open a list of several Macros, select Feuil.Main.
Run that Macro and this appears;

Type in the kind of entities to create (1 for points, 2 for points and splines, 3 for points, spline and loft):

In the already opened CatPart the Points whose coordinates are on the front sheet will be created.

This has all been covered in this Forum, see thread560-39970, Mar12 2003.
 
I did as you said and got the GSD_ElementsFromExcel.xls file, but what I ran the Feuil.Main Macro, choosing option 3, it kept reading beyond the "End" and the computer thought for a while. It stopped after a couple minutes and a message came up from Visual Basic saying "Overflow" and apparently it kept reading done to line 32,767 in Excel. I didn't modify the original file I downloaded, and I did have an existing .CATPart file open in Catia. Do I need to modify the Macro and tell it to stop reading lines? I have experience programming in C, but not in Visual Basic.

thanks
greg
 
Hi,

With the default XL file I have no pb, can you provide your XYZ point file so I can try ?


By the way I added 1 line to avoid the PB if you have 1 Part open with no open body/geometricalset...

find this :

Sub CreationPoint()

'Get CATIA
Dim PtDoc As Object
Set PtDoc = GetCATIAPartDocument

'Get the HybridBody
Dim myHBody As Object

[red] If PtDoc.Part.HybridBodies.Count = 0 Then PtDoc.Part.HybridBodies.Add [/red]

Set myHBody = PtDoc.Part.HybridBodies.Item(1)

Dim iLigne As Integer


add the [red] red bold line [/red] to avois error in script. You can also add line to avoid error if you dont have a CATPart active...

Eric N.

catiav5@softhome.net
 

Greg, try using option 1 first, to load points. If that works, then option 2 for a spline. Don't use option 3 unless the submitted data is for more than one spline, the minimum to make a Loft is two section curves.

Eric, yes, the syntax on the Excel front sheet has to be exactly correct, in this case it is End.
Also, More Haste, Less Speed ...

 
Thanks for all your help, but I am stil having problems. At one point I could get all the points to plot (Option 1), but did not get a spline to form (Option 2). I started all over and now when I try to run the macro in excel (I have Catia running with a current .CATPart file), no matter which option I choose, a Microsoft Visual Basic message pops up and says "Object doesn't support this property or method." I am using v5r13, not sure if this makes a difference. I am also using Windows XP.

My guess is some lingo isn't correct. Online I found both a GSD_ElementsFromExcel.xls and an ElementsFromExcel.xls. While I don't want to use the loft feature I noticed in one it says StartLoft and in another it says StartMulti-SectionSurface. Can I just delete this since I only want to plot points and make a spline?

Thanks again.
 

Greg, that's interesting, the same thing happened to me earlier this year when I tried to do this on a machine that was running V5 R12. Whatever I did it would not do any more than create Points, it gave the error message you've seen,so I forgot about it and and have been using a R9 machine since.

Can you get access to a V5 R9 machine and try it, I've never had any trouble with this Release for this work ?
 
I think I need to talk to our networking guys. Today it is working (as far as plotting points), but just like you said, I can't make a spline.

It goes through all the points though and doesn't come up with the error until it gets to "EndCurve" and then the error comes. In Catia it has all the points as errors. Could there be another command besides EndCurve? Maybe it was an update in after the v5r9 version and had continued until now. It seems to be just the commands such as Start..., or End... that are giving the errors. Any ideas for other names Catia may have switched to?

I tried Spline, but this will still work with just plotting the points, but when I try to choose option two, it reads about 20 lines, pauses and jumps to the end while nothing was actually done in Catia.
 
can you try with the EXCEL file from the Online doc without changing anything ?

Just be carefull to have a CATPart with an openbody / geometrical set...

Eric N.

catiav5@softhome.net
 
Kapitan,
I have similar problem as IsoGreg, even worst.
I cannot Enable Macros in the GSD_PointSplineLoftFromExcel.xls, I chose the GSD_PointSplineLoftFromExcel.xls!Feuil1.Main, and run it, but error message come up "The macros in this project are disabled.
Why, Why, Why???

Johnny Ng
NC programmer
jng@contouraerospace.com
 
Because of the security option in EXCEL... turn it off! at least for this test.

Tools / macro / security... LOW

Eric N.

catiav5@softhome.net
 
Status
Not open for further replies.
Back
Top