Process automatization of creating 3D objects in AutoCAD software

: In this paper possibilities of using of CAx systems to automation process of graphical tasks are presented. Possibility of using Delphi language with OLE technology to creating 3D objects in CAx system are analysed

applications under the control of Windows operating systems.It is therefore a facilitation for the programmer -it allows to save time, which would have to be devoted to the development of own communication tools between the programs.By using ActiveX technology, one can create AutoCAD program objects and interact with them from another application that acts as an automation driver.The ActiveX mechanism allows you to program tasks that use different applications.With its help, AutoCAD defines drawing elements as objects described by AutoCAD as the Object Model, which can be created, edited and submitted to various operations by other applications.The objects thus created are called automation objects.They are served by the so-called methods, properties and events.Methods are functions that determine the operation on an object.Properties are functions that determine or reflect the status of an object.On the other hand, events are user-defined operations or instances to which the program responds.Each application that has access to the AutoCAD Object Model is an automation driver.
ActiveX technology provides access to individual AutoCAD objects.Their structure is very extensive -objects are m.in.drawing elements, blocks or collection of indications (sets of objects).The main interface object is AutoCAD.Application, to which other objects belong.The most frequently used object in the works on drawing is Document (in AutoCAD it is an active window with a drawing), to which belong, among others, objects generating drawing components and settings of the current drawing.Another very important object is the Space Model, which is a collection of all elements in the space of the model.New objects to this collection can be added using the Add-Type of the Element.
In order to use the methods and interface objects using an external program, it is necessary to establish a connection to the AutoCAD OLE service.This is done by calling the CreateOleObject function, which creates an object that provides AutoCAD objects.From the external program, you can access an actively open drawing (open document) using the Get-ActiveOleObject function, which provides the objects of the active program.To obtain a connection with the OLE server for programs created in Delphi language, use the module with the name AutoCADCAD [3].

Example of automating the introduction of spatial objects
In the process of developing a special software, allowing for the desired operations in the CAx system (e.g.automatic generation of spatial elements based on engineering calculations), a free RAD Studio 10.2 Tokyo Starter programming environment can be used (fig.1).In the process of automating graphics tasks, the Delphi programming language was used, which was used to develop a new computer program "Konik.exe"[4], enabling the introduction of chess box solids in the area of the AutoCAD program model.
The figure of a chess horse can be created as a result of logical operations (such as: sum, difference, common part) on solids, based on profiles forming a given solid (both polylines and regions are used in this process).Fig. 2 presents exemplary dimensions of profiles forming the chess box solid (extruded profile, rotary profile and notching profile), and in fig. 3 -the order of performing logical operations to obtain target geometry.
To automate this process, it is necessary to define the selected AutoCAD 2018 OLE automation interface methods for introducing both flat and spatial objects [5].The code fragment of the main module "Konik.pas",which is responsible for entering a profile in the area of the AutoCAD model in the region of the region, is shown in fig. 4.
To create a solid body from a closed polyline or region profile, use the AddExtrudedSolid field-price.The code fragment of the main module "Konik.pas",used for the extraction of the region, performing a logical operation with respect to solids and removing the extraction envelope, is shown in fig. 5.
Similar operations can be repeated in the process of creating a rotating envelope (use the AddRevolvedSolid command) and the clipping boundary.
In the process of logical operations with respect to solids, the object.Boolean (Ope-ration, Object) function should be used, whose parameters are: Object, that is, a solid or region object, and Operation -a numerical value specifying the type of logical operation.The Operation variable can have values: 0 (ac-Union -summation of the set of indications), 1 (ac-Intersection -the common part of the set of indications) and 2 (ac-Subtraction -subtraction of the sets of indications).

Conclusions
The article presents the possibility of using a program created with the use of Delphi language to introduce a spatial object in the area of the Auto-CAD program model.The selected methods of the OLE automation interface are also presented and the ActiveX technology discussed.Source codes of developed pro-grams can also be used when it is necessary to develop own programs defining the geometry of solid objects.The main purpose of creating the software described in the article was to save time in the case of performing repetitive tasks with respect to generating 3D objects.The automatic definition of AutoCAD drawing components can be widely used in practice.The Delphi language example presented in the article confirms that the use of programming languages allows for the automation of modeling of flat and spatial objects in computer support systems, which indirectly influences the more productive use of CAx data systems.