CN103793145B - A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent - Google Patents

A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent Download PDF

Info

Publication number
CN103793145B
CN103793145B CN201410059672.XA CN201410059672A CN103793145B CN 103793145 B CN103793145 B CN 103793145B CN 201410059672 A CN201410059672 A CN 201410059672A CN 103793145 B CN103793145 B CN 103793145B
Authority
CN
China
Prior art keywords
picture frame
angle point
coordinate
upper right
formula
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410059672.XA
Other languages
Chinese (zh)
Other versions
CN103793145A (en
Inventor
贺耀北
彭立
李瑜
刘榕
王甜
罗强
刘拓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Provincial Communications Planning Survey and Design Institute Co Ltd
Original Assignee
HUNAN COMMUNICATION PLANNING AND PROSPECTING DESIGN ACADEMY
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HUNAN COMMUNICATION PLANNING AND PROSPECTING DESIGN ACADEMY filed Critical HUNAN COMMUNICATION PLANNING AND PROSPECTING DESIGN ACADEMY
Priority to CN201410059672.XA priority Critical patent/CN103793145B/en
Publication of CN103793145A publication Critical patent/CN103793145A/en
Application granted granted Critical
Publication of CN103793145B publication Critical patent/CN103793145B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent, implement step as follows: open AutoCAD and read in the file data of its drawing file to be output supporting form, obtain the picture frame search option of user setup, block table filters, obtain object set, figure layer filters, object in traverse object set, the ratio of width to height judgement is carried out respectively according to its figure box type, if the ratio of width to height judges to meet requirement, then will extract the picture frame information of this object and preserve, after obtaining the picture frame information of all drawing files, select output pattern and output equipment, then AutoCAD is called to drawing content batch signatures corresponding to the picture frame information that the output equipment specified is the most to be output.The present invention has output quickness and high efficiency, easy to use, good reliability, versatility advantage strong, applied widely good, compatible.

Description

A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent
Technical field
The present invention relates to Computer-aided Design Technology field, be specifically related to a kind of modifying picture frame parameters identification based on AutoCAD and figure Paper output intent.
Background technology
CAD (Computer Aided Design) CAD, is an important application of computer technology. AutoCAD is the Interactive Drawing Software of autodesk, inc. of U.S. exploitation, for two dimension and three dimensional design, the system of drawing Instrument, user can use it to create, browses, manages, prints, exports, share the design configuration rich in information.As Universal graphics software, AutoCAD is widely used in the design work of industry-by-industry.Although the function collection of AutoCAD itself Be enough to assist user to complete various design work, but in the design of complicated CAD problem or specific use, foundation Original software function of AutoCAD is often difficult to solution problem or inefficiency.
AutoCAD drawing is generally made up of two parts: text and picture frame.Text comprises the various design parameters that drawing needs are expressed, Design idea is expressed;The information such as picture frame is then to define figure amplitude range, the record map title, figure number, number of pages, the page number, the time, The power and responsibility signature blank designing, checking, examine, authorize is provided.Basic picture frame component is straight line (or polyline), list Style of writing word (or multline text) etc.;Picture frame can by by straight line (or polyline), single line text (or multline text) etc., Make segment, be inserted in file;Picture frame can also be inserted in file by referring to the form quoted.In actual use, Due to the difference of personal habits, various figure box forms are likely to existence.Simultaneously as not commensurate, disparity items right Call format be not quite similar, form and the position of each element of picture frame are also not quite similar.As last link of engineering design, How the drawing file of substantial amounts of, multi-form, different-format is identified that carrying out arrangement adds up exactly, and export rapidly, It it is the problem faced by each designer is required for.AutoCAD itself provides output instrument, but at present can only be for list Open drawing to export, inefficiency;AutoCAD is also proposed drawing collection management function, drawing collection can carry out batch defeated Go out, but owing to this functional mobility is inadequate, and domestic design requirement can not be closely conformed to, therefore level of application is limited;State Inside and outside also have and carry out secondary development for problem above, it is proposed that the drawing output intent of batch, each define the form of picture frame with Form, the identification of picture frame is that the particular form to picture frame, special style, specific names are mated, and limits its range of application.
Summary of the invention
The technical problem to be solved in the present invention be to provide a kind of output quickness and high efficiency, easy to use, good reliability, versatility are good, Compatible modifying picture frame parameters identification based on AutoCAD strong, applied widely and drawing output intent.
In order to solve above-mentioned technical problem, the technical solution used in the present invention is:
A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent, implementation step is as follows:
1) open AutoCAD and read in the file data of its drawing file to be output supporting form;
2) obtaining the picture frame search option of user setup, described picture frame search option includes search volume type, figure box type, figure Layer title screening conditions, segment title screening conditions, the rectangular area of standard picture frame housing, the rectangular area of standard picture frame inside casing, Described search volume type includes model space block table record and two kinds of multiselect options of arrangement space block table record, described figure box type Including segment, with reference to quoting, polyline, four kinds of figure box type multiselect options of straight line;Read in document data bank, travel through number of files According to the block table database in storehouse, according to the search volume type in described picture frame search option to the block table record in block table database Carry out screening and filtering;
3) for by the block table record after screening and filtering, the figure box type specified in wherein said picture frame search option is obtained corresponding Object, single line text, multline text is as pending object set;
4) described picture frame search option whether appointment figure layer title screening conditions are judged, when specifying figure layer title screening conditions, will The object not meeting figure layer title screening conditions in described object set is deleted, and only retains the object meeting figure layer title screening conditions;
5) select first object as existing object from described object set;
6) judge the type of existing object, the type at existing object be segment, with reference to quote time, jump procedure 7);Working as When the type of front object is polyline, jump procedure 8);When the type of existing object is straight line, filter out in object set All horizontal lines and vertical curve, if existing object is all horizontal lines in object set and in vertical curve, and by wrapping Determine the frame object of a rectangle containing existing object at an interior horizontal line, a vertical curve, then described frame object is replaced For existing object jump procedure 8), otherwise jump procedure 10);
7) judge whether described picture frame search option specifies segment title screening conditions, when specifying segment title screening conditions, as Really the title of existing object does not meets segment title screening conditions, then filter existing object jump procedure 10);Otherwise redirect step Rapid 8);
8) obtaining the external boundary angle point of existing object, described external boundary angle point includes lower-left angle point and upper right angle point, calculates the lower left corner Point and upper right corner point form the ratio of width to height of coordinates regional, calculate the ratio of width to height of standard picture frame housing, the width of standard picture frame inside casing simultaneously High ratio;Judge whether the ratio of width to height of described lower-left angle point and upper right corner point formation coordinates regional meets appointing in formula (1)~(4) Meaning one;If meeting formula (1), then judge that described external boundary angle point, as meeting the housing border angle point required, arranges the anglec of rotation Degree is 0 °, shown in picture frame scaling such as formula (5);If meeting formula (2), then judge that described external boundary angle point is wanted as meeting The housing border angle point asked, arrange the anglec of rotation be 90 °, shown in picture frame scaling such as formula (6);If meeting formula (3), Then judge described external boundary angle point as meeting the inner frame boundary angle point required, arrange the anglec of rotation be 0 °, picture frame scaling such as Shown in formula (7), and update shown in lower left corner point coordinates such as formula (9) and shown in upper right corner point coordinates such as formula (10);If it is full Foot formula (4), then judge the described external boundary angle point inner frame boundary angle point as satisfied requirement, and arranging the anglec of rotation is 90 °, picture frame Shown in scaling such as formula (8), and update shown in lower left corner point coordinates such as formula (11) and upper right corner point coordinates such as formula (12) institute Show;Judging that lower-left angle point and upper right corner point form the ratio of width to height the most satisfied appointment requirement of coordinates regional, if met, redirecting step Rapid 9), otherwise jump procedure 10);
| R - P W | R ≤ E - - - ( 1 )
| R - 1 P W | R ≤ E - - - ( 2 )
| R - P N | R ≤ E - - - ( 3 )
| R - 1 P N | R ≤ E - - - ( 4 )
In formula (1)~(4), R represents that lower-left angle point and upper right corner point form the ratio of width to height of coordinates regional, and PW represents standard The ratio of width to height of picture frame housing, PN represents the ratio of width to height of standard picture frame inside casing, and E represents default allowable error value;
The calculation expression of the ratio of width to height R calculating lower-left angle point and upper right corner point formation coordinates regional is:
R = | J 2. Y - J 1. Y | | J 2. X - J 1. X |
In above formula, R represents that lower-left angle point and upper right corner point form the ratio of width to height of coordinates regional, and J1.X represents the X of lower-left angle point J1 Coordinate, J1.Y represents the Y coordinate of lower-left angle point J1;J2.X represents the X-coordinate of upper right angle point J2, and J2.Y represents the upper right corner The Y coordinate of some J2;
The calculation expression of the ratio of width to height PW of standard picture frame housing is:
P W = | W K 2. Y - W K 1. Y | | W K 2. X - W K 1. X | ;
In above formula, PW represents the ratio of width to height of standard picture frame housing, and WK1.X represents standard picture frame housing lower-left angle point WK1's X-coordinate, WK1.Y represents the Y coordinate of standard picture frame housing lower-left angle point WK1;WK2.X represents standard picture frame housing upper right The X-coordinate of angle point WK2, WK2.Y represents the Y coordinate of standard picture frame housing upper right angle point WK2;
The calculation expression of the ratio of width to height PN of standard picture frame inside casing is:
P N = | N K 2. Y - N K 1. Y | | N K 2. X - N K 1. X |
In above formula, PN represents the ratio of width to height of standard picture frame inside casing, and NK1.X represents the X of standard picture frame inside casing lower-left angle point NK1 Coordinate, NK1.Y represents the Y coordinate of standard picture frame inside casing lower-left angle point NK1;NK2.X represents the standard picture frame inside casing upper right corner The X-coordinate of some NK2, NK2.Y represents the Y coordinate of standard picture frame inside casing upper right angle point NK2;
S c a l e = | J 2. X - J 1. X | | W K 2. X - W K 1. X | - - - ( 5 )
S c a l e = | J 2. X - J 1. X | | W K 2. Y - W K 1. Y | - - - ( 6 )
S c a l e = | J 2. X - J 1. X | | N K 2. X - N K 1. X | - - - ( 7 )
S c a l e = | J 2. X - J 1. X | | N K 2. Y - N K 1. Y | - - - ( 8 )
J 1. X = J 1. X - S c a l e × H 1 J 1. Y = J 1. Y - S c a l e × V 1 - - - ( 9 )
J 2. X = J 2. X + S c a l e × H 2 J 2. Y = J 2. Y + S c a l e × V 2 - - - ( 10 )
J 1. X = J 1. X - S c a l e × V 2 J 1. Y = J 1. Y - S c a l e × H 1 - - - ( 11 )
J 2. X = J 2. X + S c a l e × V 1 J 2. Y = J 2. Y + S c a l e × H 2 - - - ( 12 )
In formula (5)~(12), Scale represents picture frame scaling;J1.X represents the X-coordinate of lower-left angle point, J1.Y table Show the Y coordinate of lower-left angle point;J2.X represents the X-coordinate of upper right angle point, and J2.Y represents the Y coordinate of upper right angle point;NK1.X The X-coordinate of expression standard picture frame inside casing lower-left angle point, NK1.Y represents the Y coordinate of standard picture frame inside casing lower-left angle point;NK2.X The X-coordinate of expression standard picture frame inside casing upper right angle point, NK2.Y represents the Y coordinate of standard picture frame inside casing upper right angle point;WK1.X The X-coordinate of expression standard picture frame housing lower-left angle point, WK1.Y represents the Y coordinate of standard picture frame housing lower-left angle point;WK2.X The X-coordinate of expression standard picture frame housing upper right angle point, WK2.Y represents the Y coordinate of standard picture frame housing upper right angle point;H1 table The left side of inside casing of the quasi-picture frame of indicating, housing the left side between horizontal range, its expression formula is H1=| NK1.X-WK1.X |; H2 represents horizontal range between the right of the right of the inside casing of standard picture frame, housing, and its expression formula is H2=| WK2.X-NK2.X |;V1 represents between the base of the base of the inside casing of standard picture frame, housing vertically distance, its table Reaching formula is V1=| NK1.Y-WK1.Y |;V2 represents between the top margin of the top margin of the inside casing of standard picture frame, housing vertically distance, Its expression formula is V2=| WK2.Y-NK2.Y |;
9) by picture frame information corresponding for existing object and the picture frame information contrast preserved, picture frame information as corresponding in existing object is still Not preserving, then preserve the picture frame information that existing object is corresponding, described picture frame information comprises lower-left angle point and the upper right of existing object The coordinate of angle point, picture frame scaling, the anglec of rotation;
10) judge whether existing object is last object in object set, if it is terminate to process and jump procedure 11), From described object set, otherwise select next untreated object as existing object, jump procedure 6);
11) first reading all picture frame information preserved, display output selects for user to user, then user is selected Picture frame information is as picture frame information list to be output;
12) call the output CSS of AutoCAD, according to pre-defined value automatically specify in AutoCAD output equipment, Map format and output pattern, send output order by AutoCAD to the equipment specified, and described output order includes the most defeated Go out the graphic file title of picture frame information, pattern space title, graphic limit, picture frame scaling, the anglec of rotation, map sheet chi Very little, output pattern;
13) by the described equipment specified, drawing region corresponding for each picture frame information in picture frame information list to be output is exported.
Further, described step 2) when obtaining the picture frame search option of user setup, described picture frame search option also includes mark The rectangular area of the map title, the rectangular area of figure number, the rectangular area of number of pages, the rectangular area of the page number in quasi-picture frame;Described step 9) when preserving the picture frame information of existing object, first according to the rectangular area of the described map title, the rectangular area of figure number, the square of number of pages Shape region, the rectangular area of the page number, respectively according to the frame object anglec of rotation obtain above-mentioned four kinds of rectangular areas lower-left angle point and Upper right angle point, if the anglec of rotation is 0 °, then according to formula (13) and (14) update every kind of rectangular area lower-left angle point and Upper right angle point;If the anglec of rotation is 90 °, then according to formula (15) and (16) update every kind of rectangular area lower-left angle point and Upper right angle point;Identify successively in the single file or the multline text object that are positioned at above-mentioned four kinds of rectangular areas in drawing file to be output Word, obtains the map title of existing object, figure number, number of pages, the page number, after being filtered by the non-digital content in described number of pages, the page number Be converted to integer;The map title, figure number, number of pages, the page number are stored in the picture frame information of existing object;Described step 11) middle reading All picture frame information opening drawing file to be output having completed the preservation of picture frame information also show that output selects for user to user Time, arrange as the first sort criteria, the page number as the second sort criteria using figure number for reading all picture frame information obtained Show after sequence that output is to user;
T J 1. X = J 1. X + ( T 1. X - W K 1. X ) × S c a l e T J 1. Y = J 1. Y + ( T 1. Y - W K 1. Y ) × S c a l e - - - ( 13 )
T J 2. X = J 1. X + ( T 2. X - W K 1. X ) × S c a l e T J 2. Y = J 1. Y + ( T 2. Y - W K 1. Y ) × S c a l e - - - ( 14 )
{ T J 1. X = J 1. X - ( T 1. Y - W K 1. Y ) × S c a l e T J 1. Y = J 1. Y + ( T 1. X - W K 1. X ) × S c a l e - - - ( 15 )
T J 2. X = J 1. X - ( T 2. Y - W K 1. Y ) × S c a l e T J 2. Y = J 1. Y + ( T 2. X - W K 1. X ) × S c a l e - - - ( 16 )
In formula (13)~(16), TJ1.X represents the X-coordinate after the angle point renewal of lower-left, described rectangular area, and TJ1.Y represents Y coordinate after the angle point renewal of lower-left, described rectangular area;TJ2.X represents the X-coordinate after the upper right angle point renewal of described rectangular area, TJ2.Y represents the Y coordinate after the upper right angle point renewal of described rectangular area;Before T1.X represents that lower-left, described rectangular area angle point updates X-coordinate, T1.Y represent lower-left, described rectangular area angle point update before Y coordinate;T2.X represents described rectangular area upper right X-coordinate before angle point renewal, T2.Y represents the Y coordinate before the upper right angle point renewal of described rectangular area;J1.X represents the most right As the X-coordinate of corresponding picture frame lower-left angle point, J1.Y represents the Y coordinate of the picture frame lower-left angle point that existing object is corresponding;Scale table Diagram frame scaling.
Further, the first sort criteria and the second sort criteria are ascending order arrangement.
Further, described step 12) by AutoCAD when the equipment specified sends output order, if that specifies sets Standby for virtual unit, then sent to the equipment specified by AutoCAD and output order is specified virtual unit automatically generate file Title comprises current the output map title of picture frame information, figure number, page number information.
Further, described step 2) in figure layer title screening conditions include figure layer title docuterm segment value and whether just use Then expression formula option.
Further, described step 2) in segment title screening conditions include support regular expression segment title docuterm Segment value.
Present invention modifying picture frame parameters based on AutoCAD identification has the following technical effect that with drawing output intent: the present invention does not limits Certain specific file format, every in step 1) in can be supported to read and the file format of operation by AutoCAD, the most permissible The modifying picture frame parameters identification and the drawing output intent that use the present invention carry out batch signatures, have output quickness and high efficiency, easy to use, The advantage of good reliability;And, the present invention use simple geometry attribute the ratio of width to height of frame object as main matching condition, and Be aided with picture frame search option include search volume type, figure box type, figure layer title screening conditions, segment title screening conditions, The conditions such as mark filter.The present invention does not limit specific chart box type, both can be the rectangular area of straight line composition, it is also possible to be The rectangular area that polyline is constituted, it is also possible to the rectangular area that the rectangular area of figure block-type and reference are quoted.The present invention does not limit spy Determine map sheet and parameter format, the self-defined housing of standard modifying picture frame parameters and inside casing the ratio of width to height can be passed through, and define each ginsengs such as the map title Number regional extent.The present invention does not limit certain output equipment, the equipment of all output supported by operating system (include printing device, Plotting equipment or virtual unit, such as PDF printer or JPG printer), all can be supported;There is universality good, logical By property advantage strong, applied widely good, compatible.
Accompanying drawing explanation
Fig. 1 is the implementing procedure schematic diagram of the embodiment of the present invention.
Fig. 2 is the interface schematic diagram of picture frame search option in the embodiment of the present invention.
Fig. 3 is the principle schematic that in the embodiment of the present invention, a horizontal line and vertical curve determine a rectangle.
Fig. 4 is the standard picture frame schematic diagram in the embodiment of the present invention.
Fig. 5 is to read the man-machine friendship that the display output of all picture frame information preserved selects for user to user in the embodiment of the present invention Interface schematic diagram mutually.
Fig. 6 is the equipment schematic diagram specified during drawing output in the embodiment of the present invention.
Detailed description of the invention
As it is shown in figure 1, the present embodiment modifying picture frame parameters based on AutoCAD identification is as follows with the enforcement step of drawing output intent:
1) open AutoCAD and read in the file data of its drawing file to be output supporting form (such as DWG, DXF etc.).
2) the picture frame search option of user setup is obtained, as in figure 2 it is shown, picture frame search option includes search volume type, picture frame Type, figure layer title screening conditions, segment title screening conditions, the rectangular area of standard picture frame housing, standard picture frame inside casing Rectangular area, search volume type include model space block table record and two kinds of multiselect options of arrangement space block table record (for For AutoCAD, arrangement space is a type, distinguishes with different titles, model space only one of which), figure box type Including segment, with reference to quoting (i.e. outer non-economic), polyline, four kinds of figure box type multiselect options of straight line;Read in document data bank, Block table database in traversal document data bank, according to the search volume type in picture frame search option to the block in block table database Table record carries out screening and filtering.In the present embodiment, it is self-defined life by the function package of the picture frame search option of acquisition user setup Make " pz ", perform custom command " pz ", then can eject picture frame search option as shown in Figure 2 to obtain the friendship of user's input Message mutually.
Seeing Fig. 2, user, when picture frame search option, if search volume type only chooses the model space, the most only screens depanning Type space block table record;If search volume type only chooses arrangement space, the most only filter out arrangement space block table record;This reality Executing in example, the transverse axis interval of the rectangular area of standard picture frame housing is 0~420 (transverse axis minimum M inX~transverse axis maximums MaxX, lower with), Y interval be 0~297 (longitudinal axis minimum M inY~longitudinal axis maximums MaxY, lower with);Standard The X direction interval of the rectangular area of picture frame inside casing is 30~410, Y interval is 10~287.
In the present embodiment, step 2) when obtaining the picture frame search option of user setup, picture frame search option also includes standard picture frame The rectangular area of the middle map title, the rectangular area of figure number, the rectangular area of number of pages, the rectangular area of the page number;See Fig. 2, this reality Executing in example, the X direction interval of the rectangular area of the map title is 170~250, Y interval is 10~20;The rectangular area of figure number X direction interval be 390~250, Y interval be 410~20;The X direction interval of the rectangular area of number of pages be 380~ 410, Y interval is 273~279;The X direction interval of the rectangular area of the page number is 380~410, Y interval be 267~ 273.The rectangular area of the above-mentioned map title, the rectangular area of figure number, the rectangular area of number of pages, the rectangular area of the page number and standard drawing The rectangular area of frame housing, the coordinate value that the rectangular area of standard picture frame inside casing is equal all can import by specifying Parameter File, Click on " the loading modifying picture frame parameters " on right side in Fig. 2 and i.e. can read the numerical value of correspondence.
3) for by block table (BlockTableRecord) record after screening and filtering, wherein picture frame search option middle finger is obtained Object that fixed figure box type is corresponding, single line text, multline text are as pending object set Ents.See Fig. 2, as Fruit only chooses " polyline ", " block " in figure box type, the most only filters out segment in block table record, polyline two kinds of Object generates set.
4) judge whether picture frame search option specifies figure layer (Layer) title screening conditions, when specifying figure layer title screening conditions Time, the object not meeting figure layer title screening conditions in object set is deleted, only retains and meet the right of figure layer title screening conditions As.In the present embodiment, step 2) in figure layer title screening conditions include figure layer title docuterm segment value and whether use canonical Expression formula option.See Fig. 2, in the present embodiment, if the input frame of " figure layer name coupling " is filled with content, then this reality Executing example and be judged to appointment figure layer title screening conditions, if hooking upper " canonical coupling ", then represent for " figure layer name coupling " is defeated Entering the figure layer title docuterm segment value filled in frame uses the mode of regular expression to mate, and such as " * picture frame * ", representative comprises The All Layers title of " picture frame " two word can be by screening;The figure otherwise filled in the input frame for " figure layer name coupling " Layer title docuterm segment value uses common matching way.If the input frame of " figure layer name coupling " is empty, then the present embodiment is sentenced It is set to not specified figure layer title screening conditions, the most no longer screens for figure layer title, direct jump procedure 5).
5) select first object as existing object from object set Ents.
6) judge the type of existing object, the type at existing object be segment, with reference to quote time, jump procedure 7);Working as When the type of front object is polyline, jump procedure 8);When the type of existing object is straight line, filter out in object set All horizontal lines and vertical curve, if existing object is all horizontal lines in object set and in vertical curve, and by wrapping Determine the frame object of a rectangle containing existing object at an interior horizontal line, a vertical curve, then frame object is substituted and work as Front object jump procedure 8), otherwise jump procedure 10).
In the present embodiment, owing to polyline does not has name attribute, so ambiguity line style does not carry out step 7 according to title) mistake Filter, but directly jump procedure 8) carry out length-width ratio judgement process.Linear pattern is identified, basic process and figure block-type one Cause;Because single straight line cannot constitute effective picture frame border, also for reducing amount of calculation as far as possible, linear pattern picture frame needs mutually to hang down A straight horizontal line and a vertical curve determine picture frame border.A piece horizontal line, a vertical curve determine the picture frame of a rectangle Object includes four kinds of situations shown in Fig. 3.Shown in Fig. 3, situation 1 is that HL (horizontal line) constitutes the base of square boundary, VL (erects Straight line) constitute square boundary the right;Situation 2 is that HL (horizontal line) constitutes the base of square boundary, VL (vertical curve) Constitute the left side of square boundary;Situation 3 is that HL (horizontal line) constitutes the top margin of square boundary, VL (vertical curve) constitutes square The right on shape border;Situation 4 is that HL (horizontal line) constitutes the top margin of square boundary, VL (vertical curve) constitutes square boundary The left side.Obtain horizontal line in the present embodiment, vertical curve determines that the process of frame object of a rectangle is as follows: sieve Select all of horizontal line HLs in Ents set;Each horizontal line HL in gathering HLs, sieves from Ents gathers Select with HL with at a space and the vertical curve set VLs of HL end points altogether;Straight line VL with HL every in VLs is entered Row group is right, if HL Yu VL meets step with a kind of this square boundary of adjacent edge being constituted square boundary in shown in Fig. 3 four kinds of situations Rapid 8) the ratio of width to height required by, then it is assumed that HL (horizontal line) and VL (vertical curve) determines the frame object of a rectangle, And for the picture frame information of table (1), Handle1 is set to the handle of HL, Handle2 is set to the handle of VL, TkType=0.
7) judge whether picture frame search option specifies segment title screening conditions, when specifying segment title screening conditions, if worked as The title of front object does not meets segment title screening conditions, then filter existing object jump procedure 10);Otherwise jump procedure 8).
In the present embodiment, step 2) in segment title screening conditions include the segment title search field of supporting regular expression Value.As " .+ " represents that non-empty name is satisfied by screening conditions.If matched character string is " .* picture frame .* | .* [Tt] .* [Kk] .* ", represent Only to title comprises " picture frame " or comprise simultaneously letter " T " that big (little) write, " K " block name by screening.
8) obtaining the external boundary angle point of existing object Region, external boundary angle point includes lower-left angle point J1 and upper right angle point J2, meter Calculate lower-left angle point and the ratio of width to height R of upper right corner point formation coordinates regional, calculate the ratio of width to height PW of standard picture frame housing, mark simultaneously The ratio of width to height PN of quasi-picture frame inside casing;Judge whether the ratio of width to height R of lower-left angle point J1 and upper right angle point J2 formation coordinates regional meets Any one in formula (1)~(4);If meeting formula (1), then judge that external boundary angle point is as meeting the housing border required Angle point, arranging the anglec of rotation (in the present embodiment, anglec of rotation direction is for rotating counterclockwise) is 0 ° (Angle=0 °), figure Shown in frame scaling such as formula (5);If meeting formula (2), then judge the external boundary angle point housing border angle point as satisfied requirement, Arranging the anglec of rotation is shown in 90 ° (Angle=90 °), picture frame scaling such as formula (6);If meeting formula (3), then Judging the external boundary angle point inner frame boundary angle point as satisfied requirement, arranging the anglec of rotation is 0 ° (Angle=0 °), picture frame scaling Shown in ratio such as formula (7), and update shown in lower left corner point coordinates such as formula (9) and shown in upper right corner point coordinates such as formula (10); If meeting formula (4), then judging the external boundary angle point inner frame boundary angle point as satisfied requirement, arranging the anglec of rotation is 90 ° Shown in (Angle=90 °), picture frame scaling such as formula (8), and update shown in lower left corner point coordinates such as formula (11) and upper right Shown in angular coordinate such as formula (12);Judge that lower-left angle point and upper right corner point form the ratio of width to height R of coordinates regional Region the most completely Toe provisioning request, if met, jump procedure 9), otherwise jump procedure 10);
| R - P W | R ≤ E - - - ( 1 )
| R - 1 P W | R ≤ E - - - ( 2 )
| R - P N | R ≤ E - - - ( 3 )
| R - 1 P N | R ≤ E - - - ( 4 )
In formula (1)~(4), R represents that lower-left angle point and upper right corner point form the ratio of width to height of coordinates regional, and PW represents standard The ratio of width to height of picture frame housing, PN represents the ratio of width to height of standard picture frame inside casing, and E represents default allowable error value;The present embodiment In, the allowable error value preset is E=0.00001.
S c a l e = | J 2. X - J 1. X | | W K 2. X - W K 1. X | - - - ( 5 )
S c a l e = | J 2. X - J 1. X | | W K 2. Y - W K 1. Y | - - - ( 6 )
S c a l e = | J 2. X - J 1. X | | N K 2. X - N K 1. X | - - - ( 7 )
S c a l e = | J 2. X - J 1. X | | N K 2. Y - N K 1. Y | - - - ( 8 )
J 1. X = J 1. X - S c a l e × H 1 J 1. Y = J 1. Y - S c a l e × V 1 - - - ( 9 )
J 2. X = J 2. X + S c a l e × H 2 J 2. Y = J 2. Y + S c a l e × V 2 - - - ( 10 )
J 1. X = J 1. X - S c a l e × V 2 J 1. Y = J 1. Y - S c a l e × H 1 - - - ( 11 )
J 2. X = J 2. X + S c a l e × V 1 J 2. Y = J 2. Y + S c a l e × H 2 - - - ( 12 )
In formula (5)~(12), Scale represents picture frame scaling;J1.X represents the X-coordinate of lower-left angle point J1, J1.Y Represent the Y coordinate of lower-left angle point J1;J2.X represents the X-coordinate of upper right angle point J2, and J2.Y represents the Y of upper right angle point J2 Coordinate;NK1.X represents the X-coordinate of standard picture frame inside casing lower-left angle point NK1, and NK1.Y represents the standard picture frame inside casing lower left corner The Y coordinate of some NK1;NK2.X represents the X-coordinate of standard picture frame inside casing upper right angle point NK2, and NK2.Y represents standard drawing The Y coordinate of frame inside casing upper right angle point NK2;WK1.X represents the X-coordinate of standard picture frame housing lower-left angle point WK1, WK1.Y The Y coordinate of expression standard picture frame housing lower-left angle point WK1;WK2.X represents the X of standard picture frame housing upper right angle point WK2 Coordinate, WK2.Y represents the Y coordinate of standard picture frame housing upper right angle point WK2;In formula (9)~(12) about H1, H2, V1, V2 definition sees Fig. 4, H1 and represents horizontal range between the left side of the left side of inside casing of standard picture frame, housing, and it is expressed Formula is H1=| NK1.X-WK1.X |;H2 represents horizontal range between the right of the right of the inside casing of standard picture frame, housing, Its expression formula is H2=| WK2.X-NK2.X |;V1 represents between the base of the base of the inside casing of standard picture frame, housing vertically Distance, its expression formula is V1=| NK1.Y-WK1.Y |;V2 represents between the top margin of the top margin of the inside casing of standard picture frame, housing Vertically distance, its expression formula is V2=| WK2.Y-NK2.Y |.
In the present embodiment, the expression formula of the ratio of width to height calculating lower-left angle point and upper right corner point formation coordinates regional is:
R = | J 2. Y - J 1. Y | | J 2. X - J 1. X |
Wherein, R represents that lower-left angle point and upper right corner point form the ratio of width to height of coordinates regional, and J1.X represents the X of lower-left angle point J1 Coordinate, J1.Y represents the Y coordinate of lower-left angle point J1;J2.X represents the X-coordinate of upper right angle point J2, and J2.Y represents the upper right corner The Y coordinate of some J2.
The standard picture frame seeing Fig. 4 understands, and the ratio of width to height PW of standard picture frame housing is:
P W = | W K 2. Y - W K 1. Y | | W K 2. X - W K 1. X | .
Wherein, WK1.X represents the X-coordinate of standard picture frame housing lower-left angle point WK1, and WK1.Y represents that standard picture frame housing is left The Y coordinate of lower angle point WK1;WK2.X represents the X-coordinate of standard picture frame housing upper right angle point WK2, and WK2.Y represents mark The Y coordinate of quasi-picture frame housing upper right angle point WK2.
The standard picture frame seeing Fig. 4 understands, and the ratio of width to height PN of standard picture frame inside casing is:
P N = | N K 2. Y - N K 1. Y | | N K 2. X - N K 1. X |
Wherein, NK1.X represents the X-coordinate of standard picture frame inside casing lower-left angle point NK1, and NK1.Y represents that standard picture frame inside casing is left The Y coordinate of lower angle point NK1;NK2.X represents the X-coordinate of standard picture frame inside casing upper right angle point NK2, and NK2.Y represents mark The Y coordinate of quasi-picture frame inside casing upper right angle point NK2.
9) by picture frame information corresponding for existing object and the picture frame information contrast preserved, picture frame information as corresponding in existing object is still Not preserving, then preserve the picture frame information that existing object is corresponding, picture frame information is concrete as shown in table (1), comprises existing object The information such as lower-left angle point and the coordinate of upper right angle point, picture frame scaling, the anglec of rotation.By current picture frame information in the present embodiment During with the picture frame information contrast preserved, the content of contrast includes: graphic file name, block table record name, picture frame lower-left angle point are sat Mark, picture frame upper right corner point coordinates, if above four parameters of two picture frames are identical, then it is assumed that two picture frames are expressed identical.
In the present embodiment, shown in the structure of picture frame information such as table (1).
Table (1): picture frame message structure table.
See table (1) to understand, when preserving the picture frame information of existing object, have different preservation sides respectively for different figure box types Formula, if figure box type is straight line, then TkType value is 0;If figure box type is polyline, then TkType value is 1; If figure box type is segment, then TkType value is 2;If figure box type is for reference to quoting, then TkType value is 3.
In the present embodiment, when preserving the picture frame information of existing object, first according to the rectangular area of the map title, the rectangular area of figure number, The rectangular area of number of pages, the rectangular area of the page number, obtain a left side for above-mentioned four kinds of rectangular areas respectively according to the frame object anglec of rotation Lower angle point and upper right angle point, if the anglec of rotation is 0 °, then update a left side for every kind of rectangular area according to formula (13) and (14) Lower angle point and upper right angle point;If the anglec of rotation is 90 °, then update a left side for every kind of rectangular area according to formula (15) and (16) Lower angle point and upper right angle point;Identify single file or the multline text being positioned at above-mentioned four kinds of rectangular areas in drawing file to be output successively Word in object, obtains the map title of existing object, figure number, number of pages, the page number, by the non-digital content mistake in number of pages, the page number Integer is converted to after filter;The map title, figure number, number of pages, the page number are stored in the picture frame information of existing object;
T J 1. X = J 1. X + ( T 1. X - W K 1. X ) × S c a l e T J 1. Y = J 1. Y + ( T 1. Y - W K 1. Y ) × S c a l e - - - ( 13 )
T J 2. X = J 1. X + ( T 2. X - W K 1. X ) × S c a l e T J 2. Y = J 1. Y + ( T 2. Y - W K 1. Y ) × S c a l e - - - ( 14 )
{ T J 1. X = J 1. X - ( T 1. Y - W K 1. Y ) × S c a l e T J 1. Y = J 1. Y + ( T 1. X - W K 1. X ) × S c a l e - - - ( 15 )
T J 2. X = J 1. X - ( T 2. Y - W K 1. Y ) × S c a l e T J 2. Y = J 1. Y + ( T 2. X - W K 1. X ) × S c a l e - - - ( 16 )
In formula (13)~(16), TJ1.X represents the X-coordinate after the angle point renewal of lower-left, rectangular area, and TJ1.Y represents rectangle Y coordinate after the angle point renewal of lower-left, region;TJ2.X represents the X-coordinate after the upper right angle point renewal of rectangular area, and TJ2.Y represents Y coordinate after the upper right angle point renewal of rectangular area;T1.X represents the X-coordinate before the angle point renewal of lower-left, rectangular area, T1.Y table Show the Y coordinate before the angle point renewal of lower-left, rectangular area;T2.X represents the X-coordinate before the upper right angle point renewal of rectangular area, T2.Y Represent the Y coordinate before the upper right angle point renewal of rectangular area;J1.X represents the X-coordinate of the picture frame lower-left angle point that existing object is corresponding, J1.Y represents the Y coordinate of the picture frame lower-left angle point that existing object is corresponding;Scale represents picture frame scaling.
As a example by the rectangular area of the map title, the present embodiment is when preserving picture frame information, according to standard picture frame parameter point TM1, TM2, It is converted to actual map title border angle point TMJ1, TMJ2.
If Angle=0 °,
TMJ1.X=J1.X+ (TM1.X-WK1.X) × Scale, TMJ1.Y=J1.Y+ (TM1.Y-WK1.Y) × Scale
TMJ2.X=J1.X+ (TM2.X-WK1.X) × Scale, TMJ2.Y=J1.Y+ (TM2.Y-WK1.Y) × Scale
If Angle=90 °,
TMJ1.X=J1.X-(TM1.Y-WK1.Y) × Scale, TMJ1.Y=J1.Y+ (TM1.X-WK1.X) × Scale
TMJ2.X=J1.X-(TM2.Y-WK1.Y) × Scale, TMJ2.Y=J1.Y+ (TM2.X-WK1.X) × Scale
Filter out and all in object set Ents be positioned at the single line text object of the same space, multline text pair with current frame object As Texts;In Texts, find border be positioned at the object TEXT of intersection point TMJ1, TMJ2 composition region (or on it); The word content of text object TEXT, is the map title of identification, is assigned to TM.Due to figure number, number of pages, three kinds of rectangles of the page number Region is identical with the processing method of the rectangular area of the map title, therefore does not repeats them here.Also need to page after obtaining number of pages, the page number Number, the page number carry out filtration and round, and filter out nonnumeric character.Further, it is also possible to preserve the figure of more existing object as required Frame information, is extended the picture frame message structure table of table (1) when processing, and more if desired for extraction in being actually needed Parameter, can be defined in standard modifying picture frame parameters, acquisition process is similar to.
10) judge whether existing object is last object in object set, if it is terminate to process and jump procedure 11), From object set, otherwise select next untreated object as existing object, jump procedure 6).
11) first reading all picture frame information preserved, display output selects for user to user, then user is selected Picture frame information is as picture frame information list to be output.
The picture frame information to be output that user is selected by the present embodiment is stored in variable TKs, arranges using variable TKs as picture frame information Table carries out follow-up process.In engineering practice, generally require the picture frame information included in variable TKs is carried out certain whole Reason and sequence, in order to when output, can directly carry out drawing is checked, prevent drawing from exporting in the way of unordered.General feelings Under condition, the first sort criteria is to arrange by figure number TM ascending order, and the second sort criteria arranges by with page number YM ascending order.
The present embodiment step 11) in reading preserved picture frame information and show output to user for user select time, to all picture frames Information shows after being ranked up as the second sort criteria using figure number TM as the first sort criteria, page number YM that output is to user; Wherein, the first sort criteria and the second sort criteria are ascending order arrangement.
As it is shown in figure 5, in the human-computer interaction interface of the present embodiment output picture frame information list, multiple opening can be exported successively Autocad file, for each autocad file, output picture frame information list include respectively figure number, the map title, the page number, Number of pages four column information, can also be arranged as required to show that more picture frame information is so that user checks in addition.
12) call the output CSS of AutoCAD, according to pre-defined value automatically specify in AutoCAD output equipment, Map format and output pattern, send output order by AutoCAD to the equipment specified, and described output order includes the most defeated Go out graphic file title FileName of picture frame information, pattern space title BlockTableName, a graphic limit Region (left side The coordinate of lower angle point J1 and upper right angle point J2 is expressed), picture frame scaling Scale, anglec of rotation Angle, map format, defeated Go out pattern.
In the present embodiment, for ensureing the attractive in appearance of map sheet, the map format of selection must be with the ratio of width to height PW of standard modifying picture frame parameters definition Unanimously.This is also the unique conditional of output map format, therefore can be by controlling PW value, it is achieved standard-sized with existing Coupling, such as A3, A2 map sheet, it is also possible to equipment is configured, the self-defined map format needing definition, nonstandard to adapt to Object staff cun or the output of non-common standard-sized drawing.Step 12) send output order by AutoCAD to the equipment specified Time, if the equipment specified is virtual unit, then in the equipment transmission output order specified, specify virtual setting by AutoCAD The standby title automatically generating file comprises current the output map title of picture frame information, figure number, page number information.In the present embodiment, logical Cross AutoCAD to the equipment specified send the title specifying virtual unit to automatically generate file in output order be specially " figure number _ The map title _ page number. suffix " form.
13) by the described equipment specified, drawing region corresponding for each picture frame information in picture frame information list to be output is exported.
The present embodiment is encapsulated as custom command " dy " in the application, performs custom command " dy " and can call the present embodiment Perform step 1)~step 10) complete autocad file and carry out the process of modifying picture frame parameters identification according to standard modifying picture frame parameters, hold Row step 11)~step 13) complete to have already turned on and be complete modifying picture frame parameters identification autocad file defeated according to drawing Go out parameter and carry out the process of drawing output, and multiple file can disposable batch signatures.The present embodiment passes through specified value picture frame Housing parameter lower left corner coordinate points (WK1) and upper right corner coordinate points (WK2), inside casing are NK1 and NK2, the map title is TM1 Yu TM2, figure number are that TH1 is YS1 with TH2, number of pages and YS2, the page number are YM1 and YM2, and these are sat Mark is converted into the relative coordinate with WK1 as initial point.Standard picture frame housing parameter lower-left and the width of upper right angle point and highly ratio As the pressure type matching value of picture frame identification, the ratio of width to height (or depth-width ratio) on all types picture frame display border needs the least Error range in, compare with housing parameter the ratio of width to height, meet comparison requirement and figure layer, picture frame that the screening of block name requires Will be identified that effective picture frame;The present embodiment is equally useful the ratio of width to height of inside casing parameter lower-left and upper right angle point and compares, The successful picture frame of comparison, by the relativeness of housing parameter with inside casing parameter, converts;The present embodiment can define the map title, Figure number, number of pages, the border angle point of the page number, it is also possible to define other parameters, as the time, design, check, the border of examination etc. Angle point, in order to search for relevant parameter information in effective picture frame scope identification.With prior art by block name, figure layer name, color etc. Parameter determines unlike frame object, the present invention using rectangle frame the ratio of width to height mate as main control parameters, be aided with block name, The conditions such as figure layer, space filter.The ratio of width to height, as simple geometrical property, does not has other attributes, makes the present invention have spirit Activity, versatility, the advantage of accuracy.As a example by common engineering drawing map sheet A3, its ratio of width to height isIt it is one Irrational number, just has non-frame object the ratio of width to height to be in drawingPossibility the least, therefore can with the ratio of width to height as master The matching condition wanted, then assisted by other filter conditions, can filter further.For other standards or non-standard Map format, defined by standard modifying picture frame parameters, as long as drawing output equipment can match, all can be entered by the present invention Row picture frame information search and drawing output.
See Fig. 6, output equipment can select as required printing device, plotting equipment and virtual unit (as PDF output, JPG output, PNG output etc.).Search Filter Options that the present embodiment encapsulates according to custom command " pz " and standard drawing Single or multiple files are identified by frame parameter automatically, it is also possible to manually select in the figure opened by AutoCAD One or more picture frames, scan for picture frame, screen and mate.For meeting screening conditions, the ratio of width to height (or depth-width ratio) The picture frame of the housing or inside casing parameter the ratio of width to height of confining justice equal to standard drawing in little error range will be identified that effective picture frame, and This picture frame place filename, space, place name (model space or certain arrangement space), lower left corner point coordinates, bottom right angle point are sat Mark, figure box type (straight line, polyline, segment, with reference to quoting), (linear pattern corresponds to constitute rectangle phase frame object handle Two orthogonal straight lines handles of adjacent side, ambiguity line style be this polyline handle, figure block-type be this picture frame handle, with reference to quoting behavior This is with reference to handle) it is saved in database.Under conditions of effective picture frame is identified and screens, the present embodiment can be according to mark Quasi-modifying picture frame parameters, is identified information such as figure number, the map title, number of pages, the page numbers further, and is saved in the lump with corresponding picture frame In database.The present embodiment can select output equipment, map format, output pattern, the anglec of rotation, the figure obtaining identification Frame carries out batch or single output.The present embodiment can not limit certain output equipment, so it is empty to be installed to operating system ground That intend or real output equipment all can make output equipment;The present embodiment can not limit certain or some map format, both Can export for typical standard map sheets such as A0, A1, A2, A3, A4, can be with self-defined map format, this map sheet chi Very little have only to the ratio of width to height with standard modifying picture frame parameters housing the ratio of width to height in little error range equal;The present embodiment can not limit Output pattern, the pattern of any AutoCAD definition, all can be supported;The present embodiment can pass through picture frame the ratio of width to height or height Wide ratio and outer (interior) frame the ratio of width to height equal automatic decision page layout in little error range, such as picture frame the ratio of width to height and outer (interior) Frame the ratio of width to height is equal in little error range, then the output anglec of rotation is 0 °, as picture frame depth-width ratio exists with outer (interior) frame the ratio of width to height In little error range equal, then output the anglec of rotation be 90 °.In sum, the present embodiment can be directed to not limit figure box form (directly Line style picture frame, ambiguity line style picture frame, figure block-type picture frame, with reference to quoting type picture frame), do not limit form (text formatting, layout, line Wide), do not limit space (the AutoCAD model space, arrangement space), do not limit output equipment (both can be virtual unit, as PDF, JPG printer, it is also possible to be various printing plotting equipments), do not limit file format (AutoCAD support file format All can) universality modifying picture frame parameters identification and drawing export.
The above is only the preferred embodiment of the present invention, and protection scope of the present invention is not limited merely to above-described embodiment, all The technical scheme belonged under thinking of the present invention belongs to protection scope of the present invention.It should be pointed out that, for the art is common For technical staff, some improvements and modifications without departing from the principles of the present invention, these improvements and modifications also should be regarded as this The protection domain of invention.

