Bulges should have the same number of elements as the vertices. for your 3 point example, bulge(0) is the segment between point1/2 next is point2/3 then between point3/1. If the polyline is closed, that segment between the last point and the first point can have a bulge.
Honestly, I can't think of any polyline I've tried to apply bulges to that wasn't closed, but I have created open polylines where the bulges were all 0, and I still declare the bulges to be the same size as the points.
As far as SetDatabaseDefaults, I have seen it in a few examples, but I have not called it anywhere in my code. The Help file has this to say:
This function sets the entity's {Color ,Layer ,Linetype, Linetype scale ,Visibility ,Plot style name ,Line weight} to the default values of the database in which the entity currently resides or, if the entity is not part of a database yet, the current database in the AutoCAD editor is used. (There is also an overload which accepts a database parameter)
But in my experience this all happens automatically. If you don't set the color or layer of an object when you create it, it goes on the Current layer, with the current "CECOLOR", "CELTYPE", "CELTSCALE"...
I never bothered to look at the plotstylename or lineweight, because we do not use entity based plot styles.
This is the solution I have for Activating or Focusing on a Window. Put this declaration in your code somewhere accessible.
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Shared Function SetFocus(ByVal hwnd As IntPtr) As IntPtr
End Function
Then you can call it with SetFocus(DocumentObject.UnmanagedObject) or SetFocus(Application.MainWindow.Handle)