shirazbj Posted October 3, 2011 Posted October 3, 2011 Hi, I want calculate the area of a closed polyline. I pick up a polyline and If it is not closed, I want to close it. But the code below doesn't work. If lwpoly.Closed = False Then lwpoly.Closed = True End If It returns an internal error saying "eNotOpenForWrite". Just wondering how should I close a polyline with vb.net 2008 express for autocad 2010. Thanks in advance Cean Quote
Jeff H Posted October 3, 2011 Posted October 3, 2011 Looks like you opened it for read so try If lwpoly.Closed = False Then lwpoly.UpgradeOpen() lwpoly.Closed = True End If Quote
shirazbj Posted October 3, 2011 Author Posted October 3, 2011 Thanks Jeff, It works. I was playing with a code from theswamp - .net polyline routines It has one line like this: Dim obj As DBObject = tr.GetObject(res.ObjectId, OpenMode.ForRead) I think I should change here. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.