Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Fake dimension macro

Status
Not open for further replies.

faim

Mechanical
Oct 25, 2013
2
CZ
Hello all,

Can anyone help me writing a simple macro to change a dimension to a rectangled fake dimension.
Thank you.
 
Replies continue below

Recommended for you

one drawing with one sheet and one view

Code:
Sub fake()


    Dim oDrawing As DrawingDocument
    Set oDrawing = CATIA.ActiveDocument
    
  
    Dim oSheets As DrawingSheets
    Set oSheets = oDrawing.Sheets
    


    Dim oSheet As DrawingSheet
    Set oSheet = oSheets.Item(1)
    
    Dim oView As DrawingView
    Set oView = oSheet.Views.Item(3)
    oView.Activate
    
    
Set MyDimension = oView.Dimensions

For i = 1 To MyDimension.Count
 
Set ThisDrawingDim = MyDimension.Item(i)
ThisDrawingDim.ValueFrame = catFraRectangle

Dim MyValue As DrawingDimValue
Set MyValue = ThisDrawingDim.GetValue

MyValue.FakeDimType = catDimFakeNumValue 'catDimFakeText <--- switch this if you neet text
MyValue.SetFakeDimValue 1, 2 * 25.4 '     "Fake" <--- switch this if you neet text

Next i
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top