PPT_LOGO_4b
‹#›
© 2009 Autodesk
Autodesk Developer Network
Typically implemented for all Aec Entities
§Store physical attributes as member data
§
Styles derived from DictionaryRecord
Style dictionaries are collections derived from Dictionary
§Constructor takes one parameter – Database
§Typically expose GetStandardStyle
§Dictionary base class does all of the collection work
§Record property – collection of style ids
§NamesInUse property – collection of names
§
§
§
§
§
2a - Aec Basics.vb > TestWallStyles command
Dim dict As New DictionaryWallStyle(db)
Dim styleNames As StringCollection = dict.NamesInUse
Dim styleIds As ObjectIdCollection = dict.Records
Styles and Style Dictionaries
Styles are typically implemented for each entity type in ACA. So wall has a wall style and windows has windows style, so on and so forth. Styles are containers of settings for that object type. So when we create a wall style and create walls with that style, all these walls will contains the behavior.

In the API, Styles derive from dictionary record. Style dictionary is a collection of objects  that contain the dictionary records. These are derived from AutoCAD dictionary object. So there will be dictionary wall style that is the container for wall styles and they are all stored in dictionaries. The constructor will take a parameter and it has to know the database. Most of them exposes the get standard style and so any time we open a new drawing (even if we do not use any template to open a drawing), if we draw a wall, it will still initialize and create a default wall style. This is because the wall needs to know what style it is in order to display properly. So getStandardStyle will get the style even in cases when no style has been initialized before. This method helps gain access to default standard style for that type.

Since they are essentially dictionaries, they expose properties and behavior like dictionaries. For example, they expose -
Record property which is a collection of style ids.
GetAT will get a specific style and throw an exception if it does not find any.
NamesInUse – helps in checking if your suggested name conflicts with existing style names and so is a good approach to check before creating a new one.