Not applicable
01-31-2014
05:44 AM
I've added a TransientManager during a point selection routine so it will draw a red dot every time a user picks a point. Unfortunately, It seeems to randomly crash AutoCAD with no warning. Sometimes on the first point, sometines after seven or so. Any ideas?
Also, where can I find a reference to the parameters of the AddTransient routine? Samples I've found online vary greatly with little explanation.
Private Sub drawDot(dwg As Document, tm As TransientManager, pt As Point3d) Dim ed As Editor = dwg.Editor Try Dim Size As Double = 2.5# Dim Bulge As Double = 1.0# Dim Width As Double = 5.0# Dim oPl As New Autodesk.AutoCAD.DatabaseServices.Polyline oPl.ColorIndex = 1 oPl.AddVertexAt(0, New Point2d(pt.X - Size, pt.Y), Bulge, Width, Width) oPl.AddVertexAt(1, New Point2d(pt.X + Size, pt.Y), Bulge, Width, Width) oPl.Closed = True If dwg.Database.TileMode Then ' Add transient geometry tm.AddTransient(oPl, TransientDrawingMode.Main, 128, New IntegerCollection) End If Catch ex As Exception Resources.Errors.ErrorManager.ReportError(ex, ActiveValues) End Try End Sub
Solved! Go to Solution.
Link copied