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..
Hi caddcop,
the code would be similar to this:
Dim modelRef As ModelReference Set modelRef = ActiveDesignFile.Models("modelName") modelRef.Type = msdModelTypeSheet Dim sheetDef As SheetDefinition Set sheetDef = modelRef.GetSheetDefinition sheetDef.AnnotationScaleFactor = 0.05 sheetDef.SheetName = "My form" modelRef.SetSheetDefinition sheetDef modelRef.PropagateAnnotationScale
There is also example Copying the Sheet Definition from the Active Model to all Sheet Models in MicroStation VBA help demonstrating how to iterate through models in a design file.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Looks Promising.
When I find the time, if I get something functional, I will post it back.
Charles (Chuck) Rheault CADD Manager
MDOT State Highway Administration
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