Claims (6)

1. a modifying picture frame parameters identification based on AutoCAD and drawing output intent, it is characterised in that implement step as follows:
1) open AutoCAD and read in the file data of its drawing file to be output supporting form;
2) obtaining the picture frame search option of user setup, described picture frame search option includes search volume type, figure box type, figure Layer title screening conditions, segment title screening conditions, the rectangular area of standard picture frame housing, the rectangular area of standard picture frame inside casing, Described search volume type includes model space block table record and two kinds of multiselect options of arrangement space block table record, described figure box type Including segment, with reference to quoting, polyline, four kinds of figure box type multiselect options of straight line;Read in document data bank, travel through number of files According to the block table database in storehouse, according to the search volume type in described picture frame search option to the block table record in block table database Carry out screening and filtering;
3) for by the block table record after screening and filtering, the figure box type specified in wherein said picture frame search option is obtained corresponding Object, single line text, multline text is as pending object set;
4) described picture frame search option whether appointment figure layer title screening conditions are judged, when specifying figure layer title screening conditions, will The object not meeting figure layer title screening conditions in described object set is deleted, and only retains the object meeting figure layer title screening conditions;
5) select first object as existing object from described object set;
6) judge the type of existing object, the type at existing object be segment, with reference to quote time, jump procedure 7);Working as When the type of front object is polyline, jump procedure 8);When the type of existing object is straight line, filter out in object set All horizontal lines and vertical curve, if existing object is all horizontal lines in object set and in vertical curve, and by wrapping Containing existing object at an interior horizontal line, the adjacent edge of vertical curve one rectangle of composition, then using described rectangle as currently Picture frame that object is corresponding jump procedure 8);Otherwise jump procedure 10);
7) judge whether described picture frame search option specifies segment title screening conditions, when specifying segment title screening conditions, as Really the title of existing object does not meets segment title screening conditions, then filter existing object jump procedure 10);Otherwise redirect step Rapid 8);
8) obtaining the external boundary angle point of picture frame corresponding to existing object, described external boundary angle point includes lower-left angle point and upper right angle point, Calculate lower-left angle point and the ratio of width to height of upper right corner point formation coordinates regional, calculate the ratio of width to height of standard picture frame housing, standard drawing simultaneously The ratio of width to height of frame inside casing;Judge whether the ratio of width to height of described lower-left angle point and upper right corner point formation coordinates regional meets formula (1)~(4) In any one;If meeting formula (1), then judge that described external boundary angle point, as meeting the housing border angle point required, is arranged The anglec of rotation is 0 °, shown in picture frame scaling such as formula (5);If meeting formula (2), then judge described external boundary angle point as Meet the housing border angle point required, arrange the anglec of rotation be 90 °, shown in picture frame scaling such as formula (6);If met Formula (3), then judge the described external boundary angle point inner frame boundary angle point as satisfied requirement, and arranging the anglec of rotation is 0 °, picture frame contracting Put shown in ratio such as formula (7), and update shown in lower left corner point coordinates such as formula (9) and shown in upper right corner point coordinates such as formula (10); If meeting formula (4), then judge described external boundary angle point as meeting the inner frame boundary angle point required, arrange the anglec of rotation be 90 °, Shown in picture frame scaling such as formula (8), and update shown in lower left corner point coordinates such as formula (11) and upper right corner point coordinates such as formula (12) Shown in;Judging that lower-left angle point and upper right corner point form the ratio of width to height the most satisfied appointment requirement of coordinates regional, if met, redirecting Step 9), otherwise jump procedure 10);
| R - P W | R ≤ E - - - ( 1 )
| R - 1 P W | R ≤ E - - - ( 2 )
| R - P N | R ≤ E - - - ( 3 )
| R - 1 P N | R ≤ E - - - ( 4 )
In formula (1)~(4), R represents that lower-left angle point and upper right corner point form the ratio of width to height of coordinates regional, and PW represents standard The ratio of width to height of picture frame housing, PN represents the ratio of width to height of standard picture frame inside casing, and E represents default allowable error value;
The calculation expression of the ratio of width to height R calculating lower-left angle point and upper right corner point formation coordinates regional is:
R = | J 2. Y - J 1. Y | | J 2. X - J 1. X |
In above formula, R represents that lower-left angle point and upper right corner point form the ratio of width to height of coordinates regional, and J1.X represents the X of lower-left angle point J1 Coordinate, J1.Y represents the Y coordinate of lower-left angle point J1;J2.X represents the X-coordinate of upper right angle point J2, and J2.Y represents the upper right corner The Y coordinate of some J2;
The calculation expression of the ratio of width to height PW of standard picture frame housing is:
P W = | W K 2. Y - W K 1. Y | | W K 2. X - W K 1. X | ;
In above formula, PW represents the ratio of width to height of standard picture frame housing, and WK1.X represents standard picture frame housing lower-left angle point WK1's X-coordinate, WK1.Y represents the Y coordinate of standard picture frame housing lower-left angle point WK1;WK2.X represents standard picture frame housing upper right The X-coordinate of angle point WK2, WK2.Y represents the Y coordinate of standard picture frame housing upper right angle point WK2;
The calculation expression of the ratio of width to height PN of standard picture frame inside casing is:
P N = | N K 2. Y - N K 1. Y | | N K 2. X - N K 1. X |
In above formula, PN represents the ratio of width to height of standard picture frame inside casing, and NK1.X represents the X of standard picture frame inside casing lower-left angle point NK1 Coordinate, NK1.Y represents the Y coordinate of standard picture frame inside casing lower-left angle point NK1;NK2.X represents the standard picture frame inside casing upper right corner The X-coordinate of some NK2, NK2.Y represents the Y coordinate of standard picture frame inside casing upper right angle point NK2;
S c a l e = | J 2. X - J 1. X | | W K 2. X - W K 1. X | - - - ( 5 )
S c a l e = | J 2. X - J 1. X | | W K 2. Y - W K 1. Y | - - - ( 6 )
S c a l e = | J 2. X - J 1. X | | N K 2. X - N K 1. X | - - - ( 7 )
S c a l e = | J 2. X - J 1. X | | N K 2. Y - N K 1. Y | - - - ( 8 )
J 1. X = J 1. X - S c a l e × H 1 J 1. Y = J 1. Y - S c a l e × V 1 - - - ( 9 )
J 2. X = J 2. X + S c a l e × H 2 J 2. Y = J 2. Y + S c a l e × V 2 - - - ( 10 )
J 1. X = J 1. X - S c a l e × V 2 J 1. Y = J 1. Y - S c a l e × H 1 - - - ( 11 )
J 2. X = J 2. X + S c a l e × V 1 J 2. Y = J 2. Y + S c a l e × H 2 - - - ( 12 )
In formula (5)~(12), Scale represents picture frame scaling;J1.X represents the X-coordinate of lower-left angle point, J1.Y table Show the Y coordinate of lower-left angle point;J2.X represents the X-coordinate of upper right angle point, and J2.Y represents the Y coordinate of upper right angle point;NK1.X The X-coordinate of expression standard picture frame inside casing lower-left angle point, NK1.Y represents the Y coordinate of standard picture frame inside casing lower-left angle point;NK2.X The X-coordinate of expression standard picture frame inside casing upper right angle point, NK2.Y represents the Y coordinate of standard picture frame inside casing upper right angle point;WK1.X The X-coordinate of expression standard picture frame housing lower-left angle point, WK1.Y represents the Y coordinate of standard picture frame housing lower-left angle point;WK2.X The X-coordinate of expression standard picture frame housing upper right angle point, WK2.Y represents the Y coordinate of standard picture frame housing upper right angle point;H1 table The left side of inside casing of the quasi-picture frame of indicating, housing the left side between horizontal range, its expression formula is H1=| NK1.X-WK1.X |; H2 represents horizontal range between the right of the right of the inside casing of standard picture frame, housing, and its expression formula is H2=| WK2.X-NK2.X |;V1 represents between the base of the base of the inside casing of standard picture frame, housing vertically distance, its table Reaching formula is V1=| NK1.Y-WK1.Y |;V2 represents between the top margin of the top margin of the inside casing of standard picture frame, housing vertically distance, Its expression formula is V2=| WK2.Y-NK2.Y |;
9) by picture frame information corresponding for existing object and the picture frame information contrast preserved, picture frame information as corresponding in existing object is still Not preserving, then preserve the picture frame information that existing object is corresponding, described picture frame information comprises lower-left angle point and the upper right of existing object The coordinate of angle point, picture frame scaling, the anglec of rotation;
10) judge whether existing object is last object in object set, if it is terminate to process and jump procedure 11), From described object set, otherwise select next untreated object as existing object, jump procedure 6);
11) first reading all picture frame information preserved, display output selects for user to user, then user is selected Picture frame information is as picture frame information list to be output;
12) call the output CSS of AutoCAD, according to pre-defined value automatically specify in AutoCAD output equipment, Map format and output pattern, send output order by AutoCAD to the equipment specified, and described output order includes the most defeated Go out the graphic file title of picture frame information, pattern space title, graphic limit, picture frame scaling, the anglec of rotation, map sheet chi Very little, output pattern;
13) by the described equipment specified, drawing region corresponding for each picture frame information in picture frame information list to be output is exported.
Modifying picture frame parameters identification based on AutoCAD the most according to claim 1 and drawing output intent, it is characterised in that: Described step 2) obtain user setup picture frame search option time, described picture frame search option also includes the map title in standard picture frame Rectangular area, the rectangular area of figure number, the rectangular area of number of pages, the rectangular area of the page number;Described step 9) preserve the most right During as corresponding picture frame information, first according to the rectangular area of the described map title, the rectangular area of figure number, the rectangular area of number of pages, The rectangular area of the page number, obtains lower-left angle point and the upper right angle point of above-mentioned four kinds of rectangular areas respectively according to the frame object anglec of rotation, If the anglec of rotation is 0 °, then update lower-left angle point and the upper right angle point of every kind of rectangular area according to formula (13) and (14); If the anglec of rotation is 90 °, then update lower-left angle point and the upper right angle point of every kind of rectangular area according to formula (15) and (16); Identify the word being positioned in drawing file to be output in the single file of above-mentioned four kinds of rectangular areas or multline text object successively, obtain The map title of existing object, figure number, number of pages, the page number, be converted to integer after being filtered by the non-digital content in described number of pages, the page number; The map title, figure number, number of pages, the page number are stored in the picture frame information of existing object;Described step 11) in read and show institute insighted When other picture frame information selects for user, all picture frame information are using figure number as the first sort criteria, the page number as the second sequence bar Part shows after being ranked up that output is to user;
T J 1. X = J 1. X + ( T 1. X - W K 1. X ) × S c a l e T J 1. Y = J 1. Y + ( T 1. Y - W K 1. Y ) × S c a l e - - - ( 13 )
T J 2. X = J 1. X + ( T 2. X - W K 1. X ) × S c a l e T J 2. Y = J 1. Y + ( T 2. Y - W K 1. Y ) × S c a l e - - - ( 14 )
T J 1. X = J 1. X - ( T 1. Y - W K 1. Y ) × S c a l e T J 1. Y = J 1. Y + ( T 1. X - W K 1. X ) × S c a l e - - - ( 15 )
T J 2. X = J 1. X - ( T 2. Y - W K 1. Y ) × S c a l e T J 2. Y = J 1. Y + ( T 2. X - W K 1. X ) × S c a l e - - - ( 16 )
In formula (13)~(16), TJ1.X represents the X-coordinate after the angle point renewal of lower-left, described rectangular area, and TJ1.Y represents Y coordinate after the angle point renewal of lower-left, described rectangular area;TJ2.X represents the X-coordinate after the upper right angle point renewal of described rectangular area, TJ2.Y represents the Y coordinate after the upper right angle point renewal of described rectangular area;Before T1.X represents that lower-left, described rectangular area angle point updates X-coordinate, T1.Y represent lower-left, described rectangular area angle point update before Y coordinate;T2.X represents described rectangular area upper right X-coordinate before angle point renewal, T2.Y represents the Y coordinate before the upper right angle point renewal of described rectangular area;J1.X represents the most right As the X-coordinate of corresponding picture frame lower-left angle point, J1.Y represents the Y coordinate of the picture frame lower-left angle point that existing object is corresponding;Scale table Diagram frame scaling.
Modifying picture frame parameters identification based on AutoCAD the most according to claim 2 and drawing output intent, it is characterised in that: First sort criteria and the second sort criteria are ascending order arrangement.
Modifying picture frame parameters identification based on AutoCAD the most according to claim 3 and drawing output intent, it is characterised in that: Described step 12) by AutoCAD when the equipment specified sends output order, if the equipment specified is virtual unit, Then automatically generated by AutoCAD appointment virtual unit in the equipment transmission output order specified the title of file comprises and work as The map title of front output picture frame information, figure number, page number information.
Modifying picture frame parameters identification based on AutoCAD the most according to claim 4 and drawing output intent, it is characterised in that: Described step 2) in figure layer title screening conditions include figure layer title docuterm segment value and whether use regular expression option.
Modifying picture frame parameters identification based on AutoCAD the most according to claim 5 and drawing output intent, it is characterised in that: Described step 2) in segment title screening conditions include support regular expression segment title docuterm segment value.
CN201410059672.XA 2014-02-21 2014-02-21 A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent Active CN103793145B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410059672.XA CN103793145B (en) 2014-02-21 2014-02-21 A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410059672.XA CN103793145B (en) 2014-02-21 2014-02-21 A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent

