The packing structure of the VBA component that is based on AutoCAD designs implementation automatically

  • Time:
  • Click:81
  • source:ELAND CNC Machining
Graph of project of the decorate of graphical cent plane of the CAD that pack and exterior modelling, construction that pack (if produce craft sheet) 2 kinds big. Planar decorate passes the implementation such as Photoshop, Illustrator, CorelDRAW, Freehand, part of the modelling that pack passes the implementation such as 3DMax, Rhino, Maya, Pro / E, UG; Design of graph of project of the construction that pack can apply the software such as Pro / E, UG, AutoCAD to devise scale directly already, the platform with also can be used certain develops implementation 2 times automatic design is generated. Current, also emerge domestic and internationally reveal a batch of outstanding bags to install design major software, pack like Packdesign2000, Founder 3.

0. Use general graphical picture to design software to design efficiency directly not tall, and professional software gets used to all enterprises impossibly, and these software are very costly. Be aimed at the manufacturing treatment of container, how to seek a kind of efficient way, satisfy requirement of different company individuation already, can shorten again design cycle, reduce cost of manpower, material resources greatly, improve design efficiency, a lot of enterprises long to come true. Of course, planar decorate design included too much and artistic part, have too much changeability, come true with the program hard, accordingly, the article will talk the different business that pack, it is platform with AuotCAD, the realizes graph of container construction project automatic design that how goes to the lavatory is generated. 1, 2 development that develop overview AutoCAD system 2 times point to AutoCAD system to go up to give out the professional CAD application software that is aimed at some kind of product in AutoCAD platform by the personnel that is familiar with professional products plan to master computer application technology again already. Design of graph of 2 development implementation and be being generated automatically is higher to CAD software administrative levels apply. AutoCAD is the CAD system with the is based on personal computer current world most comprehensive application that AUTODESK company rolls out, use open mode system and favorable 2 development environment, on the foundation 2 times in its development gets a lot of machinery, electron, professional software that builds an industry. AutoCAD offerred Autolisp / Visuallisp, ADS / ARX, VBA early or late these 3 kinds of main development tools. Look from current application, autolisp is first development step, already was replaced by Visuallisp; ADS general is replaced by the ARX place with powerful function stage by stage; VBA becomes another manufacturing army that AutoCAD user develops 2 times. The each has his strong point of tool of a few kinds of development that AutoCAD offers, let of all kinds developer can have agree with oneself development tool. Begin from AutoCAD R14, VBA makes the built-in component of AutoCAD standard. VBA is having effect of a kind of interface, the graphical boy or girl friend with the powerful development function of the VB development tool that rolls out Microsoft and rich AutoCAD organic union rises, form powerful project figure 2 times to develop a function. VBA component is based on VB of tool of visible, object-oriented development, its develop close of environment of compositive development of environment and VB, but relatively the development tool such as Autolisp / Visuallisp, ADS / ARX, more can quick, come true conveniently friendly interactive, the function is patulous and powerful, agile and development is simple, come true easily. Of course, want to realize the structure that pack to design 2 development of the system automatically, develop a tool with which kinds no matter, must be changed in parameter and graphical library and kongfu of fluctuation of technology of library of functional compose element, such systematic ability are truly only efficient. The article is with carton of a kind of fold exemple, the means of settlement that the VBA component that the introduction uses AutoCAD has 2 times developing implementing a project the graph is generated automatically reachs specific implementation. 2, the VBA component implementation that embeds inside Auto CAD packs structural graph to design a solution automatically to pursue 1 devise a solution automatically to pack structural graph, cent is development phase and applied phase. Developing level basically is design proceed with from major, analytic graph (because logo of article exemple Cheng is simple, reason omits this link) , differentiate functional compose element, parameter is changed, write Dvb program; Applied phase designs offerred data through early days, at the same time Dvb program automatic to load, carry out implementation to set family planning automatically to become directly next. Particular implementation procedure is below. Graph graph of the 1 structure that pack devises a solution automatically 3, functional compose element differentiates the element of functional place structure that element of alleged function compose makes complete container namely, the gather of element of all function compose makes warehouse of functional compose element [. Functional compose element solves the different function place that makes whole structure, there are a variety of structures to fall for choosing a case in every place, random of each functional place structure set an issue, make the parameter that uses element of very few local function structure changes a design (namely library of very small functional compose element) , can get a lot of kinds of structures are combined efficiently, in order to satisfy user requirement, and need not every kinds of structure is designed. All sorts of particular structures that pack will call compose element to combine from inside library of functional compose element and become, realize compose element answer with. Of carton of a kind of fold spread out a graph to see a picture 2, differentiate its element of compose of function of the 3 parts end body of a lid, box, box. 4, parameter changes parameter of functional compose element to change a design, fall in the condition that gives configuration namely, according to certain parameter, create corresponding design automatically. Parameter plot is the main parameter that designs through the input, undertake to standard design variable generation is changed, implementation parameter transforms plot, make the figure that accords with design requirement finally. The advantage of this kind of method is can rise with design module join, give a picture automatically, realize true CAD, improve design efficiency greatly thereby. Parameter changes the main feature that the design is technology of new generation CAD, it is one of significant steps that achieve design process automation, it makes CAD system has function of seesaw pattern plot not only, still have automatic plot function. Graph element of 2 functions compose differentiates pair of industries that pack, a lot of container had not undertaken standardization, seriation and generalization are classified, container serves as special product, must contain the product that assembles all sorts of random dimension, appearance, its structure is Protean, but, always can press proper form to classify, realize parameter to change according to classification to all occurrence structures, the structure that can search likeness to the new structure that did not appear tries to revise, accumulate gradually. To all sorts of carton, especially common hexahedral box form, it is with fold carton exemple: Once its are long, wide, tall, the dimension such as the ply of paper gives out, the dimension of each component of box form reachs the place, these a few parameter that can use box form will decide, through revising this a few parameter can get the box look of different measurement, should appear with the new structure that has a few parameter to cannot be conveyed, can increase parameter according to need, the parameter that this is system of wrapping paper box changes a design. Make be longly, widely, high respectively: L, B, H; Insert tongue and stickup edge to be: But Kcs, Kjt. If the graph is shown 2 times, cover aspect of 1-15 of punctuation of functional compose element to the box, build with the box was coordinate origin at 1 o'clock, horizontal way is X axis, upend direction builds coordinate department for Y axis, all coordinate nods the expression related the L that be contained by parameter melt into, B, H, Kcs, Kjt. 5, write program of plot of functional compose element 5.

1 build alternant interface to command an executive Vbaide command to open environment of VBA compositive development in AutoCAD, the development environment of this environment and VB is adjacent. Will design, move, debug compositive, with Thisdrawing documentation organization, wait for an object according to needing to add the window system with module, interactive implementation, save a project with Dvb file all information. Right key clicks a project, be chosen in quick menu add, choose window system order, can build a new window system. Establish corresponding target according to interactive need. 5.

Right key of 2 initialization graph layer click a project, be chosen in quick menu add, choose module order, can build a new module. Method of graph layer initialization is as follows: Publicl1csxAsAcadLayer ' object of definition graph layer: Subitalize () ' ThisDrawing of initialization graph layer.

Linetypes.

Load"center" , "Acadiso.

Lin" Setl1csx=ThisDrawing.

Layers.

Add ("l1csx" ) L1csx.

Color=acblack ThisDrawing.

ActiveLayer=l1csx ThisDrawing.

ActiveLayer.

Linetype="continuous" EndSub ' other graph layer slightly 5.

3 plot process designing undertakes in Thisdrawing documentation 5.

3.

1 establish graphical target; (with the box the lid is exemple) Subjs-01hega (I) ' computational box top nods coordinate to be worth Pthega each (I0) =0: Pthega (I1) =0 ' 1 Pthega (I2) =0: Pthega (I3) =b-2 ' 2.

.

.

' expression of other dot coordinate omits EndSub Subdraw-01hega (I) ' Dimpoints of the lid that draw a box (0To29) AsDouble Dimpoints1 (0To3) AsDouble ' Dimplobj-hegai-cxAsAcadLWPolyline Dimplobj-hegai-xxAsAcadLWPolyline of object of graph of definition box top ' Fori=0To29 of Duan Lue of picture 2-5 dotted line ' Point of picture solid line (Si) =pthega (Ii) Nexti Setplobj-hegai-cx=ThisDrawing.

ModelSpace.

AddLightWeightPolyline (Points) EndSub 5.

3.

2 found tag an object; (with the box as exemple) Subdim-hes () ' the level tags DimdimobjAsAcadDimAligned Dimpoint1 (2) AsDouble: Dimpoint2 (2) AsDouble: Dimlocation (2) AsDouble ' Point1 of horizontal total size (0) =pthes (8) : Point1 (1) =pthes (9) - Kjt Point2 (0) =pthes (22) : Point2 (1) =pthes (23) Location (0) = (Point1 (0) + Point2 (0) ) / 2: Location (1) =b+50 Setdimobj=ThisDrawing.

ModelSpace.

AddDimAligned (Point1, point2, location) ' horizontal other dimension slightly EndSub 5.

3.

3 found text object Subtxt-01zdzh () ' build text Dimtxt00zdzhAsAcadMText DimtxtAsString: Dimpoints (0To2) AsDouble Txt= .

.

.

' (content of particular text version gives according to need) Points (0) =4*l: Points (1) =0: Points (2) =0 Settxt00zdzh=ThisDrawing.

ModelSpace.

AddMText (Points, 240, txt) EndSub 5.

4 add order of order of Dvb of automatic to load and program document method to add order of order of Dvb of automatic to load bill of fare, the program document way that adds in configuring a dialog box. It is below add entree sheet to AutoCAD " the example that pack " method, in ACAD.

Following content add in Mnu file: ID-draw-01zdzh [fold box] CC (Command"vbaload""01-zdzh" ) ; (Command"-vbarun""draw-01zdzh" ) execute Config order all right in AutoCAD command, play piece " option " dialog box, click " file label " , position of setting menu to load and add project file method and working paper way. 5.

Graph of implementation of 5 moving commands makes moving entree sheet automatically " the example that pack " below " fold carton " command, the foregone condition such as dimension of long, wide, tall, plug, contact dimension is inputted to be able to generate fold carton automatically to produce craft sheet in shooting the dialog box that give. 6, epilogue differentiates through functional compose element, wrote bottom of a few kinds of boxes and box top respectively, free combination gets a variety of structures, making clear the VBA component that embeds inside AutoCAD is a kind of when realize the structure that pack to be designed automatically effective solution. This method comes true compactly, effectively, practically, easily, apply to an enterprise to develop individuation to pack a structure to design a system, development cost is low. CNC Milling