×
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

Get Note Values with a Macro

Get Note Values with a Macro

Get Note Values with a Macro

(OP)
Hello All,

How could I access and read text under "Notes:" as seen in the picture below?


Below is my code up to now and I am stuck.

Dim oSel As Selection
oSel = oCAT.ActiveDocument.Selection

oSel.Clear() '// Clear selection before selection starts
oSel.Search("Name = Notes*, All")

Dim TextAsString As String
TextAsString = oCAT.ActiveDocument.Selection.Item(1).Value.Text.Text

MsgBox(TextAsString)

Thank you for your help in advance

RE: Get Note Values with a Macro

hi, try recording a macro... that way you will quickly get some help from CATIA itself.
below are the lines generated by CATIA:

Dim parameters1 As Parameters
Set parameters1 = part1.Parameters
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim orderedGeometricalSet1 As OrderedGeometricalSet
Set orderedGeometricalSet1 = hybridBodies1.Item("Geometrical Set.1")
Dim parameters2 As Parameters
Set parameters2 = parameters1.SubList(orderedGeometricalSet1, True)
Dim length1 As Length
Set length1 = parameters2.CreateDimension("", "LENGTH", 0#)

the key to success here is the SubList of the parameter collection, the one that deals with Geometrical Set.1...
here I created a length parameter, but equally well I could read one...
good luck!

regards,
LWolf

RE: Get Note Values with a Macro

(OP)
Hi LWolf,

I want to read and export "Notes" values from a CATPart model rather than creating/reading a new geometric set from CATPart model.

Any idea how to achieve it?

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