Edit Model Properties

Hello,

I'm looking by either key in or VBA to edit model properties. Set the Sheet Size to A3 and Design Scale to 1. Its to fix exported files from Revit to DGN.

Thanks in advance

Colin

Parents
  • Colin

    Assuming your Sheet Size is precisely named A3, try the code below. Its crude but does the job.

    Public Sub ChangeScaleandSheetSize()
        Dim objModelRef                              As ModelReference
        Dim iModelCount                              As Integer
        
        For iModelCount = ActiveModelReference.DesignFile.Models.Count To 1 Step -1
            Set objModelRef = ActiveModelReference.DesignFile.Models(iModelCount)
            If objModelRef.Type = msdModelTypeSheet Then
                objModelRef.Activate
                CadInputQueue.SendKeyin "SHEET BOUNDARY SIZE ""A3"""
                CadInputQueue.SendKeyin "MODEL SET ANNOTATIONSCALE 1.000000"
                GoTo GetMeOut
            End If
        Next iModelCount
        
    GetMeOut:
    End Sub

    Answer Verified By: Colin Duck 

Reply
  • Colin

    Assuming your Sheet Size is precisely named A3, try the code below. Its crude but does the job.

    Public Sub ChangeScaleandSheetSize()
        Dim objModelRef                              As ModelReference
        Dim iModelCount                              As Integer
        
        For iModelCount = ActiveModelReference.DesignFile.Models.Count To 1 Step -1
            Set objModelRef = ActiveModelReference.DesignFile.Models(iModelCount)
            If objModelRef.Type = msdModelTypeSheet Then
                objModelRef.Activate
                CadInputQueue.SendKeyin "SHEET BOUNDARY SIZE ""A3"""
                CadInputQueue.SendKeyin "MODEL SET ANNOTATIONSCALE 1.000000"
                GoTo GetMeOut
            End If
        Next iModelCount
        
    GetMeOut:
    End Sub

    Answer Verified By: Colin Duck 

Children