Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Removing Sites

2 REPLIES 2
Reply
Message 1 of 3
Jeff_M
389 Views, 2 Replies

Removing Sites

Using the .NET API I get the ObjectIdCollection of the sites in a drawing like so:

ObjectIdCollection sites = civDoc.GetSiteIds();

 

I then loop through them to delete the sites (all featurelines, parcels and alignments have already been deleted from the drawing):

foreach (ObjectId id in sites)
{
Site site = (Site)id.GetObject(OpenMode.ForWrite);
site.Erase();
}

 

which throws the "eNotApplicable" exception. Is there no way to remove a Site using the .NET API? Using COM it was simple enough to just use the Remove(i) method on the Sites collection, and I would do this with late binding, except I cannot find a way to get the AcadObject of the CivilDocument or Sites collection. Any advise on how to get these would be great!

Jeff_M, also a frequent Swamper
EESignature
2 REPLIES 2
Message 2 of 3
Partha.Sarkar
in reply to: Jeff_M

Jeff -

 

I will look into this.

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

Hi Jeff,

 

I could reproduce this and I have logged it as a change request to be addressed by our engineering team in the coming days.

 

Happy New Year !

 

Thanks,



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report