New Member
Posts: 2
Registered: ‎03-26-2013
Message 1 of 2 (124 Views)

Spaces and Classifications

124 Views, 1 Replies
08-20-2013 07:43 AM



I'm wondering how exactly you add an Classification to an Space Object(and by Classification i mean the part under Space object properties>Extended Data>Classifications where normally the SIS one is located).


I'm trying trough .NET (C# to be specific) to change the information on a space with something from the ClassificationDefenitions specified in the drawing. I'm able to read the data from the current ones, however if any of the classifications is using the Default(By style) value the space.ClassficationCollection doesn't contain that particular Classification.


In the document i've got a classificationdefinition for spaces called "Spacefunction" and an assorted list of various functions the space itself can be assigned, like Elevetor-shaft, Bathroom/Shover etc.


Anyone that can possibly help to provide with a code sample on how to do this or tell if it's impossible to do, i'd be happy to hear since i'm not able to figure out what i'm doing wrong. Sample below show on how i'm currently getting the information on the space:

Entity ent = (Entity)tr.GetObject(Objectid, OpenMode.ForWrite);




Space sp = ent as Autodesk.Aec.Arch.DatabaseServices.Space;


Autodesk.Aec.DatabaseServices.ClassificationCollection coll = sp.Classifications;


List<ObjectId> classificIds = newList<ObjectId>();


foreach (ObjectId cObjId in sp.Classifications)




Classification c = tr.GetObject(cObjId, OpenMode.ForWrite) as Autodesk.Aec.DatabaseServices.Classification;


MessageBox.Show(String.Format("{0} - {1}", c.OwningSystemName.ToString(), c.NameAndDescription.ToString()));



The code above just shows the classifications that are not using default values.


Software i'm working with is: Autodesk Autocad MEP 2012





ADN Support Specialist
Posts: 631
Registered: ‎06-02-2009
Message 2 of 2 (74 Views)

Re: Spaces and Classifications

09-10-2013 02:15 PM in reply to: clwi



Could you please re-post or link your question under one of the AutoCAD Architecture products:




As the question is specific to the MEP API, you will have more chances to get an answer.


Sorry for the hassle.






Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.