Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone.
As per the title of the post I have to make a copy of lines and arcs and transform them into a closed polyline. I have no problem copying lines and arcs but I don't know how to join them into a closed polyline.
This is what I wrote.
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim ed As Editor = doc.Editor
Dim Filter_List1 As TypedValue() = New TypedValue(1) {}
Filter_List1(0) = New TypedValue(0, "LINE")
Filter_List1(1) = New TypedValue(8, "Line_Layer")
Dim Sel_Filter1 As SelectionFilter = New SelectionFilter(Filter_List1)
Dim Ris_Sel_Filter1 As PromptSelectionResult = ed.SelectAll(Sel_Filter1)
If Ris_Sel_Filter1.Status <> PromptStatus.OK Then
MsgBox("Error!!!")
Return
End If
Dim Object_ID As ObjectId() = Ris_Sel_Filtri1.Value.GetObjectIds()
Dim Obj_Entity_Entity As Entity
Dim Obj_Entity_Line As Line
Dim Obj_Entity_Line_Copy As Line
Using tr1 As Transaction = db.TransactionManager.StartTransaction
Dim Block_Tab1 As BlockTable = tr1.GetObject(db.BlockTableId, OpenMode.ForRead)
Dim Block_Tab_Rec1 As BlockTableRecord = tr1.GetObject(Block_Tab1(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
For i As Integer = 0 To Object_ID.Length - 1
Obj_Entity_Entity = Object_ID(i).GetObject(OpenMode.ForRead)
Obj_Entity_Linee = TryCast(Obj_Entity_Entity, Line)
Obj_Entity_Linee_Copy = Obj_Entity_Linee.Clone()
Obj_Entity_Linee_Copy.Layer = "Line_Layer_Copy"
Obj_Entity_Linee_Copy.SetDatabaseDefaults()
Block_Tab_Rec1.AppendEntity(Obj_Entity_Linee_Copy)
tr1.AddNewlyCreatedDBObject(Obj_Entity_Linee_Copy, True)
Next
tr1.Commit()
End Using
Can anyone give me some advice on how to do this?
Thanks a lot, bye.
Solved! Go to Solution.