Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

DIMENSION REF MACRO

Status
Not open for further replies.

vsawye2

Automotive
May 21, 2003
27
0
0
US
can anyone post a simple macro that will do this.
1)preselect a dimension on a drawing.
2)run a macro that will make that dimension reference by adding a ( ) before and after the dimension.

i'm no good at macros and i did the macro recorded but the macro errors out when i run it afterwards.
it doesn't seem like much but when you have to add () to a bunch of dimensions manually it just plain sucks.
thanks for any advise.
 
Replies continue below

Recommended for you

Multi select the dimensions you desire to have "(" and ")" added to.
Select the copy icon (looks like a paintbrush) from the Graphic Properties toolbar.
Select a dimension which has the "(" and ")" already added to it.
 
Hi,

I also prefer CATIA native commands but the method described above has some small inconvieniences...for example you have to unlock drawing views, then you have to take care how dimensions was written (horizontal or vertical). The format painter will change the dimensions texts orientation also to be same like the source text.

Bellow there is a CATScript which is working in a multiple selection exactly like format painter but without having the issues described.

Sub CATMain()

Dim MySel As Selection
Set MySel = CATIA.ActiveDocument.Selection

Dim MyDim As DrawingDimension
Dim Array1 As String
Dim Array2 As String
Dim Array3 As String
Dim Array4 As String
For i = 1 To MySel.Count
If TypeName(MySel.Item(i).Value) = "DrawingDimension" Then
Set MyDim = MySel.Item(i).Value
MyDim.GetValue.GetBaultText 1,Array1,Array2,Array3,Array4
MyDim.GetValue.SetBaultText 1, "(", ")",Array3,Array4
End If
Next

End Sub

Regards
Fernando

 
Status
Not open for further replies.
Back
Top