Of AutoCAD custom-built with development

  • Time:
  • Click:156
  • source:TRIANA CNC Machining
Develop at full speed in computer technology today, autoCAD already became one of platform of the most successful CAD series software on the world, this software received very wide application. Because its function is strong,this is not only, supportive platform much, peripheral is wide, mainer reason is it has open architecture, autoCAD allows user and developer to undertake to its in almost all respect augment and revise (undertake namely custom-built develop with 2) , can the special requirement that utmost ground satisfies an user. Current, introduce what the basic order of AutoCAD reachs usage to gain ground model reader is more, and introductory AutoCAD is custom-built rise with what develop a method model reading matter is less; AutoCAD is the computer assists plot software, have catholicity, can apply to a variety of domains such as mechanical, electron, building extensively, plus the oneself characteristic of each industries, this has pair of AutoCAD of specific aim to undertake with respect to the requirement custom-built with development, in order to satisfy the requirement of different domain and disparate industry. This article is with mechanical industry exemple, discuss AutoCAD jointly with everybody custom-built the specific means with development (library of function, icon, standard component library, dimension public errand) , offer reader study and reference. One, the mechanical cartography with the initiative complete to setting of AutoCAD (part drawing or assembly drawing) , need has a plan size, graph layer of column of scale, caption, detail column, graph, dimension is tagged, surface roughness symbol, form tolerancepublic errand is tagged, fiducial mark, spare parts and standard component date waits the down-lead alignment that wait a moment, these need special and custom-built with development. The specific order that involves as a result of the article is much and miscellaneous, here not introduction of one by one explained. If you have certain AutoCAD to operate a base, press the function that undermentioned measure can weave article place is mentioned. It is with AutoCAD2002 exemple (the operation method of different version CAD very much the same) , specific unit process of cargo bandling and program content are as follows: Open AutoCAD 2002 (or R14) , establish new plan, set good plan layer (for example: The name is 01, color is green, line model for Center) , pursue style of a bounds, writing, size type (save in STANDARD) wait for a few main settings, put additionally next for * .

Dwt format (consider oneself name, be like: Acad.

Dwt) , the file of this format protects existence C:PBelow Rogram FilesAutoCAD 2002Template. Such, built unified pattern plate file. Below file of this pattern plate, the caption column that you need scale, input Ddattdef all right in the command next (carriage return) , play an attribute to define a dialog box, input corresponding value. For example: 1.

MODE sets attribute pattern (1) Invisible control is visible or sightless mode (choose on) (2) Constant installs an attribute after inserting constant is worth to secure (3) Verify is met after keying in attribute ask you affirm the validity that keys in a value (4) .

Column of Attribute attribute dialog (1) the name of label of Tag setting attribute (2) the character that Prompt setting hints (3) the default of character of Value setting clew is worth 3.

The type of character of attribute of Text Options setting (1) pair of neat means of Justification setting character (2) the glyph of character of Text Style setting (3) the height of Height setting character (4) Rotation installs a character rotate angle 4, Pick Point is used directly, after the property that chooses mobile command to make the positional admiral in ideal needs this property individually ends by afore-mentioned methodological inputs, next the operation is to want to be graph and attribute union a WBLOCK (piece) , wblock carriage return is inputted below command travel, command: File Name of Wblock carriage return: Input name of a file (carriage return) Block Name: Carriage return Insertion Base Point: Catch to insert a dot (carriage return) Selec Objects: The figure that chooses your place scale and attribute (carriage return) Selec Objects: Carriage return Command: Oops carriage return so far the attribute of caption column piece finished with respect to the definition. If you understood really, according to afore-mentioned measure OK and custom-built the property that gives symbol of list, surface roughness, fiducial mark piece. This definition pursues below pattern plate, in unified pattern plate (Acad.

Dwt) below, by national level scale a graph is like A0, ddinsert inputs below command travel (carriage return) Command: Ddinsert (carriage return) File Name: Input name of a file (carriage return) note: The file name that builds attribute piece namely Insert Point: In the graph go up the place that chooses ideal (carriage return) X Scale Factor <1>/ Corner / XYZ: (carriage return) Y Scale Factor (default=X) : (carriage return) Rotation Angle <0>: ? ɑ Yao carries ┦ sell calamity to carry sell of ㄉ shaddock Meng accumulate Yao lens Nai mires extensive of ㄒ of Zheng  sea is carried by Yao below condition of Ommand of ┲ barium Jian , put additionally next to pursue an A0.

