.NET

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

Spaces and Classifications

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

Greetings,

 

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

                        Autodesk.Aec.Arch.DatabaseServices.

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)

                        {

                            classificIds.Add(cObjId);

                            Autodesk.Aec.DatabaseServices.

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

 

Regards

 

Claes

ADN Support Specialist
philippe.leefsma
Posts: 676
Registered: ‎06-02-2009
Message 2 of 2 (78 Views)

Re: Spaces and Classifications

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

Hi

 

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

 

http://forums.autodesk.com/t5/AutoCAD-Architecture/ct-p/56

 

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

 

Sorry for the hassle.

 

Regards,

Philippe.

 

 



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.