NullReferenceException Error In Create Block

Hi, I'm Using V20.2.05 (x64) revision 77502
Attached code is a simple creating a block.
It runs well on the AutoCAD, but errors occur on the BricsCAD.
Does anyone know why a NullReferenceException error occurs when add text?

Comments

  • uncle
    edited May 2020

    Solved - blkbtr.AppendEntity(txt) must be in 'with' statement.
    Solved - BricsCAD should be AddNewlyCreatedDBObject blkbtr before blkbtr.AppendEntity(txt)