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
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
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
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