×
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

Arrowhead Style Macro

Arrowhead Style Macro

Arrowhead Style Macro

(OP)
I want to be able to search through a drawing and change all the arrowheads to one style.  Is there a way to do this with a macro?  I know nothing about macros but I do have fairly extensive programming experience.  I've just never needed to use one before.  Anyway if somebody could point me in the correct direction that would be great.

RE: Arrowhead Style Macro

Dave,

This will get you some way to where you want to be

Regards

Nev

Public Enum CatDimSymbols
  catDimSymbNone
  catDimSymbOpenArrow
  catDimSymbClosedArrow
  catDimSymbFilledArrow
  catDimSymbSymArrow
  catDimSymbSlash
  catDimSymbCircle
  catDimSymbFilledCircle
  catDimSymbScoredCircle
  catDimSymbCircledCross
  catDimSymbTriangle
  catDimSymbFilledTriangle
  catDimSymbCross
  catDimSymbXCross
End Enum
'==========================================================================
' COPYRIGHT NPL 2001
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.1
'
' NAME:
'
' AUTHOR: Neville Johnson , NPL DITEMSA
'nevjohnson@yahoo.co.uk
' DATE  : 26/06/2007
' CATIA Level:    V5R16
'
' COMMENT:Change all arrow head types and sizes
'
'
' ASSUMPTIONS:
' ==========================================================================



Sub CATMain()

Set oDrgDoc = CATIA.ActiveDocument
Set oSEl = oDrgDoc.Selection
Set oDRgShts = oDrgDoc.Sheets

For n = 1 To oDRgShts.Count
    Set oSht = oDRgShts.Item(n)
    Set oViews = oSht.Views

    For V = 1 To oViews.Count
    
    Set oView = oViews.Item(V)
    Set oDims = oView.Dimensions
    
    If Not oDims.Count = 0 Then
    
            For Each D In oDims
            

            
            Dim iSymbType As CatDimSymbols
            Dim arrGeomInfos(5)
            
            iSymbType = catDimSymbNone ' Set the symbol type here
            iThickSymb = 0.13
            Set oDimLine = D.GetDimLine
            

            oDimLine.GetGeomInfo (arrGeomInfos)
            
            For Z = 1 To 3

            oDimLine.SetSymbType Z, iSymbType
            oDimLine.SetSymbThickness Z, iThickSymb

             Next Z

               
              
            Next
        End If
    Next V
Next n

End Sub

RE: Arrowhead Style Macro

(OP)
I tried your script and I got an error after the public statement on line 1.  It doesn't seem to like your enunmerated variables?  I removed this whole section before the comments and then it gave me an error on this line:

Dim iSymbType As CatDimSymbols

saying that it expected an end of statement.

Thanks for your time!  I really appreciate it.  Is there somewhere I can go to learn about catia VBS scrips so I could maybe try to fix this myself?

RE: Arrowhead Style Macro

Dave,

You obviously ran it as a VBScript.
Here is the VBScript specific version.
As for learning catia vbs I would point you to COE forum

www.coe.org

'==========================================================================
' COPYRIGHT NPL 2001
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 3.1
'
' NAME:
'
' AUTHOR: Neville Johnson , NPL DITEMSA
'nevjohnson@yahoo.co.uk
' DATE  : 26/06/2007
' CATIA Level:    V5R16
'
' COMMENT:Change all arrow head types and sizes
'
'
' ASSUMPTIONS:
' ==========================================================================



Sub CATMain()

Set oDrgDoc = CATIA.ActiveDocument
Set oSEl = oDrgDoc.Selection
Set oDRgShts = oDrgDoc.Sheets

For n = 1 To oDRgShts.Count
    Set oSht = oDRgShts.Item(n)
    Set oViews = oSht.Views

    For V = 1 To oViews.Count
    
    Set oView = oViews.Item(V)
    Set oDims = oView.Dimensions
    
    If Not oDims.Count = 0 Then
    
            For Each D In oDims
            

            
            Dim iSymbType
            
            iSymbType =  catDimSymbFilledArrow ' Set the symbol type here
            iThickSymb = 0.13
            Set oDimLine = D.GetDimLine
            


            
            For Z = 1 To 3

            oDimLine.SetSymbType Z, iSymbType
            oDimLine.SetSymbThickness Z, iThickSymb

             Next

               
              
            Next
        End If
    Next
Next

End Sub

Regs

Nev

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