Based on. NET CAD two-time Development study Note two: AutoCAD. The objects in net

Source: Internet
Author: User

1, CAD object: A CAD file (DWG file) that corresponds to a database, all components of the database, see (including points, polylines, text, circles, etc.) and invisible (layer, line, color, etc.) are objects, the database itself is an object.

    • Graphic objects such as lines, arcs, text, and callouts are objects.
    • Style settings, such as Linetype and dimension styles, are objects.
    • Organizational structures such as layers, groups, and blocks are objects.
    • Graphical displays, such as views and viewports, are objects.
    • Even graphics and AutoCAD applications themselves are objects.

2. Containers in CAD: For any DWG file, the following container pairs are created: Nine fixed symbol tables (below) and a well-known dictionary (containing the group dictionary and the Mline Style dictionary). All objects in CAD are placed in these container objects, and both the symbol table and the well-known object dictionary have the same function of organizing and managing objects in the CAD database. That is, they contain entity objects that can be queried by literal strings as keywords for object entities, and records are added to those containers (records are objects) and records are modified.

3, the symbol table and the dictionary is different: the symbol table is as follows 9, each symbol table can only store certain types of objects (such as the block table can only store block table records, the layer table can only store layer table records), and the dictionary is a common container, can store any type of object. (Typically, most of the objects are manipulated by the symbol table)

9 type symbol table:

1) block table (blocktable)

2) Dimension style sheet (dimstyletable)

3) Layer Table (layertable)

4) Line chart (linetypetable)

5) Application Registration form (regapptable)

6) Text style sheet (textstyletable)

7) User coordinate system table (ucstable)

8) Viewport table (viewporttable)

9) View Chart (viewtable)

4. Object hierarchy in AutoCAD. NET API

1) Application Object hierarchy

The Application object is the root object of the AutoCAD. NET API object model. The Application object allows the user to access the main window and any open graphics. Once the user has obtained the drawing, they can access the objects in the drawing.

For example, the Application object has a Documentmanager attribute that can return a Documentmanager object. This object provides access to the current drawing in AutoCAD and allows the user to create, save, and open a drawing file. Other features provided by the Application object can be private data, such as the Information Center (InfoCenter), main window (main windows), and status bar. The MainWindow feature allows users to access the name, size, location, and visibility of the application.

Although the attributes of the Application object allow access to most objects of the AutoCAD. NET API, there are also references to AutoCAD Activex®automation objects. These features include the COM version of the Application object (Acadapplication), the menu bar (MenuBar), the Loaded menu group (menugroups), and the parameter options (Preferences).

2) object hierarchy of document

The Document object is actually an AutoCAD graphic, which is part of the DocumentCollection object and provides access to the Database object associated with the Document object. The Database object includes all the graphics and most of the non-graphical AutoCAD objects.

Together with the Database object, the Document object provides access to the graphics status bar (StatusBar), the Document object is opened window (Windows), editor and the transaction manager (TransactionManager) object. Editor provides the ability for a user to obtain a point, input string, or numeric value in the form of input.

The transaction manager object is used to access a single operation under multiple database objects as a transaction object. Transactions can be nested, and when a user finishes a transaction, they can commit or discard the changes that have been made.

3) Database object hierarchy

The Database object includes all the graphics and most of the non-graphical AutoCAD objects. Some objects that are included in the Database have entities, symbol tables, and named dictionaries. An entity represents a drawing object inside a sheet in the Database. Lines, circles, arcs, text, fills, and polylines are an example of an entity. The user can see an entity on the screen and can manipulate it.

Users can access the database object of the current document through the database member property of the Documents object.

Application.DocumentManager.MdiActiveDocument.Database

Symbol Tables and dictionaries

Symbol tables and Dictionary objects provide access to non-graphical objects (blocks, layers, linetypes, layouts, and so on). Each figure in AutoCAD contains 9 fixed symbol tables, however the number of dictionaries in the graph can be changed based on the function and the type of application used. The new symbol table cannot be added to the Database.

For example, the Layer table (layertable) is the symbol table, which contains the layer table records, and the Block table is also the symbol table, which contains the block table records. All graphical entities (lines, circles, arcs, and so on) are all part of a block table record. By default, each graph has pre-defined block table records for model space and paper space. Each paper space layout has its own block table record.

A dictionary is a container that can contain any AutoCAD object or Xrecord object.

4) graphical objects, also known as entities, are visible objects that make up a graphic (such as lines, circles, raster images, and so on). Adding a drawing object to the drawing is done with the correct block table record reference, and then using the Appendentity method to add a new object to the drawing.

To modify or query these objects, obtain an object reference from the correct block table record, and then use the method or attribute of the object itself. Each graphical object has a method that allows the application to perform most of the AutoCAD editing commands, such as copy, delete, move, mirror, and so on.

These objects also provide methods for setting and retrieving extended data for Objects (XData), highlighting and updating objects, and setting properties from another entity. Most graphical objects have typical features such as Layerid, Linetypeid, Color, and Handle. Each object also has some unique features, such as Center, StartPoint, Radius, and Fittolerance.

Non-graphical objects are those (suggestive) objects that are part of a graphic but are not visible, such as Layers, Linetypes, Dimstyles, TableStyle, and so on. To create a new symbol table record, use the table owner's Add method or use the SetAt method to add a dictionary to the Command object dictionary. To modify or query these objects, use the methods or attributes of the object itself. Each non-graphical object has methods and features for a specific purpose, with the option to set up and retrieve extended data and to delete its own methods.

Based on. NET CAD two-time Development study Note two: AutoCAD. The objects in net

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.