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!

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

Status
Not open for further replies.

Thosnow

Aerospace
Feb 23, 2017
68
CA
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:
NOTES_ddb4qw.jpg


DEFINITION OF "ENG" property

Picture 2:
NOTE_DEF_kk79jl.jpg


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
 
Replies continue below

Recommended for you

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

Code:
CATIA.ActiveDocument.Selection.Item([i]x[/i]).Value.Text.Text



Eric N.
indocti discant et ament meminisse periti
 
Thanks itsmyjob....but how could I search for specific word "PLATE" and extract it of text string?
 
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
 
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
 
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
 
this is basic(not CATIA) VBA string manipulation, google it

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top