Offset 3dpoly
i just want to know how to offset 3Dpoly programmatically using vb.net.
i tried using the GetOffsetCurves but it did not work, it only works on 2D polyline
below are the codes i tried.
please let me adjustments needed on my code.
thank you very much.
"Offset3DObject")> _
Public Sub Offset3DObject()
' Get the current document and database
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acCurDb As Database = acDoc.Database ' Start a transaction Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() ' Open the Block table for read Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) ' Open the Block table record Model space for write Dim acBlkTblRec As BlockTableRecord acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) ' Create a 3d polyline Dim p3d As New Point3dCollection p3d.Add(New Point3d(0, 0, 5)) p3d.Add(New Point3d(10, 0, 5)) p3d.Add(New Point3d(10, 10, 5)) Dim acPoly As New Polyline3d(Poly3dType.SimplePoly, p3d, False) ' Offset the polyline a given distance Dim acDbObjColl As DBObjectCollection = acPoly.GetOffsetCurves(1.0) acutPrintf(acDbObjColl.Count) 'it returns 0 ' Step through the new objects created For Each acEnt As Entity In acDbObjColl ' Add each offset object acBlkTblRec.AppendEntity(acEnt) acTrans.AddNewlyCreatedDBObject(acEnt, True) Next ' Save the new objects to the database acTrans.Commit() End Using End Sub0