Publications (2)

Publication Number Publication Date
CN103793145A CN103793145A (en) 2014-05-14
CN103793145B true CN103793145B (en) 2016-09-07

Family

ID=50668885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410059672.XA Active CN103793145B (en) 2014-02-21 2014-02-21 A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent

Country Status (1)

Country Link
CN (1) CN103793145B (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298991B (en) * 2014-10-09 2017-08-25 中国石油集团工程设计有限责任公司 A kind of angle stamp information extracting method
CN106021718A (en) * 2016-05-19 2016-10-12 重庆阿泰可科技股份有限公司 Drawing method and device used for engineering drawing in CATIA (Computer-graphics Aided Three-dimensional Interactive Application)
CN106528946B (en) * 2016-10-18 2019-06-25 天津理工大学 A kind of method of batch insertion AutoCAD segment
CN106934839B (en) * 2017-02-16 2020-09-15 广州杰赛科技股份有限公司 Automatic cutting method and device for CAD vector diagram
CN107220443A (en) * 2017-06-01 2017-09-29 武汉凌云建筑装饰工程有限公司 A kind of BIM drawings Output of forms
CN107993181A (en) * 2017-10-30 2018-05-04 广州明珞汽车装备有限公司 The faster statistical approach of AutoCAD parameter blocks
CN107908843B (en) * 2017-11-07 2022-05-27 杭州格原信息技术有限公司 Management system based on drawing of map label information
CN108549775B (en) * 2018-04-17 2021-10-12 河南省交通规划设计研究院股份有限公司 Method for intelligently generating length parameters of door frame walls in civil air defense structure detailed diagrams in batches
CN109190157B (en) * 2018-07-26 2023-05-23 中国核电工程有限公司 Refreshing method for object position information of Autodesk AutoCAD P & ID
CN109255041B (en) * 2018-08-22 2021-07-09 国网山西省电力公司 Intelligent identification method for electrical drawing
CN109711458A (en) * 2018-12-24 2019-05-03 深圳市毕美科技有限公司 A kind of drawing classification management method and device
CN111797838A (en) * 2019-04-08 2020-10-20 上海怀若智能科技有限公司 Blind denoising system, method and device for picture documents
CN110084179B (en) * 2019-04-24 2021-07-23 上海外高桥造船有限公司 Frame identification method and system
CN110119256A (en) * 2019-04-26 2019-08-13 无锡蓝信自动化工程有限公司 A method of rapid batch is printed as Analysis of Nested Design drawing in electronic control
CN110096270A (en) * 2019-05-06 2019-08-06 浙江精工钢结构集团有限公司 A kind of design drawing method for splitting and system based on .NET plug-in unit
CN110244920B (en) * 2019-06-18 2022-11-01 中铁工程装备集团有限公司 CAD file batch printing equipment with intelligent cutting function and method
CN110909602A (en) * 2019-10-21 2020-03-24 广联达科技股份有限公司 Two-dimensional vector diagram sub-domain identification method and device
CN111414701B (en) * 2020-03-26 2023-07-07 广西防城港核电有限公司 Method for extracting CAD file elements and converting relative coordinates
CN111611945A (en) * 2020-05-25 2020-09-01 江西金格科技股份有限公司 Universal AutoCAD picture frame identification method
CN112215211B (en) * 2020-12-01 2021-03-12 南京华苏科技有限公司 Method for extracting chamber branch link topological relation based on CAD drawing data
CN112883446B (en) * 2021-03-23 2023-07-07 广东电网有限责任公司 Set-up diagram screening method, device, equipment and storage medium
CN113051885B (en) * 2021-04-08 2022-06-21 上海市城市建设设计研究总院(集团)有限公司 AutoCAD-based design drawing rapid typesetting method
CN113641435B (en) * 2021-08-11 2023-08-18 深圳市维辰思科技有限公司 Multichannel graphic output device based on computer control
CN114020221A (en) * 2021-10-29 2022-02-08 湖南省交通规划勘察设计院有限公司 Lengthened breadth recognition and automatic output method for AutoCAD engineering drawing
CN114518815B (en) * 2022-02-23 2023-10-10 阿里巴巴(中国)有限公司 Method, device, equipment, medium and program product for displaying building drawing
CN115061980B (en) * 2022-08-18 2022-11-29 南京国睿信维软件有限公司 Method for converting multiple drawings in DWG same canvas into multi-page PDF drawings

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101587428A (en) * 2009-04-08 2009-11-25 广州中船黄埔造船有限公司 Method for printing drawing paper with AutoCAD format in batch
CN102495753A (en) * 2011-10-21 2012-06-13 江苏省交通科学研究院股份有限公司 Interactive computer-aided design (CAD) engineering drawing batch processing method
CN102855350A (en) * 2012-08-06 2013-01-02 上海森松环境技术工程有限公司 Method and system for automatically making engineering drawing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6912487B1 (en) * 1999-04-09 2005-06-28 Public Service Company Of New Mexico Utility station automated design system and method
US7860691B2 (en) * 2005-11-28 2010-12-28 Autodesk, Inc. Dynamic blocks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101587428A (en) * 2009-04-08 2009-11-25 广州中船黄埔造船有限公司 Method for printing drawing paper with AutoCAD format in batch
CN102495753A (en) * 2011-10-21 2012-06-13 江苏省交通科学研究院股份有限公司 Interactive computer-aided design (CAD) engineering drawing batch processing method
CN102855350A (en) * 2012-08-06 2013-01-02 上海森松环境技术工程有限公司 Method and system for automatically making engineering drawing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
AutoCAD建筑制图的初始设置;徐东升;《河北职业技术学院学报》;20050930;第5卷(第3期);第50-51页 *
基于AutoCAD的数字化矿图模板文件的创建;何虎军等;《金属矿山》;20100915(第9期);第98-101页 *
基于CAD的矿图参数识别分析;任海兵等;《江苏煤炭》;20030627(第2期);第63-65页 *

Also Published As

Publication number Publication date
CN103793145A (en) 2014-05-14

Similar Documents

Publication Publication Date Title
CN103793145B (en) A kind of modifying picture frame parameters identification based on AutoCAD and drawing output intent
JP2019083063A (en) System and method for automated conversion of interactive sites and applications to support mobile and other display environments
US9875220B2 (en) Panoptic visualization document printing
US7750924B2 (en) Method and computer-readable medium for generating graphics having a finite number of dynamically sized and positioned shapes
CN110032720A (en) A kind of visualization report typesetting and automatic generation method and system based on XML
US9542363B2 (en) Processing of page-image based document to generate a re-targeted document for different display devices which support different types of user input methods
EP2642414A2 (en) Panoptic visualization document database management
CN106873922A (en) The batch order Method of printing and device of a kind of CAD diagram paper
CN101093563B (en) Method and device for preparing parts catalogue
JP2006050445A (en) Layout adjustment method, apparatus and program
JP2005135397A (en) Document layout method
CN101866335A (en) Form processing method and device in document conversion
JP2004355157A (en) Electronic equipment device corresponding to web, web page processing method, and program
CN111881662A (en) Form generation method, device, processing equipment and storage medium
CN106775614A (en) Intelligent POS quick interface arrangement methods and system
EP2110758A1 (en) Searching method based on layout information
AU660313B2 (en) Method and apparatus for automated page layout of text and graphic elements
EP2711897B1 (en) Panoptic visualization document differencing
CN105512096B (en) A kind of optimization method and device based on font embedded in document
JPH06251007A (en) Table data input device
KR100340031B1 (en) Method for converting map data to data for object_related geographic information system
US8185818B2 (en) Mixed techniques for HTML crosstab rendering
CN105975218A (en) Graphic file browsing and printing device and method based on data converter
CN115329427A (en) Method, device, medium and equipment for guiding PDF drawing with layer information by Revit
Kahn et al. The electronic design interchange format edif: present and future

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 410008 Hunan province Changsha Kaifu District, Furong Road two No. 158

Patentee after: Hunan Traffic Planning Survey and Design Institute Co Ltd

Address before: 410008 Hunan province Changsha Kaifu District, Furong Road two No. 158

Patentee before: Hunan Communication Planning and Prospecting Design Academy

CP01 Change in the name or title of a patent holder