-
Civil3D: Erase sites
I'm desperate at the following task and hope that someone has an idea.
It looks easy - erase a site. But in contrast to e.g. corridors this code does not work:
Dim C3d_Trans As Transaction = Acad_Database.TransactionManager.StartTransaction()
Dim C3d_SiteId As ObjectId = Autodesk.Civil.DatabaseServices.Site.Create(C3d_ActiveDoc, "X")
Dim C3d_SiteObject As Site = C3d_Trans.GetObject(C3d_SiteId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite)
C3d_SiteObject.Erase()
C3d_Trans.Commit()
Error message "eNotApplicable".
Why?
-
Re: Civil3D: Erase sites
Have you considered iterating the Sites Collection from the AeccXUiLand.AeccApplication Object, then invoking the Sites Remove() Method, supplying the individual Site as parameter?
There's a Visual LISP variation of this concept in this old thread: http://www.theswamp.org/index.php?topic=42585.0
Cheers