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!

Catia 2D drawing/drafting, weld symbol text information. (macro) 1

Status
Not open for further replies.

CozminC

Industrial
Jan 30, 2014
14
RO
Hello,

In a 2d view I have some weld symbolsn and i need to edit by scripting their textboxes but i can't find in the automation file how to do that.

There are 5 textfields for the weld symbols , 2 up, 2 below and another at the end of the symbol.
Does anyone know how can i acces those textfields and edit them automatically (catscript or vba).

Thank you in advance.
 
Replies continue below

Recommended for you

did you try to record a macro?

Eric N.
indocti discant et ament meminisse periti
 
I tried but no action recorded during editing or creation of welding symbols. I saw that the macro recorder does not work all the time for all the functionalities....:(
 
CATIA isn't able to record in the drawing environment. I found out after searching to automate the threading info.
 
Use the DrawingWelding (Object).

Code:
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument

Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets

Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.Item("Sheet.1")

Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views

Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.Item("Main View")

Dim drawingWeldings1 As DrawingWeldings
Set drawingWeldings1 = drawingView1.Weldings

Dim drawingWelding1 As DrawingWelding
Set drawingWelding1 = drawingWeldings1.Item("CATIADrawingWelding0")

Drew Mumaw
 
Hello drewmumaw and thank you,

O have managed to do it some weeks ago but i forgot to post here,
Here is how i did it if anyone else needs this:

Code:
Dim textRange1 As DrawingTextRange
Dim textRange2 As DrawingTextRange
Dim textRange3 As DrawingTextRange
Dim textRange4 As DrawingTextRange
Dim textRange5 As DrawingTextRange

Set textRange1 = drawingWelding1.GetTextRange (catWeldingFieldOne)
Set textRange2 = drawingWelding1.GetTextRange (catWeldingFieldTwo)
Set textRange3 = drawingWelding1.GetTextRange (catWeldingFieldThree)
Set textRange4 = drawingWelding1.GetTextRange (catWeldingFieldFour)
Set textRange5 = drawingWelding1.GetTextRange (catWeldingFieldFive)

Dim char1 as String
Dim char2 as String
Dim char3 as String
Dim char4 as String
Dim char5 as String

char1 = textRange1.Text
char2 = textRange2.Text
char3 = textRange3.Text
char4 = textRange4.Text
char5 = textRange5.Text

'MsgBox char1 & " \ " & char2 & " \ " & char3 & " \ " & char4 & " \ " & char5

textRange1.Text = "xxx"
TextProperties.Update
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top