.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Spaces and Classifications

1 REPLY 1
Reply
Message 1 of 2
clwi
351 Views, 1 Reply

Spaces and Classifications

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

1 REPLY 1
Message 2 of 2
philippe.leefsma
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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost