×
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

Search/Get "Text" value inside Definition property of 3D Annotation Set

Search/Get "Text" value inside Definition property of 3D Annotation Set

Search/Get "Text" value inside Definition property of 3D Annotation Set

(OP)
Hello All,

I am able to select "ENG" property in 1st picture below as per my short macro below. However, I do not know how to search and get the text (i.e. PLATE) in the definition of "ENG" as seen in second picture below.

Please help me out.

Picture 1:

DEFINITION OF "ENG" property

Picture 2:

My short macro
'//=================
Sub SEARCH_PLATE_IN_NOTES()

Dim oSel As SELECTION
Set oSel = CATIA.ActiveDocument.SELECTION
oSel.Clear

oSel.Search ("Name = ENG*, All")

MsgBox "HERE" '// Indicates macro got to this point

End Sub '//// End of this Subroutine
'// ==========================

Thank you in advance


RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

if your search return only annotation object, you an get the text with:

CODE --> VBA

CATIA.ActiveDocument.Selection.Item(x).Value.Text.Text 

Eric N.
indocti discant et ament meminisse periti

RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

(OP)
Thanks itsmyjob....but how could I search for specific word "PLATE" and extract it of text string?

RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

the line of code passes the text value of the selected annotation to the variable myAnnotationText

CODE -->

myAnnotationText = CATIA.ActiveDocument.Selection.Item(1).Value.Text.Text 

Eric N.
indocti discant et ament meminisse periti

RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

if you need the Text object of the Annotation then use only

CODE -->

dim myText as Text
set myText = CATIA.ActiveDocument.Selection.Item(1).Value.Text 

if you need the string then use

CODE -->

myTextasString = CATIA.ActiveDocument.Selection.Item(1).Value.Text.Text 

Eric N.
indocti discant et ament meminisse periti

RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

(OP)
thanks...I will try and see if it works.

RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

(OP)
HI itsmyjob...

I now get to the text string display on the monitor as per your code above: myTextasString = CATIA.ActiveDocument.Selection.Item(1).Value.Text.Text

But how can I search/obtain above text stream for word "PLATE" or any other word (as strings) in the text stream accessed above?

Is there any CATIA command or macro method to achieve this?

Thank you in advance

RE: Search/Get "Text" value inside Definition property of 3D Annotation Set

this is basic(not CATIA) VBA string manipulation, google it

Eric N.
indocti discant et ament meminisse periti

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