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!

Exporting Catia drafting dimensions to excel

Status
Not open for further replies.

perzentkar

Mechanical
Jun 1, 2018
12
US
thread560-345707

Good morning all, I'm happy to be a part of the forums.

I am new to using macros in Catia, we are using Catia V5 R19. I am trying to write a macro that will export selected Catia dimensions, tolerances, associated views, and their balloons to a .csv file. I have gotten it to do most of what I want with the help of everyone in the referenced thread. I read the previous thread that's referenced above but I personally have no clue how or where to integrate the Balloon feature that is referenced. I have attached a screenshot of what I would like the end result to look like. The (1) represents the balloon value being displayed prior to the dimensional value. If possible I would like it to be displayed per my screenshot, if that's not possible having it displayed in Column E is more than acceptable. The other tricky part is I would like the Radius, ø, or degree symbol to translate if it applies, So in that instance I would like the value to be displayed like my screenshot ultimately, but even having the symbols display in another column is good because I can write formulas within excel to combine these things. Any help anyone can give me is appreciated.
 
 https://files.engineering.com/getfile.aspx?folder=d647735f-bcfa-4016-84f0-110f71ae68f9&file=screenshot_2.png
Replies continue below

Recommended for you

Hello Marc,

This worked out really well except it doesn't Launch excel upon completion, it doesn't launch that file for me at least. It does export the values into that file properly but it gives me a ghost telling me the file is open when it really isn't. I can open the template manually and I get an error telling me it's already open, do you wish to re-open blah blah blah blah. I click no and the values are all there properly. Any advice?
 
Hi,

Can you share your code, so I will check it.

Regards
Marc
 
Set xl = CreateObject("Excel.Application")
Set Workbooks = xl.Application.Workbooks
Set myworkbook = Workbooks.Open("C:\Users\office5\Desktop\Macro template.xlsx") 'ExcelTemplate = diretory/name of Excel Template
Set myworksheet = myworkbook.Worksheets.Item("Sheet2") 'Item(x) or Item("name of sheet")

' *** Column name in excel ***

myworksheet.Range("A1").Value = "Type"
myworksheet.Range("B1").Value = "Dimension"
myworksheet.Range("C1").Value = "Tol. min"
myworksheet.Range("D1").Value = "Tol. max"
myworksheet.Range("E1").Value = "View"
 
You have to add following line to show your Excel object:

Code:
xl.Visible = True

Otherwise your newly created Excel instance is running hidden in a background.

Tesak
- Text along a curve for Catia V5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top