Hi
I want to create a macro to change all the dimensions of the drafting document
i have created this macro but its not working properly.
here is the macro
Option Explicit
Sub CATMain()
Dim myDrawDoc As DrawingDocument
Set myDrawDoc = CATIA.ActiveDocument
Dim drawSheets As DrawingSheets
Set drawSheets = myDrawDoc.Sheets
Dim drawiSheet As DrawingSheet
Set drawiSheet = drawSheets.ActiveSheet
Dim drawviews As DrawingViews
Set drawviews = drawiSheet.Views
Dim i As Integer
Dim oSel As Selection
Set oSel = CATIA.ActiveDocument.Selection
oSel.Clear
oSel.Search ("Drafting.View,scr")
For i = 1 To oSel.Count
Dim Drawview As DrawingView
Set Drawview = drawviews.Item(i)
MsgBox Drawview.Name
Next
Dim drawDims As DrawingDimensions
Set drawDims = Drawview.Dimensions
Dim j As Integer
Dim oSel2 As Selection
Set oSel2 = CATIA.ActiveDocument.Selection
oSel2.Clear
oSel2.Search ("Drafting.Dimension,all")
For j = 1 To oSel.Count
Dim drawDim As DrawingDimension
Set drawDim = drawDims.Item(j)
drawDim.GetValue.SetFormatName 1, "cm"
Next
End Sub
Here is the error
Here is the drawing file image
I want the macro to change dimensions of the drawing doc to cm or mm or m
Thanks
I want to create a macro to change all the dimensions of the drafting document
i have created this macro but its not working properly.
here is the macro
Option Explicit
Sub CATMain()
Dim myDrawDoc As DrawingDocument
Set myDrawDoc = CATIA.ActiveDocument
Dim drawSheets As DrawingSheets
Set drawSheets = myDrawDoc.Sheets
Dim drawiSheet As DrawingSheet
Set drawiSheet = drawSheets.ActiveSheet
Dim drawviews As DrawingViews
Set drawviews = drawiSheet.Views
Dim i As Integer
Dim oSel As Selection
Set oSel = CATIA.ActiveDocument.Selection
oSel.Clear
oSel.Search ("Drafting.View,scr")
For i = 1 To oSel.Count
Dim Drawview As DrawingView
Set Drawview = drawviews.Item(i)
MsgBox Drawview.Name
Next
Dim drawDims As DrawingDimensions
Set drawDims = Drawview.Dimensions
Dim j As Integer
Dim oSel2 As Selection
Set oSel2 = CATIA.ActiveDocument.Selection
oSel2.Clear
oSel2.Search ("Drafting.Dimension,all")
For j = 1 To oSel.Count
Dim drawDim As DrawingDimension
Set drawDim = drawDims.Item(j)
drawDim.GetValue.SetFormatName 1, "cm"
Next
End Sub
Here is the error
Here is the drawing file image
I want the macro to change dimensions of the drawing doc to cm or mm or m
Thanks