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!

How to Extract Contents, and X Y Coordinates, of Text Boxes from .CATDrawing by Macro

Status
Not open for further replies.

kookarachi

Automotive
Jun 6, 2015
3
CA
Hello All,
I am new to the forum, and have very little experience with CATIA Macro writing (Most of my basic experience comes VB for EXCEL Macros). I am looking for some help in this area...
I have a CATIA Drawing with a Table created by Geometry and Text (The Table is made of Points, Lines, Shapes, and Text Boxes instead of using the CATIA Table Tool).

My Goal is to create Excel data duplicating the information in the 'Graphical' the Drawing Table.

I feel like this a perfect task for CATIA VB Macros but I'm having trouble getting started.
I am able to piece together some MACRO functions from my internet searches.
The key MACRO functions I'm not able to find information on are:

Getting the XY coordinates of the TEXT BOXES, and the contents of the TEXT BOXES, into a EXCEL style list.
Can someone please point me in the right direction?

Thank you in advance for your help!
 
Replies continue below

Recommended for you

V5Automation.chm is a good start.

Eric N.
indocti discant et ament meminisse periti
 
as itsmyjob said, go to your chm and start poking around. Under CAA V5 Visual Basic Reference, look at CAA V5 Objects, Then pick the red triangle next to drawing documents.

I found this:

o Property x( ) As double

Returns or sets the x coordinate of the text. It is expressed with respect to the current view coordinate system. This coordinate, like any length, is measured in meters.
Example:
This example retrieves the x coordinate of the text MyText drawing text.
X = MyText.x

o Property y( ) As double

Returns or sets the y coordinate of the text. It is expressed with respect to the view coordinate system. This coordinate, like any length, is measured in meters.
Example:
This example sets the y coordinate of the text MyText drawing text to 5 inches. You need first to convert the 5 inches into meters.
NewYCoordinate = 5*25.4/1000
MyText.y = NewYCoordinate


you can also searc for catscript or catvbs and see several example codes.
 
Thank you all for the answers and direction. It's taken awhile but I was finally able to export textbox coordinates, and corresponding text content, to an Excel sheet... My new struggle is trying to capture the start/end point coordinates of lines (On 2D Drawing). I'm trying to use Line2D and Point2D Methods, but so far no luck.

Any mini-code examples, or breadcrumbs to steer me in the right direction, is much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top