×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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!

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

V5Automation.chm is a good start.

Eric N.
indocti discant et ament meminisse periti

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

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.

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

(OP)
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!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources