{vb.net] eNoDatabase error

Hi All,

I'm currently developing an app that is intended work within both BricsCad an AutoCAD. I have a sub-routine to add entities to the drawing which also sets the entity's layer. This subroutine works within AutoCAD but fails in BricsCAD with the following message...

Message: eNoDatabase
StackTrace: at Teigha.DatabaseServices.Entity.set_Layer(String val)

Does anyone know a solution or work-around for this?

Cheers,

Pete

Comments

  • Hi All,

    I'm currently developing an app that is intended work within both BricsCad an AutoCAD. I have a sub-routine to add entities to the drawing which also sets the entity's layer. This subroutine works within AutoCAD but fails in BricsCAD with the following message...

    Message: eNoDatabase
    StackTrace: at Teigha.DatabaseServices.Entity.set_Layer(String val)

    Does anyone know a solution or work-around for this?

    Cheers,

    Pete

    Hello Peter,

    Try calling setDatabaseDefaults on the entity, before setting the layer property

    cheers : )

  • Hello Peter,

    Try calling setDatabaseDefaults on the entity, before setting the layer property

    cheers : )

    Hi Daniel,

    Thanks for the suggestion, unfortunately it still didn't work. This is my code snippit for adding a line...

    Dim startpoint as New CADGe.Point3d(p.USManhole.Easting, p.UsManhole.Northing, 0)
    Dim endpoint as New CADGe.Point3d(p.DSManhole.Easting, p.DSManhole.Northing, 0)
    Using line as New CADDb.Line(startpoint, endpoint)
        line.SetDatabaseDefaults()
        line.Color = ConverttoRGB(p.colour)
        line.layer = "MD_Pipes"
        AppendEntity(line)
    End Using

    As I said, this works in AutoCAD but not in BricsCAD. Any help would be very much appreciated.

    Cheers,

    Pete                  

  • interesting!

    you might try setting the properties after append entity.

    Dan

  • BTY, you might want to file a support request so the developers can take a look

    Dan 

This discussion has been closed.