Dwt (consider oneself name) . Same, the plan that establishs A1, A2, A3, A4 pattern plate. Ddatte inputs below command travel (carriage return) Command: Ddatte (carriage return) Selec Block: Choice title column is shooting the dialog box that gives editor property, input corresponding property value, this attribute is worth but what automatic fill defines to you corresponding locally. 2, the program of AutoCAD and icon menu, next pulling menu is installed 1.

The brief specification of the function that in introducing how to develop program and program with LISP language, involves. Build * of one text file.

Lsp (for example Mycad.

Lsp) , the content below is inputted in this file. (Defun C:bScale(/ Hk) " the definition pursues a scale (Setq Hk (getdist "n asks an input to pursue a scale:" ) ) (Command "SCALE" "all" "" "0, 0" (/ 1 Hk))(command "DIMSCALE" (/ 1 Hk))(command "ZOOM" "all" "")(setvar "HPNAME" "ANSI31")(setvar "HPSCALE" 1.

5)(setvar "TEXTSIZE" (/ 4 Hk)) ) open C:PRogramFilesAuto CAD2002SUPPORTAutoCAD2000 Doc.

Lsp(AcadR14.

Lsp) , input all right in the penult of this file (Load "mycad.

Lsp" "") , save this file. (had better make former file back up first) . Enter CAD afresh, the function that you define is automatic to load, the use of this function introduces below. The picture that opens a standard pattern plate is like A1.

Dwg, issue an input all right in the command: Command: Bscale (carriage return) ask an input to pursue a scale: 1/2 (carriage return) note: If build pattern plate when, it is this scale input 1, so A0 ~ A4.

The graph of Dwt scale is acquiescent from beginning to end for 1. The input pursues an attribute that proportional advantage depends on your place using piece (for example surface roughness symbol) enlarge is contractible scale and pursue a scale photograph is consistent. 2.

Input jussive kind is written down hard namely bother again, so Where is the form that how turns afore-mentioned orders into icon or bill of fare? The answer is affirmative. Open C:PRogramFilesAuto CAD2002 (R14) SUPPORTacad.

Mnu (or Acad.

Mns) , following content are inserted in corresponding position, save: The graph pulls menu below 1 definition (1) menu is pulled below the definition (insert after menu is pulled below former some) ***POPx [abstains CAD(&Z)] [to pursue a scale (&A)]^C^C_bscale [- - ] explain: 1) install X next pulling menu 2) X next functions that play menu name, shortcut key code is Z3) next component that pull menu name, ^C^C is carried out 2 times interrupt an operation to execute the order from the back next (what define in the function, like Bscale) 4) falling in pulling menu, show separator pursues column of tool of 2 definitions icon (2) column of definition icon tool (insert after original icon menu) **MYCAD[_Toolbar("MYCAD" , _Floating, _Show, 0, 1, 0)][_Button(" pursues a scale " , "Bscale.

Bmp" , "Bscale.

Bmp")] ^C^C_bscale [- - ] enter CAD afresh, you can see what what weave fall pull menu and column of icon mark tool. If do not have, input Menu below Command condition please (carriage return) , in the Acad that in playing the dialog box that give to be chosen, you just save.

Mun (or Acad.

Mns) , press affirmatory button next. Additional, icon tool column also but handiwork is custom-built. The random below plot environment presses mouse right key on icon, play a menu to choose to be defined oneself, tool column chooses in defining a dialog box oneself, by build pushbutton, MYCAD is inputted in tool pen name, press affirmatory button. Reelection choose commands medium user is defined, after pressing mouse wrong key to pull the pushbutton that employs a definition to arrive in the tool column of MYCAD, mouse wrong key clicks this pushbutton, the pushbutton name that in pushbutton character input user defines if " pursue a scale " , be in as associated as this pushbutton grand in input ^C^C_bscale, choose to edit pushbutton next, can draw directly on pushbutton editor, also can open Bscale.

Bmp file (be like: Draw with Photoshop) , pitch on uses button. The graph demarcate of the others formulates a method with this analogize. 3, the function of the AutoCAD that the author develops reachs use method 1. Program (1) define symmetrical boundary (Defun C:dCx (/ Ss1 Dist P1 P2 P3 P4 P5 Len Pn Pm Pn1 Pm1 Ee Ang1 Sb) (setvar "orthomode" 1)(setq Sb (getvar "osmode"))(setvar "osmode" 33)(setq Ss1 (ssget)dist (getdist "n inputs the distance between parallel please:" ) initial drop of P1 (getpoint "n or diagnostic dot:" ) terminus of Len (getdist P1 "n or diagnostic dot or length:" ) Ee (entget (ssname Ss1 0))p2 (cdr (assoc 10 Ee))p3 (cdr (assoc 11 Ee))ang1 (angtos (angle P2 P3) 0 1))(command "_UCS" "_Z" Ang1 "")(setq P4 (trans P1 0 1)p5 (trans P2 0 1)pn (list (car P4) (+ (cadr P5) (/ Dist 2.

0)))pm (list (car P4) (- (cadr P5) (/ Dist 2.

0)))pn1 (polar Pn 0 Len)pm1 (polar Pm 0 Len))(setvar "osmode" 0)(command "line" Pn Pn1 "" "line" Pm Pm1 "")(command "_UCS" "_W" "")(setvar "osmode" Sb)) (2) definition surface roughness (Defun C:wBin (/ Sa) (setq Sa (getvar "osmode"))(setvar "osmode" 0)(setq Sc (getvar "DIMSCALE"))(setvar "osmode" 512)(command "insert" "ccd" Pause Sc Sc Pause)(setvar "osmode" Sa)) (3) definition serial number (Defun C:bA number of number of serial of Ub1 (/ P1 P2 P3 Sc Hd Hd1 K H Sb)(setq Sb (getvar "osmode"))(setvar "osmode" 0)(setq H (getint "n:" ) P1 (getpoint "nFirstpoint:" ) ) (Setvar "osmode" 512)(setq P2 (getpoint P1 "nSecondpoint:" ) Sc (getvar "DIMSCALE") Hd (* 7 Sc) Hd1 (* 4 Sc))(setvar "osmode" 0)(command "LAYER" "S" "03" "" "donut" 0 Sc P1 "" "line" P1 P2 "")(if (>(Car P2) (car P1))(setq An1 0))(if (<(Car P2) (car P1))(setq An1 Pi))(setq P3 (polar P2 An1 Hd))(command "line" P2 P3 "")(setq P0 P2 K 2)(while (<= K H)(setq P2 (list(car P2) (+ (* 8 Sc) (cadr P2))) P3 (polar P2 An1 Hd))(command "line" P2 P3 "")(setq K (1+ K)))(setq Pt (list (/ (+ (car P2) (c.

2 Sc) (cadr P3))))(command "line" P0 P2 "" "LAYER" "S" "0" "" "dtext" "J" "C" Pt Hd1 0)(setvar "osmode" Sb)) (4) definition form tolerancepublic errand (Defun C:gC (/ Pp1 Pp2 Pp3 Pp4 S2 K1 K2 Sb1 Sb2 G1) (setq Sb1 (getvar "ORTHOMODE")sb2 (getvar "OSMODE") )(setvar "ORTHOMODE" 1)(setvar "OSMODE" 512)(setq Pp1 (getpoint "n chooses on entity please a bit:" ) ) (Setvar "OSMODE" 0) (setq Pp2 (getpoint Pp1 "n determines derivative line position please:" ) Pp3 (getpoint Pp2 "n decides derivative line is terminal please:" ) S2 (getvar "DIMSCALE")g1 (angle Pp1 Pp2)k1 (* 1.

5 S2)k2 (* 4.

5 S2) CNC Milling