Change Model Properties in VBA

Before I jump into this, I thought I'd ask here first.

Does anyone have some VBA code that changes a model from design model to a sheet and then applies some of the additional properties that become available once a model is a sheet?

I tried recording a macro, but the result was not useful.

I am using InRoads to create plan and profile sheets. But it does not know sheets models from design models, so after its complete, I need to open evey sheet, change the model to a sheet, assign a scale, select a sheet size and tell it which reference file is my sheet.

And then, if I have to rerun the plan and profile generator, it all gets reset and I have to start all over again..

Parents Reply Children
  • Unknown said:
    Did you successfully create a macro?

    What do you need that isn't covered either by Jan's suggestion or by this example from VBA help?

    Sub CopySheets()
        Dim mdlTemp As ModelReference
        Dim sd As SheetDefinition
        
        Set sd = ActiveModelReference.GetSheetDefinition
        
        For Each mdlTemp In ActiveModelReference.DesignFile.Models
            If mdlTemp.Type = msdModelTypeSheet Then
                '
                '  The same sheet definition can be applied to
                '  all sheet models.
                '
                mdlTemp.SetSheetDefinition sd
                '
                '  Change all of the elements in the model to use
                '  the new annotation scale.
                '
                mdlTemp.PropagateAnnotationScale
            End If
        Next
    End Sub
    
    

     
    Regards, Jon Summers
    LA Solutions