Message 1 of 8

Not applicable
02-13-2013
12:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Although I have found code that should allow me to convert 2dpolylines to regular polylines, I am having troubles implementing it. At first I got the eInvalid Input but have since fixed that. However, the error now is that there is no error. Autocad just seems to lock up but I can still switch to visual studio and look at my code. It as though Autocad thinks it is doing something but my code is not doing anything. I can scroll around.
My code is this:
Try Dim acDrawing As Document = Application.DocumentManager.MdiActiveDocument Using acDrawingLock As DocumentLock = acDrawing.LockDocument Using acTransaction As Transaction = acDrawing.Database.TransactionManager.StartTransaction Dim acBlockTable As BlockTable = acTransaction.GetObject(acDrawing.Database.BlockTableId, OpenMode.ForWrite) Dim acBlockTableRecord As BlockTableRecord = acTransaction.GetObject(acBlockTable("*MODEL_SPACE"), OpenMode.ForWrite) For Each Id As ObjectId In acBlockTableRecord If Id.ObjectClass.Name = "AcDb2dPolyline" Then Dim acPolyline2d As Polyline2d = Id.GetObject(OpenMode.ForWrite, True) Dim acPolyLine As New Polyline() acPolyLine.ConvertFrom(acPolyline2d, True) End If Next acTransaction.Commit() End Using End Using Catch ex As System.Exception MsgBox(ex.ToString) End Try
Anyone have any ideas? It appears to hang on the acpolyline.convertofrm(acpolyline2d, true) line.
Thanks a bunch,
Solved! Go to Solution.