OpenBuildings VBA SheetNumber Model Property

Hello all,

I'm having the hardest time figuring out what OBD (v10.05.00.049) wants me to call the "Sheet Number" model property through VBA. I've set up a search criteria to scan all my tags in my drawing. When it gets to the drawing number tag, I want it to take that value and apply it to the model property "Sheet Number". It's not working for "SheetNumber", but if I replace "SheetNumber" with "Name" or "Description" it works as expected so I think the code it getting the definitions of "MyModel" correctly. Another odd thing is if I type "sheetnumber", the VBA editor capitalizes it to "SheetNumber", so I think it recognized it. Any help would be much appreciated. Thanks!

If Tag.TagDefinitionName = "drawing_number" Then
                MyModel.SheetNumber = Tag.Value
            End If

Amador

Parents Reply
  • Thanks Jan, it's working! One was a blatant error on my part. I was lacking the following code to write back to the definition.

    ActiveModelReference.SetSheetDefinition MySheetDef

    The other part isn't a glitch, but as you stated 

    Because of confusing naming

    OpenBuildings labels the value as "Sheet Number" in every GUI, but the code needed to call out "Name", as follows

    If Tag.TagDefinitionName = "drawing_number" Then
                    MySheetDef.SheetName = Tag.Value
                    ActiveModelReference.SetSheetDefinition MySheetDef
                End If

    Because of the inconsistency with naming I couldn't follow which value was model property and which was sheet definition. I apologize, I'm an end user with no formal training in VBA or Microstation code.

    Thanks again for your help, I've marked your previous reply with the correct code as the correct answer.

Children