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!

Get Note Values with a Macro

Status
Not open for further replies.

learnCATIA

Aerospace
Oct 5, 2017
2
CA
Hello All,

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

NOTES_zoup2x.jpg

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

Recommended for you

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
 
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top