Hi,
I'm getting a eInvalidInput exception when I am trying add holes into slabs (VB.NET w/ ADT2007). The ultimate solution would be to convert a Profile into slab, but that gives an exception "NotImplementedYet". Nevertheless, I can create the slab itself from the points found in the Profile (i.e. non-void rings).
For holes I've dried the AddHole method with Point3dCollection, but the result is a eInvalidInput exception. Now I have tried a work-a-round; I am converting the void rings in the profile into polylines and then adding them as holes into the slab. The result is the same exception. See the code below, any ideas what I'm doing wrong in here.
Public Shared Sub AddHoles(ByVal SlabId As ObjectId, ByVal HoleIds As ObjectIdCollection)
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim lock As DocumentLock = doc.LockDocument
Dim db As Database = doc.Database
Dim tm As DBTransactionManager = db.TransactionManager
Dim trans As Transaction = tm.StartTransaction()
Try
Dim oSlab As Slab = tm.GetObject(SlabId, OpenMode.ForWrite, False, True)
oSlab.AddHole(HoleIds, New Tolerance(0, 0), True)
trans.Commit()
Catch ex As Exception
trans.Abort()
Finally
trans.Dispose()
lock.Dispose()
End Try
End Sub