Author Topic: Draw a rectangle using a form  (Read 7863 times)

0 Members and 1 Guest are viewing this topic.

Delegate

  • Guest
Re: Draw a rectangle using a form
« Reply #15 on: July 30, 2012, 04:24:19 AM »
Not testing anything but you have the bulge property of the polyline set to 100 - assuming you do not want a curve? set the 100 to 0.
Basically you have the code to form a polyline with 2 points i.e. a line not a rectangle.
             
                pl2.AddVertexAt(0, Point2d.Origin, 100, 0, 0)
                pl2.AddVertexAt(1, New Point2d(Width, 0), 100, 0, 0)
                pl2.Closed = False

Also you define model2 but don't use it. However you don't need model2 anyway so delete this. You already have the btr for modelspace in model.

                Dim model2 As New BlockTableRecord = SymbolUtilityServices.GetBlockModelSpaceId(db).GetObject(OpenMode.ForWrite)
                model.AppendEntity(pl2)
                trx.AddNewlyCreatedDBObject(pl2, True)
                trx.Commit()