I am wonder how can I make copy of the center line and chamfer each line to the side line
I can make copy but have no idea how I can do the rest
Regards
Sigster
<CommandMethod("COPYPASTE")>
Public Shared Sub CopyPaste()
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim ed As Editor = doc.Editor
Dim peo As New PromptEntityOptions(vbLf & "Select object:")
Dim per As PromptEntityResult = ed.GetEntity(peo)
If per.Status <> PromptStatus.OK Then
Return
End If
Dim optString As New PromptStringOptions("Select a number 1 to ?: ")
optString.UseDefaultValue = True
optString.AppendKeywordsToMessage = True
optString.DefaultValue = "NUMBER"
Dim resPrompt As PromptResult = ed.GetString(optString)
If resPrompt.Status <> PromptStatus.OK Then
End If
Dim i As Integer = 0
If per.Status = PromptStatus.Cancel Then Return
Do Until i = Int(resPrompt.StringResult)
Using tr As Transaction = db.TransactionManager.StartTransaction()
Dim btr As BlockTableRecord = CType(tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)
Dim sourceId As ObjectId = per.ObjectId
Dim EntitySource As Entity = CType(tr.GetObject(sourceId, OpenMode.ForRead), Entity)
Dim ids As New ObjectIdCollection()
ids.Add(sourceId)
db.DeepCloneObjects(ids, db.CurrentSpaceId, New IdMapping, False)
Dim EntityCopy As Entity = CType(tr.GetObject(ids(0), OpenMode.ForRead), Entity)
EntityCopy.UpgradeOpen()
EntityCopy.TransformBy(Matrix3d.Displacement(per.PickedPoint.GetVectorTo(per.PickedPoint)))
'EntityCopy.ColorIndex = 2
tr.Commit()
End Using
i += 1
Loop
End Sub