×
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

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

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

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

(OP)
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.

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

did you try to record a macro?

Eric N.
indocti discant et ament meminisse periti

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

(OP)
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....:(

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

CATIA isn't able to record in the drawing environment. I found out after searching to automate the threading info.

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

Use the DrawingWelding (Object).

CODE --> catvba

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
www.textsketcher.com
www.drewmumaw.com

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

(OP)
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 --> VBA

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 

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