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





RE: DIMENSION REF MACRO
Select the copy icon (looks like a paintbrush) from the Graphic Properties toolbar.
Select a dimension which has the "(" and ")" already added to it.
RE: DIMENSION REF MACRO
RE: DIMENSION REF MACRO
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
https://picasaweb.google.com/102257836106335725208