Skip to content
Discussion options

You must be logged in to vote

Opening modelspace can become a pain , I added Database.addToModelspace to make life easy, so these two functions are the same

def addline1(db : Db.Database):
    lock = Ap.AutoDocLock()
    line = Db.Line(Ge.Point3d(0,0,0), Ge.Point3d(0,100,0))
    model = Db.BlockTableRecord(db.modelSpaceId(), Db.OpenMode.kForWrite )
    return model.appendAcDbEntity(line)
    
def addline2(db : Db.Database):
    lock = Ap.AutoDocLock()
    line = Db.Line(Ge.Point3d(10,0,0), Ge.Point3d(10,100,0))
    return db.addToModelspace(line)

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@royccg
Comment options

@CEXT-Dan
Comment options

Answer selected by royccg
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants