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!

Catia Macro: How to Insert Excel Table inside CATDrawing Doc

Status
Not open for further replies.

jagandeep

Automotive
May 27, 2013
82
IN
I want to create Excel Table inside drawing doc using macro. Is it possible ?
Please guide me
 
Replies continue below

Recommended for you

@jagandeep
CATIA already has a built in function that allows you to do this.

getfile.aspx


Regards,
Drew Mumaw
 
Perhaps You Didn't Understand my problem correctely. I want VBA way to insert excel table not the regular built-in table into drawing sheet. You know excel table has much more options than bare-bone Catia table.
 
Yes Thats exactly what I want. I want to automate insertion of excel object. Is it possible ?
 
ctrl-c, ctrl-v doesn't work? it works in acad for example.
 
there is an option to record user actions as a macro, i think.
turn it on, then go to insert menu-object and try to import it with a manual action. then review the recorded macro and see if you can automate it (exact coords for docking the excel sheet might be tricky).

i also think that you can make a BOM from a CSV file.
 
@loki3000
It's not exposed to automation. That's why I suggested:

drewmumaw said:
I've never seen a way to do this in the API documentation. A possible workaround would be using CATIA.StartCommand "Object" and then SendKeys.

Or a standalone VB app that copy and pastes from the excel directly would work too.

Regards,
Drew Mumaw
 
or a script that draws the table while taking the values from excel, csv etc.
although i don't know if the values can be hardcoded into the drawing so that you don't need to copy also the csv file.
 
also, how long did it take you to familiarize yourself with the catia api and start writing scripts?
what's the best way to learn vb? are vb.net and c# also supported for scripts?
 
@loki3000
Start here in the Eng-Tips FAQ section.

loki3000 said:
how long did it take you to familiarize yourself with the catia api and start writing scripts?
Probably about 3 months.

loki3000 said:
what's the best way to learn vb?
Are you referring to learning vb or learning vb for CATIA's API?

I learned vb by taking this class and using Visual Studio to create vb applications. For VBScript (and VBA), I read this book.

If you are referring to vb for CATIA's API, then I used Google searches, COE.org, Eng-Tips.com, and various other online resources in addition to referencing the CATIA API documentation, recording my own macros to look at the code, and using object resolution. You may find this Eng-Tips thread helpful. And here's some other online resources (just use Google for more):

loki3000 said:
are vb.net and c# also supported for scripts?
If you develop an application in Visual Studio that accesses CATIA's API then you can use whatever object-oriented programming language that you want. If you are making a .catvba or .catvbs macro in CATIA V5 then you have to use vb. Also, I think CATIA has it's own internal scripting language called catscript, but I'm not familiar with it. And I heard that we will be able to program macros in CATIA V6 with vb and C#.

Regards,
Drew Mumaw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top