CN106528946A - Method for inserting AutoCAD graph blocks in batches - Google Patents

Method for inserting AutoCAD graph blocks in batches Download PDF

Info

Publication number
CN106528946A
CN106528946A CN201610902546.5A CN201610902546A CN106528946A CN 106528946 A CN106528946 A CN 106528946A CN 201610902546 A CN201610902546 A CN 201610902546A CN 106528946 A CN106528946 A CN 106528946A
Authority
CN
China
Prior art keywords
segment
autocad
dynamic array
records
axis coordinate
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.)
Granted
Application number
CN201610902546.5A
Other languages
Chinese (zh)
Other versions
CN106528946B (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.)
Tianjin University of Technology
Original Assignee
Tianjin University of Technology
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 Tianjin University of Technology filed Critical Tianjin University of Technology
Priority to CN201610902546.5A priority Critical patent/CN106528946B/en
Publication of CN106528946A publication Critical patent/CN106528946A/en
Application granted granted Critical
Publication of CN106528946B publication Critical patent/CN106528946B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/39Circuit design at the physical level
    • G06F30/392Floor-planning or layout, e.g. partitioning or placement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Architecture (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method for inserting AutoCAD graph blocks in batches. The method specifically comprises the steps of 1, opening an AutoCAD drawing and loading an application; 2, selecting and recording reference graph block information; 3, calculating and recording insertion graph block information; and 4, selecting insertion graph blocks and inserting the insertion graph blocks to the AutoCAD drawing in batches. According to the method, the problem on batch insertion of the graph blocks in the modified AutoCAD drawing is solved, so that the drawing modification efficiency is improved.

Description

A kind of method that batch inserts AutoCAD segments
Technical field
The present invention relates to the secondary exploitation technology of AutoCAD program architectures and ObjectARX, more particularly to a kind of batch is inserted The method for entering AutoCAD segments.
Background technology
AutoCAD is a computer aided design software that autodesk, inc. of the U.S. develops.It is current The most CAD software of most widely used, number of users in Windows systems.
ObjectARX is substantially a dynamic link library (DLL) of Windows systems, can directly share AutoCAD's Address space, also can directly using the kernel data structure and code of AutoCAD so that secondary development person directly can access The database structure of AutoCAD, graphics system and CAD geometric modeling cores.
When AutoCAD drawings are drawn, complicated component graphics are often combined into a segment by Jing, can using segment To improve the efficiency for drawing repetitive pattern, greatly reduce repetitive operation, save memory space, be easily modified AutoCAD drawings.
When needing to modify AutoCAD drawings, it is often necessary to add other segments around some segments, this Shi Ruguo carries out one time using the insertion order (can call by " insert ") carried in AutoCAD softwares to each segment Insertion and the process of parameter setting, workload are huge, extremely inefficient.
In view of this, it is necessary to propose a kind of method of the AutoCAD segments batch insertion based on ObjectARX, with Solve the above problems.
The content of the invention
Present invention aim at:During solving revisions on drawings, on the basis of selecting the parameter of segment, in selected segment Around insert the problem of segment in batches.
The technical scheme is that:A kind of method that batch inserts AutoCAD segments, it is characterised in that the method bag Include:
Step 1, opening AutoCAD drawings loading application programs:
Open existing AutoCAD drawings under AutoCAD environment, " .arx " of generation is write in select tools loading should With program file, corresponding operational order is input in AutoCAD order lines and drawing is operated;
Step 2, select and record and refer to pattern information:
A segment on selected AutoCAD drawings so as to as the reference segment, the step for repetition, selectes N number of With reference to segment, four Dynamic Array Ai are created:
First Dynamic Array A1, records the X-axis coordinate of N number of reference segment;
Second Dynamic Array A2, records the Y-axis coordinate of N number of reference segment;
3rd Dynamic Array A3, records the scaling of N number of reference segment;
4th Dynamic Array A4, records the rotation radian of N number of reference segment;
Step 3, calculate and record insertion pattern information:
Side-play amount D being input in X-axis in AutoCADX, side-play amount D in Y-axisY, scaling coefficient DS, the anglec of rotation DA
A, using the X-axis coordinate of the N number of described reference segment stored in the first Dynamic Array A1, calculate the insertion segment X-axis coordinate A1 '=A1+DXE, wherein e are N-dimensional unit column vector
B, using the Y-axis coordinate of the N number of described reference segment stored in the second Dynamic Array A2, calculate the insertion segment Y-axis coordinate A2 '=A2+DYE, wherein e are N-dimensional unit column vector
C, using the scaling of the N number of described reference segment stored in the 3rd Dynamic Array A3, calculate the insertion figure The scaling A3 '=A3 × D of blockSE, wherein e are N-dimensional unit column vector
D, using the rotation radian of the N number of described reference segment stored in the 4th Dynamic Array A4, calculate the insertion figure The rotation radian of blockWherein e is N-dimensional unit column vector
Now, the data storage of the middle record of four Dynamic Array Ai ' is as follows:
First Dynamic Array A1 ', records the X-axis coordinate of N number of insertion segment;
Second Dynamic Array A2 ', records the Y-axis coordinate of N number of insertion segment;
3rd Dynamic Array A3 ', records the scaling of N number of insertion segment;
4th Dynamic Array A4 ', records the rotation radian of N number of insertion segment.
Step 4, selection insertion segment are simultaneously inserted on AutoCAD drawings in batches
A kind of Block Object is selected from AutoCAD drawing data bases, by the Block Object instantiation n times so as to as N The individual insertion segment, is added to the data message in four Dynamic Array Ai ' corresponding in N number of insertion segment, and N number of insertion segment batch is inserted in AutoCAD drawings;
Further, in step 4:For can be current AutoCAD drawing data bases in AutoCAD drawing data bases Can be outside AutoCAD drawing data bases;
The Block Object selected in AutoCAD drawing data bases, it is identical with the segment type in the reference segment or It is different.
The invention has the beneficial effects as follows:The present invention is had the positive effect that in drawing modification with prior art:Can with institute On the basis of stating with reference to pattern information, any segment that batch insertion system in optional position is present around with reference to segment, and can With the scaling of the self-defined insertion segment and the anglec of rotation, work efficiency is greatly improved.
Description of the drawings
The flow chart that a kind of Fig. 1 batches disclosed by the invention insert AutoCAD segment methods;
Segment batch insertion dialog box in Fig. 2 embodiment of the present invention;
Fig. 3 (a) is the original graph before batch insertion;
Fig. 3 (b) is the modification figure after batch insertion.
Specific embodiment
Illustrate hereinafter with reference to Fig. 1-3 pair of specific embodiment of the invention.
As shown in figure 1, embodiments providing a kind of method that batch inserts AutoCAD segments, which includes following Step:
Step 1, opening AutoCAD drawings loading application programs:
Open existing AutoCAD drawings under AutoCAD environment, " .arx " of generation is write in select tools loading should With program file, corresponding operational order is input in AutoCAD order lines and drawing is operated.
Step 2, select and record and refer to pattern information;
A segment on selected AutoCAD drawings so as to as the reference segment, the step for repetition, selectes N number of With reference to segment, four Dynamic Array Ai are created:
First Dynamic Array A1, records the X-axis coordinate of N number of reference segment;
Second Dynamic Array A2, records the Y-axis coordinate of N number of reference segment;
3rd Dynamic Array A3, records the scaling of N number of reference segment;
4th Dynamic Array A4, records the rotation radian of N number of reference segment.
Step 3, calculate and record insertion pattern information;
Side-play amount D being input in X-axis in AutoCADX, side-play amount D in Y-axisY, scaling coefficient DS, the anglec of rotation DA
A, using the X-axis coordinate of the N number of described reference segment stored in the first Dynamic Array A1, calculate the insertion segment X-axis coordinate A1 '=A1+DXE, wherein e are N-dimensional unit column vector
B, using the Y-axis coordinate of the N number of described reference segment stored in the second Dynamic Array A2, calculate the insertion segment Y-axis coordinate A2 '=A2+DYE, wherein e are N-dimensional unit column vector
C, using the scaling of the N number of described reference segment stored in the 3rd Dynamic Array A3, calculate the insertion figure The scaling A3 '=A3 × D of blockSE, wherein e are N-dimensional unit column vector
D, using the rotation radian of the N number of described reference segment stored in the 4th Dynamic Array A4, calculate the insertion figure The rotation radian of blockWherein e is N-dimensional unit column vector
Now, the data storage of the middle record of four Dynamic Array Ai ' is as follows:
First Dynamic Array A1 ', records the X-axis coordinate of N number of insertion segment;
Second Dynamic Array A2 ', records the Y-axis coordinate of N number of insertion segment;
3rd Dynamic Array A3 ', records the scaling of N number of insertion segment;
4th Dynamic Array A4 ', records the rotation radian of N number of insertion segment.
Step 4, selection insertion segment are simultaneously inserted on AutoCAD drawings in batches
A kind of Block Object is selected from AutoCAD drawing data bases, by the Block Object instantiation n times so as to as N The individual insertion segment, is added to the data message in four Dynamic Array Ai ' corresponding in N number of insertion segment, and N number of insertion segment batch is inserted in AutoCAD drawings.
Below so that the software of the method for the invention establishment realizes batch insertion RFID terminals as an example, batch is inserted The method of AutoCAD segments is described in detail, and the method specifically includes following steps:
Step 1, opening AutoCAD drawings loading application programs:
Existing AutoCAD drawings are opened, select tools simultaneously load " .arx " application file for writing generation, After AutoCAD order line input operation orders, system meeting automatic spring batch insertion segment dialog box, the batch insert segment Dialog box is designed based on ObjectARX and MFC, can with the perfect adaptation of AutoCAD interfaces, now by drawing data base In block name be added in batch insertion segment dialog box, as shown in Figure 2;
Step 2, select and record and refer to pattern information:
One or more piece name is selected in " referring to segment " list that the batch is inserted in segment dialog box independently, Following " complete to select " or " selection attribute block " button can be clicked on, this example is using click " selection attribute block " button, Ran Hou Self-defined selection operation region on AutoCAD drawings, then in the Automatic Program reading operating area corresponding to the block name of selection Segment, in example select 11 segments, with select 11 segments be to refer to segment, create four Dynamic Array Ai:
First Dynamic Array A1, records the X-axis coordinate of 11 reference segments;
Second Dynamic Array A2, records the Y-axis coordinate of 11 reference segments;
3rd Dynamic Array A3, records the scaling of 11 reference segments;
4th Dynamic Array A4, records the rotation radian of 11 reference segments.
Step 3, calculate and record insertion pattern information:
Side-play amount D being input in X-axis in the batch inserts segment dialog boxX=-3, side-play amount D in Y-axisY= 0th, scaling coefficient DS=2, anglec of rotation DA=0;
A, using the X-axis coordinate of 11 stored in the first Dynamic Array A1 reference segments, calculate the insertion figure The X-axis coordinate A1 '=A1-3e of block, wherein e are 11 dimension unit column vectors
B, using the Y-axis coordinate of 11 stored in the second Dynamic Array A2 reference segments, calculate the insertion figure The Y-axis coordinate A2 '=A2+0 × e of block, wherein e are 11 dimension unit column vectors
C, using the scaling of the 11 reference segments stored in the 3rd Dynamic Array A3, calculate the insertion figure The scaling A3 '=A3 × 2e of block, wherein e are 11 dimension unit column vectors
D, using the rotation radian of the 11 reference segments stored in the 4th Dynamic Array A4, calculate the insertion figure The rotation radian of blockWherein e is 11 dimension unit column vectors
Now, the data storage of the middle record of four Dynamic Array Ai ' is as follows:
First Dynamic Array A1 ', records the X-axis coordinate of 11 insertion segments;
Second Dynamic Array A2 ', records the Y-axis coordinate of 11 insertion segments;
3rd Dynamic Array A3 ', records the scaling of 11 insertion segments;
4th Dynamic Array A4 ', records the rotation radian of 11 insertion segments.
Step 4, selection insertion segment are simultaneously inserted on AutoCAD drawings in batches:
Insert in the batch RFID terminals are selected under " selecting insertion segment " list in segment dialog box so as to as The insertion segment, now program can read automatically Drawing Object and the non-graphic of RFID terminals in AutoCAD drawing data bases Object, by the Block Object instantiation 11 times so as to as 11 insertion segments, by the number in four Dynamic Array Ai ' It is believed that breath is corresponding being added in 11 insertion segments.
" batch is inserted " button, the RFID ends that program will can be obtained automatically is clicked in batch insertion segment dialog box Son is inserted in drawing with the parameter batch in four Dynamic Array, and updates AutoCAD drawings, enables the insertion segment It is displayed on AutoCAD drawings, completes batch insertion process, comparison diagram is as shown in Figure 3 before and after batch is inserted.

Claims (2)

1. a kind of method that batch inserts AutoCAD segments, it is characterised in that characterized in that, the method includes:
Step 1, opening AutoCAD drawings loading application programs:
Open existing AutoCAD drawings under AutoCAD environment, select tools loading are write " .arx " of generation and apply journey Preface part, is input into corresponding operational order in AutoCAD order lines and drawing is operated;
Step 2, select and record and refer to pattern information:
A segment on selected AutoCAD drawings so as to as segment is referred to, the step for repetition, selectes N number of with reference to figure Block, creates four Dynamic Array Ai:
First Dynamic Array A1, records the X-axis coordinate of N number of reference segment;
Second Dynamic Array A2, records the Y-axis coordinate of N number of reference segment;
3rd Dynamic Array A3, records the scaling of N number of reference segment;
4th Dynamic Array A4, records the rotation radian of N number of reference segment;
Step 3, calculate and record insertion pattern information:
Side-play amount D being input in X-axis in AutoCADX, side-play amount D in Y-axisY, scaling coefficient DS, anglec of rotation DA
A, the X for using the X-axis coordinate of the N number of described reference segment stored in the first Dynamic Array A1, calculating the insertion segment Axial coordinate A1 '=A1+DXE, wherein e are N-dimensional unit column vector
B, the Y for using the Y-axis coordinate of the N number of described reference segment stored in the second Dynamic Array A2, calculating the insertion segment Axial coordinate A2 '=A2+DYE, wherein e are N-dimensional unit column vector
C, using the scaling of the N number of described reference segment stored in the 3rd Dynamic Array A3, calculate the insertion segment Scaling A3 '=A3 × DSE, wherein e are N-dimensional unit column vector
D, using the rotation radian of the N number of described reference segment stored in the 4th Dynamic Array A4, calculate the insertion segment Rotation radianWherein e is N-dimensional unit column vector
Now, the data storage of the middle record of four Dynamic Array Ai ' is as follows:
First Dynamic Array A1 ', records the X-axis coordinate of N number of insertion segment;
Second Dynamic Array A2 ', records the Y-axis coordinate of N number of insertion segment;
3rd Dynamic Array A3 ', records the scaling of N number of insertion segment;
4th Dynamic Array A4 ', records the rotation radian of N number of insertion segment;
Step 4, selection insertion segment are simultaneously inserted on AutoCAD drawings in batches:
A kind of Block Object is selected from AutoCAD drawing data bases, by the Block Object instantiation n times so as to as N number of institute Insertion segment is stated, is added to the data message in four Dynamic Array Ai ' corresponding in N number of insertion segment, and will be N number of The insertion segment batch is inserted in AutoCAD drawings.
2. the method for claim 1, it is characterised in that in step 4:For in AutoCAD drawing data bases being Current AutoCAD drawing data bases can also be outside AutoCAD drawing data bases;
Segment type in the Block Object selected in AutoCAD drawing data bases, and the reference segment is identical or different.
CN201610902546.5A 2016-10-18 2016-10-18 A kind of method of batch insertion AutoCAD segment Expired - Fee Related CN106528946B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610902546.5A CN106528946B (en) 2016-10-18 2016-10-18 A kind of method of batch insertion AutoCAD segment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610902546.5A CN106528946B (en) 2016-10-18 2016-10-18 A kind of method of batch insertion AutoCAD segment

Publications (2)

Publication Number Publication Date
CN106528946A true CN106528946A (en) 2017-03-22
CN106528946B CN106528946B (en) 2019-06-25

Family

ID=58332387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610902546.5A Expired - Fee Related CN106528946B (en) 2016-10-18 2016-10-18 A kind of method of batch insertion AutoCAD segment

Country Status (1)

Country Link
CN (1) CN106528946B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144650A (en) * 2018-08-22 2019-01-04 拉扎斯网络科技(上海)有限公司 Show method for managing object, device, electronic equipment and computer storage medium
CN112883449A (en) * 2021-01-14 2021-06-01 中策橡胶集团有限公司 Tire sidewall font graph generation method based on AutoCAD

Citations (5)

* 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
US7702416B2 (en) * 2006-01-17 2010-04-20 National Instruments Corporation Automatic creation of motion control commands according to elements in drawing specifications and user input
CN102799714A (en) * 2012-06-27 2012-11-28 西安理工大学 Method for extracting data of integrated pipeline of metro based on Auto computer-aided design (CAD) drawing
CN103793145A (en) * 2014-02-21 2014-05-14 湖南省交通规划勘察设计院 Drawing frame parameter identification and drawing output method based on autoCAD
CN104408269A (en) * 2014-12-17 2015-03-11 上海天华建筑设计有限公司 Design drawing splitting method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702416B2 (en) * 2006-01-17 2010-04-20 National Instruments Corporation Automatic creation of motion control commands according to elements in drawing specifications and user input
CN101587428A (en) * 2009-04-08 2009-11-25 广州中船黄埔造船有限公司 Method for printing drawing paper with AutoCAD format in batch
CN102799714A (en) * 2012-06-27 2012-11-28 西安理工大学 Method for extracting data of integrated pipeline of metro based on Auto computer-aided design (CAD) drawing
CN103793145A (en) * 2014-02-21 2014-05-14 湖南省交通规划勘察设计院 Drawing frame parameter identification and drawing output method based on autoCAD
CN104408269A (en) * 2014-12-17 2015-03-11 上海天华建筑设计有限公司 Design drawing splitting method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
崔娟: "AutoCAD中图块的应用", 《学科建设》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144650A (en) * 2018-08-22 2019-01-04 拉扎斯网络科技(上海)有限公司 Show method for managing object, device, electronic equipment and computer storage medium
CN109144650B (en) * 2018-08-22 2022-03-01 拉扎斯网络科技(上海)有限公司 Display object management method and device, electronic equipment and computer storage medium
CN112883449A (en) * 2021-01-14 2021-06-01 中策橡胶集团有限公司 Tire sidewall font graph generation method based on AutoCAD
CN112883449B (en) * 2021-01-14 2023-09-26 中策橡胶集团股份有限公司 Tire sidewall font graph generation method based on AutoCAD

Also Published As

Publication number Publication date
CN106528946B (en) 2019-06-25

Similar Documents

Publication Publication Date Title
US5819062A (en) Method for converting design intent into a neutral-file-format for computer aided design applications
US7702416B2 (en) Automatic creation of motion control commands according to elements in drawing specifications and user input
US8872820B2 (en) System and method for splitting faces on a solid model
US20100238167A1 (en) System and method for converting dimensions
JPH0785137A (en) Generating device for cad library model
US7013468B2 (en) Method and apparatus for design and manufacturing application associative interoperability
TW201642058A (en) Program generation device, program generation method, and program generation program
CN106528946A (en) Method for inserting AutoCAD graph blocks in batches
US20070225953A1 (en) Management system and management method of CAD data
US7073152B2 (en) System and method for determining a highest level signal name in a hierarchical VLSI design
US9875329B1 (en) Method and system for import of mask layout data to a target system
CN115268846A (en) Method and device for adding attribute information and computer readable storage medium
CN114595657A (en) Chip layout method and device and electronic equipment
JP2009526337A (en) Method and system for processing user-defined objects based on object storage memory
US20170300303A1 (en) Linear Programming Formulation for Incremental Layout in a Graphical Program
CN100377056C (en) Image display control apparatus, and program and method therefor
CN111612874B (en) 3D drawing board for drawing complex model
CN108984300B (en) Layout data review method, system and storage medium
JP4006120B2 (en) Logic synthesis device
CN116204267B (en) Method and device for generating intellectual property flow form
US11074763B2 (en) Systems and methods for editing shapes of faceted geometries
US20030182004A1 (en) Electronically-accessible product description
JP2831816B2 (en) Display device for correspondence between design information
CN112381229A (en) Knowledge integration framework and method based on three-dimensional digital-analog
CN116795361A (en) Page setting method, computing device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190625

Termination date: 20201018