Results 1 to 2 of 2

Thread: Civil3D: Erase sites

  1. #1
    Member
    Join Date
    2016-10
    Posts
    5
    Login to Give a bone
    0

    Default 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?

  2. #2
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,503
    Login to Give a bone
    0

    Default 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
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

Similar Threads

  1. 2014: Something I can't see and can't erase,,,
    By boyerd492098 in forum AutoCAD General
    Replies: 6
    Last Post: 2015-08-28, 01:36 AM
  2. Saveas/Export to Civil3D 2010 from Civil3D 2011
    By Openwheeler in forum AutoCAD Civil 3D - General
    Replies: 9
    Last Post: 2011-07-06, 04:00 PM
  3. Erase outside the Box
    By jseamons in forum AutoLISP
    Replies: 6
    Last Post: 2006-09-07, 11:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •