7.3.1 Structure of the host system
Host system of the integrated information system that combined with CAD system consists of information base, user interface, graphic interface and symbol storage of drawing indication, as shown in figure 7.2 [98].
Figure 7.2 Framework the host system
The information base contains GPS characteristic drawing indication, such as parameter, type of association, geometrical requirement, filter and so on. It provides various kinds of information during operation of the prototype system. User interface is the man-machine interactive window. Through which the user can configure the drawing indication information based on the recommended options by the system or the user can input its own consideration. The generated geometrical indication can be modified or added. Subsequently, the generated drawing indication will be stored in the system and be specified on the drawing.
GPS characteristic drawing indication(abbreviated as GPS indication, the same below) system includes the generation of interface for drawing indication, the production of symbols of GPS indication and the drawing of symbols of GPS indication.
7.3.2 Drawing Indication System of Geometrical Characteristic Consistent with GPS Based on AutoCAD2007
Since the standard for indication of geometrical characteristic in 3D drawing has not been published yet, the development and realization of the drawing indication is based on AutoCAD2007.
7.3.2.1 Second development tools of AutoCAD
With the development of AutoCAD, its second development tools have been updating, such as ObjectARX, AutoLISP, ADS, VisualLISPand VBA. The advantages and disadvantages of various tools have been stated in [99]-[102]. In the above several development tools, in view of the fast speed and versatile functions of ObjectARX, it has been employed in the AutoCAD2007 system to establish the drawing indication system consistent with GPS.
7.3.2.2 Function modules of prototype of the drawing indication system Based on the analysis of the function of the drawing indication system, a schema of the system is shown in figure 7.3, which consists of 6 modules, such as main program module, user interface module, database access module, generation of GPS characteristic in drawing indication module, modification of GPS characteristic in drawing indication module and drawing of GPS characteristic in drawing indication module.
User interface Database access Generation of GPS characteristic In drawing indication prototype of the drawing indication system main program Modification of GPS characteristic In drawing indication Drawing of GPS characteristic in drawing indication
Figure 7.3 Function modules of prototype of the drawing indication system Main program module is the kernel of the whole system. It includes the interface with AutoCAD2007 and it is responsible for the management of other modules and the information transmission between them. User interface module
is used to add the functional menu, man-machine interaction dialog box and so on. Database assess module is used to withdraw the correlated information from the information base, and to provide recommendations for the users to select or input appropriate geometrical characteristic drawing indication. Generation of GPS characteristic in drawing indication module will combine the input information from user and the corresponding standards for drawing indication of geometrical characteristic to generate the rational GPS characteristic in drawing indication. Modification of GPS characteristic in drawing indication module is used to modify the designed drawing indication, and drawing of GPS characteristic in drawing indication module is used to calculate the length that the characteristic in the geometrical characteristic in drawing indication possessions and drawing the geometrical characteristic in drawing indication in AutoCAD 2007.
7.3.2.3 Framework of the prototype system
The application program developed by ObjectARX is a windows dll in nature. Thereby, the information transmission between it with AutoCAD2007 and
Windows can use Windows news transmission mechanism to realize the direct
communication. ObjectARX application program calls acrxEntryPoint() function to
establish the entrance for information transmission with AutoCAD2007, and then use the switch statement in acrxEntryPoint() function to deal with the various messages from AutoCAD2007. ObjectARX runs at the same address space with AutoCAD2007, and it uses the open architecture of AutoCAD 2007 to access it database, graphic system and the geometric modelling core directly. The external command registered by ObjectARX application program through acedRegCmds() macro can be regarded as the same as command in AutoCAD. ObjectARX 2007 is employed.
7.3.2.4 User interface design
To make the software easy to use, the system provides not only executive commands, but also menu bar. Subsequently, the edit of GPS characteristic in drawing indication can be done from both of them.
Firstly, a menu class CGpsMenu of the system is defined, and then add content of the menu from its construction function CGpsMenu() and connect the menu and the command.
CGpsMenu::CGpsMenu( ) { //…… CAcadPopupMenu IPopUpMenuAdd(IPopUpMenu.AddSubMenu(index, _T("add indication"))); CAcadPopupMenu IPopUpMenuForm(IPopUpMenuAdd.AddSubMenu(index, _T("form"))); IPopUpMenuForm.AddMenuItem(index,_T("straightness"),_T("StraightDimen sion\n")); V_I4(&index) = 1; IPopUpMenuForm.AddMenuItem(index,_T("flatness"),_T("PlaneDimension\n ")); V_I4(&index) = 2; //… ... V_I4(&index) = 1;
IPopUpMenu.AddMenuItem(index, _T("modify indication"), _T("ModifyDimension\n"));
V_I4(&index) = 2;
IPopUpMenu.AddMenuItem(index, _T("help"), _T("GpsHelp\n")); //... ...
}
If we call the function addGpsMenu() of the class CGpsMenu() while loading the application program, the menu bar can be uploaded, otherwise if we call the function deleteGpsMenu() of the class CGpsMenu() while unloading the application program, , the menu bar can be unloaded.
Except for menu bar, the user interface also provides the man-machine interactive interface for the user to input the information of GPS characteristic in drawing indication. Since the type of information involved in different GPS characteristics in drawing indication is different, the man-machine interactive interface will be designed independently. Figure 7.4 is the man-machine interactive interface for flatness consistent with GPS.
Figure 7.4 man-machine interactive interface for flatness consistent with GPS 7.3.2.5 Design and development of the self-defined blocks of indication symbol
If the symbols of GPS characteristic drawing indication drawn in AutoCAD 2007 are simply identified as points, line or characters, then each part of the symbols of GPS characteristic drawing indication is separated. And the whole GPS characteristic drawing indication can not change to suit the change of any part of the symbols of GPS characteristic drawing indication. Therefore, we should regard the GPS characteristic drawing indication as a whole. And it is an independent entity and can be regarded as the same as a straight line, circle. ObjectARX running environment includes several groups of class libraries, such as AcDb, AcEd, AcRx, AcGi, AcGe and so on. Where, AcDb is responsible for the management of the AutoCAD database class objects and its quote; AcEd includes a series of classes to define and register the new commands; AcRx is employed for real-time extensions of AutoCAD; AcGi is used to render AutoCAD entity of a graphical interface; AcGe class is tool libraries for general linear and geometric objects.
The user can not only uses AcDb to query and manipulate the entity/objects exists in AutoCAD, but also can create the new instance for the database objtct. The self-defined class CDimensionof for GPS characteristic drawing indication, which is the abstract of symbols of various geometrical characteristic drawing
indication, is inherited from class AcDbEntity in AcDb, as shown in figure 7.5.
Figure 7.5 Structure of the classes involved in prototype of the drawing indication system