What is the API for "Limits" command in model space

What is the API for "Limits" command in model space

哀家爆
Enthusiast Enthusiast
417 Views
3 Replies
Message 1 of 4

What is the API for "Limits" command in model space

哀家爆
Enthusiast
Enthusiast

I can manually input command "Limits" to set the extents of model space. And is there any api to access to write/get this property. So far all I've found is "Layout.Limits" and this property is read-only.

0 Likes
Accepted solutions (1)
418 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant
Accepted solution

Hi,

 

You can set the Database.Mimmin and Database.Limmax properties.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

哀家爆
Enthusiast
Enthusiast

Thanks. Your suggest works very well.

            var bb = CalculateBoundingBox(regionModel.BoundaryLines);
            var doc = Application.DocumentManager.MdiActiveDocument;
            var db = doc.Database;
            using (var ts = doc.TransactionManager.StartTransaction())
            {
                db.Limmin = new Point2d(bb[0], bb[2]);
                db.Limmax = new Point2d(bb[1], bb[3]);
                ts.Commit();
            }
0 Likes
Message 4 of 4

_gile
Consultant
Consultant

You do not need to start a transaction to change these system variables.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub