Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrowhead Style Macro

Status
Not open for further replies.

PacDave

Aerospace
Jun 25, 2007
5
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.
 
Replies continue below

Recommended for you

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


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

Part and Inventory Search

Sponsor