CN106650091B - Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform - Google Patents

Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform Download PDF

Info

Publication number
CN106650091B
CN106650091B CN201611190643.2A CN201611190643A CN106650091B CN 106650091 B CN106650091 B CN 106650091B CN 201611190643 A CN201611190643 A CN 201611190643A CN 106650091 B CN106650091 B CN 106650091B
Authority
CN
China
Prior art keywords
max
connecting line
starting point
satisfy
connection
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
CN201611190643.2A
Other languages
Chinese (zh)
Other versions
CN106650091A (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.)
Yango University
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 CN201611190643.2A priority Critical patent/CN106650091B/en
Publication of CN106650091A publication Critical patent/CN106650091A/en
Application granted granted Critical
Publication of CN106650091B publication Critical patent/CN106650091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads
    • 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)
  • Geometry (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Structural Engineering (AREA)
  • Computational Mathematics (AREA)
  • Civil Engineering (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Architecture (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for extracting device connection relation in indoor distribution drawings based on an AutoCAD platform, which specifically comprises the following steps: step 1, reading and storing connection information; step 2, calculating and obtaining a maximum point of the device; step 3, calculating and obtaining devices connected with two ends of the connecting line; and 4, self-defining the port number of the device and storing device information. The invention well solves the problem of extracting the device connection relation in the indoor distribution drawing based on the AutoCAD platform and improves the efficiency of extracting the drawing information.

Description

Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform
Technical Field
The invention relates to a secondary development technology of an AutoCAD program architecture and ObjectARX, in particular to a method for extracting a device connection relation in an indoor distribution drawing based on an AutoCAD platform.
Background
AutoCAD is a computer aided design software developed by Autodesk corporation in America; the CAD software is the CAD software which is most widely applied and used by the most people in the Windows system at present.
ObjectARX is a Dynamic Link Library (DLL) of a Windows system essentially, can directly share the address space of AutoCAD, and can also directly utilize the core data structure and code of the AutoCAD, so that a secondary developer can directly access the database structure, the graphic system and the CAD geometric modeling core of the AutoCAD.
When the indoor distribution drawing is drawn on the AutoCAD platform, a complex device graph is often combined into a graph block, and some information of the device is used as attributes to be stored in the graph block, so that the efficiency of drawing repeated graphs can be improved by using the graph block, the repeated operation is greatly reduced, the storage space is saved, and the AutoCAD drawing is convenient to modify.
Extracting the connection relation between devices in an indoor distribution drawing, acquiring information of the initial position and the actual length of a connecting line and information of unique attribute identification, serial number and the like of the connected devices, pressing the information into a self-defined container object, and extracting data in the container object in an Excel table or other forms. If the extraction operation is performed manually, the workload is large, thereby consuming a large amount of time and being inefficient.
In view of the above, it is necessary to provide a method for extracting a device connection relationship in an indoor distribution drawing based on an AutoCAD platform, so as to solve the above problem.
Disclosure of Invention
The invention aims to: the problem of extracting the device connection relation in the indoor distribution drawing under the AutoCAD platform is solved, and the result is stored in the container object, so that subsequent database operation is facilitated.
The technical scheme of the invention is as follows: a method for extracting device connection relation in indoor distribution drawings based on an AutoCAD platform is characterized in that the devices are represented in the drawings in the form of blocks, and the method comprises the following steps:
step 1, reading and storing connection information:
opening an indoor distribution drawing on an AutoCAD platform, selecting an operation area, and acquiring starting point positions p of all connecting lines from the operation areasEnd position peAnd an actual length L, creating a container for storing the connection relation of the devices, and connecting the starting point position p of the connection linesX-axis coordinate p ofsxAnd y-axis coordinate psyAnd storing the actual length L into the container;
step 2, calculating and obtaining the most value point of the device:
filtering all devices from the operation area, calculating the minimum circumscribed rectangle of the devices according to the shape of a single device, and recording a pair of diagonal vertexes of the minimum circumscribed rectangle, namely obtaining the minimum value x of the minimum circumscribed rectangle on the x axisminMaximum value xmaxMinimum value y on y-axisminMaximum value ymaxRepeating the step to obtain the most value points of all the devices;
step 3, calculating and obtaining the devices connected with the two ends of the connecting line:
3.1, acquiring a device connected with a connection starting point:
for a single device, the starting point position p of the linksHas an x-axis coordinate of psxY axis coordinate is psy
1) If the starting point position p of the connecting linesNeither satisfy xmin≤psx≤xmaxAlso does not satisfy ymin≤psy≤ymaxDetermining that the device is not connected with the starting point of the connecting line;
2) if the starting point position p of the connecting linesSatisfy xmin≤psx≤xmaxBut do not satisfy ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(|ymin-psy|,|ymax-psy|)min
3) if the starting point position p of the connecting linesDoes not satisfy xmin≤psx≤xmaxBut satisfy ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(|xmin-psx|,|xmax-psx|)min
4) if the starting point position p of the connecting linesBoth satisfy xmin≤psx≤xmaxAlso satisfies ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|xmin-psx|,|xmax-psx|)min,dymin=(|ymin-psy|,|ymax-psy|)min
5) If d is satisfiedmin<<(xmax-xmin,ymax-ymin)minIf the device is not the device connected with the starting point of the connecting line, the device is determined to be the device connected with the starting point of the connecting line, otherwise, the device is not connected with the starting point of the connecting lineConnecting;
repeating the step 3.1 until obtaining a device connected with the starting point of the connecting line;
3.2, acquiring a device connected with the connection terminal:
for a single device, the link end position peX-axis coordinate p ofexY axis coordinate is pey
1) If the connection end position peNeither satisfy xmin≤pex≤xmaxAlso does not satisfy ymin≤pey≤ymaxIf so, determining that the device is not connected with the connection end point;
2) if the connection end position peSatisfy xmin≤pex≤xmaxBut do not satisfy ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(|ymin-pey|,|ymax-pey|)min
3) if the connection end position peDoes not satisfy xmin≤pex≤xmaxBut satisfy ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(|xmin-pex|,|xmax-pex|)min
4) if the connection end position peBoth satisfy xmin≤pex≤xmaxAlso satisfies ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|xmin-pex|,|xmax-pex|)min,dymin=(|ymin-pey|,|ymax-pey|)min
5) If d is satisfiedmin<<(xmax-xmin,ymax-ymin)minIf the device is not connected with the connection terminal, determining that the device is the device connected with the connection terminal;
repeating the step 3.2 until a device connected with the connection terminal is obtained;
step 4, self-defining the port number of the device and storing device information:
comparing the device connected with the connecting line with the device in the original drawing paper library to judge whether the device is the original device in the drawing paper library, numbering the device port according to the step 4.1 if the device is the original device in the drawing paper library, and numbering the device port according to the step 4.2 if the device is the original device in the drawing paper library;
4.1, numbering original devices in a drawing database:
for the original device in the drawing library, the relative position relation between the device base point and each port is determined by comparing the positions of the device base point and the ports in the library, the position of each port in the drawing is determined by the relative position relation, each port is numbered, the numbering rule is that the number of an input port is 0, the input port is used as a reference, and other ports are numbered in an increasing manner in the clockwise direction;
4.2, numbering devices added later in the drawing database:
1) for all the connecting lines, acquiring all the connecting lines connected with the device through the device connected with the connecting lines by using the judging method for connecting the connecting lines with the device in the step 3, and recording the coordinates of the port points connected with the device;
2) at the center point of the minimum circumscribed rectangle
Figure GDA0002054031360000041
As a center point O of the clockwise rotation, the center point O is taken as a unit vector parallel to the x-axis
Figure GDA0002054031360000042
Then sequentially calculate
Figure GDA0002054031360000043
And
Figure GDA0002054031360000044
wherein A isiRepresenting the ith port point, wherein i is more than or equal to 1, the angle range is 0-360 degrees, and according to the size of the included angle, sequencing all the port points in a clockwise rotation direction;
3) from the center point O to the vertex A (x) of the lower left corner of the minimum bounding rectangle of the devicemin,ymin) As a start vector
Figure GDA0002054031360000045
Clockwise rotation, numbering the port point to which the first rotation is carried out to be 0, and sequentially clockwise rotation is carried out to incrementally number other interfaces;
4.3, storage device information:
reading unique attribute identifications of all devices connected with the starting points of the connecting lines, and storing the unique attribute identifications and port numbers connected with the connecting lines into the container;
and reading the unique attribute identifications of all devices connected with the connection end point, and storing the unique attribute identifications and port numbers connected with the connection into the container.
Further, in step 1: in the indoor distribution drawing, the actual length and attenuation information of the connecting line are stored around the connecting line in the form of text, so that the actual length and attenuation information are used as the marking attribute information of the connecting line, and the text position p in the operation area is calculatedtPerpendicular distance d to said connecting linetIf d is satisfiedt<htA first reaction mixture of a compound represented by formula I and a compound represented by formula II in which htAnd if the height of the text is the height of the text, the content in the text is the marking attribute information of the connecting line, and the actual length L of the connecting line can be obtained from the marking attribute information.
The invention has the beneficial effects that: compared with the prior art, the method has the following positive effects in the aspect of extracting the connection relation of the devices in the indoor distribution drawing under the AutoCAD platform: the method can extract information such as the starting position of the connecting line, the actual length of the connecting line, the unique attribute identification and the serial number of the connected devices at the two ends of the connecting line, and the like, stores the extracted data into a user-defined container object, and can also extract the data in the container object in an Excel table or other forms, thereby greatly improving the working efficiency.
Drawings
FIG. 1 is a flow chart for extracting device connection relations in an indoor distribution drawing based on an AutoCAD platform;
fig. 2 illustrates a minimum circumscribed rectangle of the two-way power divider according to the embodiment of the present invention;
fig. 3 illustrates port numbers of the two power dividers according to the embodiment of the present invention;
FIG. 4 illustrates port numbers of post-added devices in a library in an embodiment of the present invention;
Detailed Description
Hereinafter, a specific embodiment of the present invention will be described with reference to fig. 1 to 4.
As shown in fig. 1, an embodiment of the present invention provides a method for extracting a device connection relationship in an indoor distribution drawing based on an AutoCAD platform, which includes the following steps:
step 1, reading and storing connection information:
opening an indoor distribution drawing on an AutoCAD platform, selecting an operation area, and acquiring starting point positions p of all connecting lines from the operation areasEnd position peAnd the actual length L, creating a container object for storing the connection relation of the devices, and setting the starting point position p of the connection linesX-axis coordinate p ofsxAnd y-axis coordinate psyAnd storing the actual length L into the container;
step 2, calculating and obtaining the most value point of the device:
filtering all devices from the operation area, calculating the minimum circumscribed rectangle of the devices according to the shape of a single device, and recording a pair of diagonal vertexes of the minimum circumscribed rectangle, namely obtaining the minimum value x of the minimum circumscribed rectangle on the x axisminMaximum value xmaxMinimum value y on y-axisminMaximum value ymaxRepeating the step to obtain the most value points of all the devices;
step 3, calculating and obtaining the devices connected with the two ends of the connecting line:
3.1, acquiring a device connected with a connection starting point:
for a single device, the starting point position p of the linksHas an x-axis coordinate of psxY axis coordinate is psy
1) If the starting point position p of the connecting linesNeither satisfy xmin≤psx≤xmaxAlso does not satisfy ymin≤psy≤ymaxDetermining that the device is not connected with the starting point of the connecting line;
2) if the starting point position p of the connecting linesSatisfy xmin≤psx≤xmaxBut do not satisfy ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(|ymin-psy|,|ymax-psy|)min
3) if the starting point position p of the connecting linesDoes not satisfy xmin≤psx≤xmaxBut satisfy ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(|xmin-psx|,|xmax-psx|)min
4) if the starting point position p of the connecting linesBoth satisfy xmin≤psx≤xmaxAlso satisfies ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|xmin-psx|,|xmax-psx|)min,dymin=(|ymin-psy|,|ymax-psy|)min
5) If d is satisfiedmin<<(xmax-xmin,ymax-ymin)minDetermining that the device is the device connected to the starting point of the connection line, otherwise, saying soThe device is not connected with the starting point of the connecting line;
repeating the step 3.1 until obtaining a device connected with the starting point of the connecting line;
3.2, acquiring a device connected with the connection terminal:
for a single device, the end point position p of the wireeX-axis coordinate p ofexY axis coordinate is pey
1) If the connection end position peNeither satisfy xmin≤pex≤xmaxAlso does not satisfy ymin≤pey≤ymaxIf so, determining that the device is not connected with the connection end point;
2) if the connection end position peSatisfy xmin≤pex≤xmaxBut do not satisfy ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(|ymin-pey|,|ymax-pey|)min
3) if the connection end position peDoes not satisfy xmin≤pex≤xmaxBut satisfy ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(|xmin-pex|,|xmax-pex|)min
4) if the connection end position peI.e. satisfies xmin≤pex≤xmaxAlso satisfies ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|xmin-pex|,|xmax-pex|)min,dymin=(|ymin-pey|,|ymax-pey|)min
5) If d is satisfiedmin<<(xmax-xmin,ymax-ymin)minIf the device is not connected with the connection terminal, determining that the device is the device connected with the connection terminal;
repeating the step 3.2 until a device connected with the connection terminal is obtained;
step 4, self-defining the port number of the device and storing device information:
comparing the device connected with the connecting line with the device in the original drawing paper library to judge whether the device is the original device in the drawing paper library, numbering the device port according to the step 4(a) if the device is the original device in the drawing paper library, and numbering the device port according to the step 4(b) if the device is the original device in the drawing paper library;
4.1, numbering original devices in a drawing database:
for the original device in the drawing library, the relative position relation between the device base point and each port is determined by comparing the positions of the device base point and the ports in the library, the position of each port in the drawing is determined by the relative position relation, each port is numbered, the numbering rule is that the number of an input port is 0, the input port is used as a reference, and other ports are numbered in an increasing manner in the clockwise direction;
4.2, numbering devices added later in the drawing database:
1) for all the connecting lines, acquiring all the connecting lines connected with the device through the device connected with the connecting lines by using the judging method for connecting the connecting lines with the device in the step 3, and recording the coordinates of the port points connected with the device;
2) at the center point of the minimum circumscribed rectangle
Figure GDA0002054031360000071
As a center point O of the clockwise rotation, the center point O is taken as a unit vector parallel to the x-axis
Figure GDA0002054031360000072
Then sequentially calculate
Figure GDA0002054031360000073
And
Figure GDA0002054031360000074
wherein A isiRepresenting the ith port point, wherein i is more than or equal to 1, the angle range is 0-360 degrees, and according to the size of the included angle, sequencing all the port points in a clockwise rotation direction;
3) from the center point O to the vertex A (x) of the lower left corner of the minimum bounding rectangle of the devicemin,ymin) As a start vector
Figure GDA0002054031360000075
Clockwise rotation, numbering the port point to which the first rotation is carried out to be 0, and sequentially clockwise rotation is carried out to incrementally number other interfaces;
4.3, storage device information:
reading unique attribute identifications of all devices connected with the starting points of the connecting lines, and storing the unique attribute identifications and port numbers connected with the connecting lines into the container;
reading unique attribute identifications of all devices connected with the connection end point, and storing the unique attribute identifications and port numbers connected with the connection into the container;
the method for extracting the device connection relation to the Excel table in the indoor distribution drawing in the selected AutoCAD drawing operation area by the software compiled by the method of the invention is explained in detail below, and the method specifically comprises the following steps:
1. reading and storing connection information:
loading the created application program file of ". arx" in AutoCAD software, inputting operation command in AutoCAD command line, selecting indoor distribution drawing operation area according to the prompt of "selecting object" in AutoCAD command line, obtaining the starting point position p of all connecting lines from the operation areasEnd position peAnd the actual length L, writing a structure body of the vector container, creating a vector container object for storing the connection relation of the devices, and setting the starting point position p of the connection linesX-axis coordinate p ofsxAnd y-axis coordinate psyAnd the actual length LStoring the obtained product into the vector container;
2. calculating and obtaining the maximum value point of the device:
self-defining writing a picture buffer area linked list (struct rebuf. pcb), using the written linked list pcb as a filter, filtering all devices from the area, calculating the minimum external rectangle of the device according to the shape of a single device, and recording a pair of diagonal vertexes of the minimum external rectangle, namely obtaining the minimum value x of the minimum external rectangle on the x axisminMaximum value xmaxMinimum value y on y-axisminMaximum value ymaxAnd repeating the step to obtain the maximum value point of all the devices.
In this example, a two-power divider with the attribute of PS8-B2F is taken as an example, and the minimum value x of the minimum bounding rectangle on the x-axismin337.8509, maximum xmax339.4613, minimum value y on y-axismin13.3700, maximum value ymax17.2957, the minimum circumscribed rectangle figure is shown in fig. 2;
3. calculating and acquiring devices connected with two ends of the connecting line:
3.1, acquiring a device connected with a connection starting point:
for a two-power splitter with the attribute PS8-B2F in this example, the starting point position p of the connection linesHas an x-axis coordinate of psxY axis coordinate is psy
1) If the starting point position p of the connecting linesNot satisfying p of 337.8509 ≦sx339.4613 is not more than 13.3700 and not more than psyIf not more than 17.2957, determining that the two-power divider is not connected with the starting point of the connection line;
2) if the starting point position p of the connecting linesSatisfy 337.8509 ≦ psx339.4613 is not more than 13.3700 is not more than psyAnd (3) not more than 17.2957, the shortest distance between the connecting line starting point and the minimum circumscribed rectangle of the two-power divider is as follows:
dmin=(|13.3700-psy|,|17.2957-psy|)min
3) if the starting point position p of the connecting linesP is not greater than 337.8509sx339.4613 is less than or equal to, but 13.3700 is less than or equal to psy17.2957 or less, the ratio isThe shortest distance between the line starting point and the minimum external rectangle of the two power dividers is as follows:
dmin=(|337.8509-psx|,|339.4613-psx|)min
4) if the starting point position p of the connecting linesNot only satisfies 337.8509 ≦ psx339.4613 is less than or equal to 13.3700 and less than or equal to psyAnd (3) not more than 17.2957, the shortest distance between the connecting line starting point and the minimum circumscribed rectangle of the two-power divider is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|337.8509-psx|,|339.4613-psx|)min,dymin=(|13.3700-psy|,|17.2957-psy|)min
5) If d is satisfiedmin<<((339.4613-337.8509,17.2957-13.3700)min1.6104), determining that the two power dividers are the devices connected with the starting point of the connecting line, otherwise, indicating that the two power dividers are not connected with the starting point of the connecting line;
repeating the step 3.1 until obtaining a device connected with the starting point of the connecting line;
3.2, acquiring a device connected with the connection terminal:
for a two-power splitter with the attribute of PS8-B2F in this example, the end position p of the connection lineeX-axis coordinate p ofexY axis coordinate is pey
1) If the connection end position peNot satisfying p of 337.8509 ≦ex339.4613 is not more than ymin≤pey≤ymaxIf so, determining that the two power dividers are not connected with the connection end point;
2) if the connection end position peSatisfy 337.8509 ≦ pex339.4613 is not more than 13.3700 is not more than peyAnd (3) not more than 17.2957, the shortest distance between the connection terminal and the minimum external rectangle of the two-power divider is as follows:
dmin=(|13.3700-pey|,|17.2957-pey|)min
3) if the connection end position peDiscontent withP is not less than 337.8509ex339.4613 is less than or equal to, but 13.3700 is less than or equal to peyAnd (3) not more than 17.2957, the shortest distance between the connection terminal and the minimum external rectangle of the two-power divider is as follows:
dmin=(|337.8509-pex|,|339.4613-pex|)min
4) if the connection end position peNot only satisfies 337.8509 ≦ pex339.4613 is less than or equal to 13.3700 and less than or equal to peyAnd (3) not more than 17.2957, the shortest distance between the connection terminal and the minimum external rectangle of the two-power divider is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|337.8509-pex|,|339.4613-pex|)min,dymin=(|13.3700-pey|,|17.2957-pey|)min
5) If d is satisfiedmin<<((339.4613-337.8509,17.2957-13.3700)min1.6104), determining that the two power dividers are the devices connected with the connection end point, otherwise, indicating that the two power dividers are not connected with the connection end point;
repeating the step 3.2 until a device connected with the connection terminal is obtained;
4. self-defining the port number of the device and storing device information:
comparing the device connected with the connecting line with the device in the original drawing paper library to judge whether the device is the original device in the drawing paper library, numbering the device port according to the step 4(a) if the device is the original device in the drawing paper library, and numbering the device port according to the step 4(b) if the device is the original device in the drawing paper library;
4.1, numbering original devices in a drawing database:
for the original device in the graph paper library, taking a two-power divider as an example, comparing the base point of the two-power divider in the library with the position of each port, determining the relative position relationship between the base point of the two-power divider and each port, determining the position of each port in the graph paper through the relative position relationship, and numbering each port, wherein the numbering rule is that the number of an input port is 0, the input port is used as a reference, and other ports are incrementally numbered in the clockwise direction; the interface number of the two power dividers is shown in fig. 3;
4.2, numbering devices added later in the drawing database:
1) for all the connecting lines, acquiring all the connecting lines connected with the device through the device connected with the connecting lines by using the judging method for connecting the connecting lines with the device in the step 3, and recording the coordinates of the port points connected with the device; taking a two-power divider as an example, assuming that the two-power divider is a device added later in a library, coordinates of each port are a (337.8509, 15.3329), b (339.4613,16.6897), c (339.4613, 13.9760);
2) the center point of the minimum external rectangle of the two power dividers
Figure GDA0002054031360000111
As a center point O of the clockwise rotation, the center point O is taken as a unit vector parallel to the x-axis
Figure GDA0002054031360000112
Then sequentially calculate
Figure GDA0002054031360000113
And
Figure GDA0002054031360000114
the angle range of the included angle is 0-360 degrees, and according to the size of the included angle, all port points are sequenced in a clockwise rotation direction;
3) the vertex A (337.8509,13.3700) from the center point O to the lower left corner of the minimum circumscribed rectangle of the two-power divider is taken as an initial vector
Figure GDA0002054031360000115
Clockwise rotation, numbering the port point to which the first rotation is carried out to be 0, and sequentially clockwise rotation is carried out to incrementally number other interfaces; the interface number of the two power dividers is shown in fig. 4;
4.3, storage device information:
reading unique attribute identifications of all devices connected with the starting points of the connecting lines, and storing the unique attribute identifications and port numbers connected with the connecting lines into the vector container;
reading unique attribute identifications of all devices connected with the connection end point, and storing the unique attribute identifications and port numbers connected with the connection into the vector container;
after the operation is finished, the system automatically pops up a form storage dialog box, inputs a form name from the dialog box, self-defines a form storage position, clicks 'storage', then an Excel form for initializing the device connection relation is established, then traverses the data in the vector container, and extracts the data into the Excel form for the device connection relation; after the operation is finished, the system prompts that the operation is successful, the extraction of the device relation is finished, and the Excel table of the device connection relation is shown in table 1.
Start X Y End Cable
PS7-B2F-2 339.737 104.2301 T3-B2F/6dB-0 C-4m
T2-B2F/6dB-2 313.569 104.0079 PS7-B2F-0 C-11m
PS8-B2F-2 339.4613 13.976 T15-B2F/6dB-0 C-4m
PS5-B2F-2 397.5482 32.0079 ANT21-B2F-0 C-18m
PS5-B2F-1 397.5482 34.7216 ANT20-B2F-0 C-3m
PS6-B2F-2 397.5482 14.0079 ANT24-B2F-0 C-18m
PS6-B2F-1 397.5482 16.7216 ANT23-B2F-0 C-2m
T5-B2F/6dB-2 370.569 33.3647 PS5-B2F-0 C-10m
T5-B2F/6dB-1 368.243 34.7498 ANT19-B2F-0 C-10m
T15-B2F/6dB-2 370.569 15.3647 PS6-B2F-0 C-14m
T15-B2F/6dB-1 368.243 16.7498 ANT22-B2F-0 C-2m
PS4-B2F-2 397.5482 50.0079 ANT18-B2F-0 C-6m
PS4-B2F-1 397.5482 52.7216 ANT17-B2F-0 C-19m
PS8-B2F-1 339.4613 16.6897 T5-B2F/6dB-0 C-12m
T14-B2F/6dB-2 313.569 15.3647 PS8-B2F-0 C-6m
T14-B2F/6dB-1 311.243 16.7498 PS4-B2F-0 C-24m
PS3-B2F-2 397.5482 68.0079 ANT15-B2F-0 C-3m
PS3-B2F-1 397.5482 70.7216 ANT14-B2F-0 C-19m
T13-B2F/15dB-2 285.069 15.3647 T14-B2F/6dB-0 C-5m
T13-B2F/15dB-1 282.743 16.7498 ANT16-B2F-0 C-2m
T12-B2F/10dB-2 256.569 15.3647 T13-B2F/15dB-0 C-9m
T12-B2F/10dB-1 254.243 16.7498 PS3-B2F-0 C-23m
PS2-B2F-2 397.5482 122.0079 ANT6-B2F-0 C-2m
PS2-B2F-1 397.5482 124.7216 ANT5-B2F-0 C-18m
T4-B2F/6dB-2 399.069 104.0079 ANT9-B2F-0 C-24m
T4-B2F/6dB-1 396.743 105.393 ANT8-B2F-0 C-2m
T11-B2F/20dB-2 228.069 15.3647 T12-B2F/10dB-0 C-14m
T11-B2F/20dB-1 225.743 16.7498 ANT13-B2F-0 C-3m
T1-B2F/6dB-2 370.569 123.3647 PS2-B2F-0 C-14m
T1-B2F/6dB-1 368.243 124.7498 ANT4-B2F-0 C-3m
T3-B2F/6dB-2 370.569 104.0079 T4-B2F/6dB-0 C-14m
T3-B2F/6dB-1 368.243 105.393 ANT7-B2F-0 C-3m
T10-B2F/20dB-2 199.569 15.3647 T11-B2F/20dB-0 C-13m
T10-B2F/20dB-1 197.243 16.7498 ANT12-B2F-0 C-7m
PS1-B2F-2 397.5482 140.0079 ANT3-B2F-0 C-19m
PS1-B2F-1 397.5482 142.7216 ANT2-B2F-0 C-5m
PS7-B2F-1 339.737 106.9438 T1-B2F/6dB-0 C-14m
T9-B2F/20dB-2 171.069 15.3647 T10-B2F/20dB-0 C-12m
T9-B2F/20dB-1 168.743 16.7498 ANT11-B2F-0 C-6m
T2-B2F/6dB-1 311.243 105.393 PS1-B2F-0 C-12m
T8-B2F/20dB-2 142.569 15.3647 T9-B2F/20dB-0 C-11m
T8-B2F/20dB-1 140.243 16.7498 ANT10-B2F-0 C-5m
T7-B2F/10dB-2 114.069 15.3647 T8-B2F/20dB-0 C-3m
T7-B2F/10dB-1 111.743 16.7498 T2-B2F/6dB-0 C-5m
T6-B2F/20dB-2 85.569 15.3647 T7-B2F/10dB-0 C-5m
T6-B2F/20dB-1 83.243 16.7498 ANT1-B2F-0 C-10m
13-0 64.2468 15.3045 T6-B2F/20dB-0 C-3m

Claims (2)

1. A method for extracting device connection relation in indoor distribution drawings based on an AutoCAD platform is characterized in that the devices are represented in the drawings in the form of blocks, and the method comprises the following steps:
step 1, reading and storing connection information:
opening an indoor distribution drawing on an AutoCAD platform, selecting an operation area, and acquiring starting point positions p of all connecting lines from the operation areasEnd position peAnd actual length L, created for the storageThe elements being connected to the containers in relation to each other and defining a starting point p for the connectionsX-axis coordinate p ofsxAnd y-axis coordinate psyAnd storing the actual length L into the container;
step 2, calculating and obtaining the most value point of the device:
filtering all devices from the operation area, calculating the minimum circumscribed rectangle of the devices according to the shape of a single device, and recording a pair of diagonal vertexes of the minimum circumscribed rectangle, namely obtaining the minimum value x of the minimum circumscribed rectangle on the x axisminMaximum value xmaxMinimum value y on y-axisminMaximum value ymaxRepeating the step to obtain the most value points of all the devices;
step 3, calculating and obtaining the devices connected with the two ends of the connecting line:
3.1, acquiring a device connected with a connection starting point:
for a single device, the starting point position p of the linksHas an x-axis coordinate of psxY axis coordinate is psy
1) If the starting point position p of the connecting linesNeither satisfy xmin≤psx≤xmaxAlso does not satisfy ymin≤psy≤ymaxDetermining that the device is not connected with the starting point of the connecting line;
2) if the starting point position p of the connecting linesSatisfy xmin≤psx≤xmaxBut do not satisfy ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(|ymin-psy|,|ymax-psy|)min
3) if the starting point position p of the connecting linesDoes not satisfy xmin≤psx≤xmaxBut satisfy ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(|xmin-psx|,|xmax-psx|)min
4) if connecting to the wirePoint position psBoth satisfy xmin≤psx≤xmaxAlso satisfies ymin≤psy≤ymaxThen, the shortest distance between the connection starting point and the minimum external rectangle of the device is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|xmin-psx|,|xmax-psx|)min,dymin=(|ymin-psy|,|ymax-psy|)min
5) If d is satisfiedmin<<(xmax-xmin,ymax-ymin)minIf the device is not connected with the starting point of the connecting line, determining that the device is the device connected with the starting point of the connecting line, otherwise, indicating that the device is not connected with the starting point of the connecting line;
repeating the step 3.1 until obtaining a device connected with the starting point of the connecting line;
3.2, acquiring a device connected with the connection terminal:
for a single device, the link end position peX-axis coordinate p ofexY axis coordinate is pey
1) If the connection end position peNeither satisfy xmin≤pex≤xmaxAlso does not satisfy ymin≤pey≤ymaxIf so, determining that the device is not connected with the connection end point;
2) if the connection end position peSatisfy xmin≤pex≤xmaxBut do not satisfy ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(|ymin-pey|,|ymax-pey|)min
3) if the connection end position peDoes not satisfy xmin≤pex≤xmaxBut satisfy ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(|xmin-pex|,|xmax-pex|)min
4) if the connection end position peBoth satisfy xmin≤pex≤xmaxAlso satisfies ymin≤pey≤ymaxIf the minimum distance between the connection terminal and the minimum external rectangle of the device is as follows:
dmin=(dxmin,dymin)min
wherein d isxmin=(|xmin-pex|,|xmax-pex|)min,dymin=(|ymin-pey|,|ymax-pey|)min
5) If d is satisfiedmin<<(xmax-xmin,ymax-ymin)minIf the device is not connected with the connection terminal, determining that the device is the device connected with the connection terminal;
repeating the step 3.2 until a device connected with the connection terminal is obtained;
step 4, self-defining the port number of the device and storing device information:
comparing the device connected with the connecting line with the device in the original drawing paper library to judge whether the device is the original device in the drawing paper library, numbering the device port according to the step 4.1 if the device is the original device in the drawing paper library, and numbering the device port according to the step 4.2 if the device is the original device in the drawing paper library;
4.1, numbering original devices in a drawing database:
for the original device in the drawing library, the relative position relation between the device base point and each port is determined by comparing the positions of the device base point and the ports in the library, the position of each port in the drawing is determined by the relative position relation, each port is numbered, the numbering rule is that the number of an input port is 0, the input port is used as a reference, and other ports are numbered in an increasing manner in the clockwise direction;
4.2, numbering devices added later in the drawing database:
1) for all the connecting lines, acquiring all the connecting lines connected with the device through the device connected with the connecting lines by using the judging method for connecting the connecting lines with the device in the step 3, and recording the coordinates of the port points connected with the device;
2) at the center point of the minimum circumscribed rectangle
Figure FDA0002054031350000031
As a center point O of the clockwise rotation, the center point O is taken as a unit vector parallel to the x-axis
Figure FDA0002054031350000032
Then sequentially calculate
Figure FDA0002054031350000033
And
Figure FDA0002054031350000034
wherein A isiRepresenting the ith port point, wherein i is more than or equal to 1, the angle range is 0-360 degrees, and according to the size of the included angle, sequencing all the port points in a clockwise rotation direction;
3) from the center point O to the vertex A (x) of the lower left corner of the minimum bounding rectangle of the devicemin,ymin) As a start vector
Figure FDA0002054031350000035
Clockwise rotation, numbering the port point to which the first rotation is carried out to be 0, and sequentially clockwise rotation is carried out to incrementally number other interfaces;
4.3, storage device information:
reading unique attribute identifications of all devices connected with the starting points of the connecting lines, and storing the unique attribute identifications and port numbers connected with the connecting lines into the container;
and reading the unique attribute identifications of all devices connected with the connection end point, and storing the unique attribute identifications and port numbers connected with the connection into the container.
2. The method of claim 1, wherein in step 1: the method for acquiring the actual length L of the connecting line comprises the following steps:
in the indoor distribution drawing, the actual length and attenuation information of the connecting line are stored around the connecting line in the form of text, so that the actual length and attenuation information are used as the marking attribute information of the connecting line, and the text position p in the operation area is calculatedtPerpendicular distance d to said connecting linetIf d is satisfiedt<htA first reaction mixture of a compound represented by formula I and a compound represented by formula II in which htAnd if the height of the text is the height of the text, the content in the text is the marking attribute information of the connecting line, and the actual length L of the connecting line can be obtained from the marking attribute information.
CN201611190643.2A 2016-12-21 2016-12-21 Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform Active CN106650091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611190643.2A CN106650091B (en) 2016-12-21 2016-12-21 Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611190643.2A CN106650091B (en) 2016-12-21 2016-12-21 Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform

Publications (2)

Publication Number Publication Date
CN106650091A CN106650091A (en) 2017-05-10
CN106650091B true CN106650091B (en) 2020-08-14

Family

ID=58834394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611190643.2A Active CN106650091B (en) 2016-12-21 2016-12-21 Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform

Country Status (1)

Country Link
CN (1) CN106650091B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108074013B (en) * 2017-11-13 2021-03-02 杭州鸿晟电力设计咨询有限公司 Space saturation load prediction method and tool
CN109190157B (en) * 2018-07-26 2023-05-23 中国核电工程有限公司 Refreshing method for object position information of Autodesk AutoCAD P & ID
CN110795809B (en) * 2019-11-07 2023-08-29 国网河北省电力有限公司电力科学研究院 Method, system and medium for automatically picking up connection relation of electric secondary circuit of transformer substation based on CAD (computer aided design) drawing

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012198703A (en) * 2011-03-18 2012-10-18 Fujitsu Ltd Switching power supply circuit system determination processing method, cad device, and cad program
CN103761331A (en) * 2014-01-27 2014-04-30 刘玉芳 Processing system for drawing data and processing method thereof
CN104615795A (en) * 2013-11-05 2015-05-13 中国空间技术研究院 Drawing content extraction and verification method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012198703A (en) * 2011-03-18 2012-10-18 Fujitsu Ltd Switching power supply circuit system determination processing method, cad device, and cad program
CN104615795A (en) * 2013-11-05 2015-05-13 中国空间技术研究院 Drawing content extraction and verification method
CN103761331A (en) * 2014-01-27 2014-04-30 刘玉芳 Processing system for drawing data and processing method thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Comparative Study on Extraction and Recognition Method of CAD Data from CAD Drawings;Mohamad Faizal Ab. Jabal 等;《2009 International Conference on Information Management and Engineering》;20090405;第709-713页 *
一种CAD图纸中WLAN器件连接关系的获取方法;敖行 等;《计算机应用与软件》;20160131;第33卷(第1期);第90-93页 *

Also Published As

Publication number Publication date
CN106650091A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106650091B (en) Method for extracting device connection relation in indoor distribution drawing based on AutoCAD platform
CN104750913A (en) Method for automatically transforming DWG three-dimensional model into X three-dimensional model
CN112102435B (en) Method, device, equipment and storage medium for drawing geometric figure
CN113724401B (en) Three-dimensional model cutting method and device, computer equipment and storage medium
CN106971423A (en) Method for drafting, device, equipment and the storage medium of cube figure
CN109271697B (en) System and method for processing interrupt data in AutoCAD based on VBA, and computer program
CN114816381B (en) Building engineering MBD three-dimensional labeling method, electronic equipment and storage medium
CN111259474B (en) Large-scale BIM model data processing and loading method and equipment
CN104809690B (en) A kind of intelligent method for fusing of many sketches
US20080143708A1 (en) System and method for auto-dimensioning boundary representation model
CN104408267A (en) Finite element modeling method for special-shaped spatial structure
CN111368915A (en) Drawing verification method, device, equipment and storage medium
CN116310251A (en) Automatic coordinate registration method and device for house property IFC model and building vector boundary
CN112861241B (en) Method, device and equipment for expanding conical tube and readable storage medium
CN111199086A (en) Three-dimensional geometric discretization processing system
CN114969893A (en) Ceiling keel design method based on internal and external corner identification and storage medium
CN112307725B (en) Method for adding table information on two-dimensional drawing interface
CN114092952A (en) dXF format-based house type graph information extraction and vectorization method and device
CN113888486A (en) Method for assisting vectorization and DLG quality inspection based on three-dimensional model
CN113192195B (en) Method for repairing damaged terrain coordinate data
Fu et al. Generating Chinese calligraphy on freeform shapes
CN110413964B (en) Method for converting die lettering into editable text and computer-readable storage medium
CN114283441B (en) Two-dimensional drawing recognition modeling method and device suitable for railway passenger station
JPH01126774A (en) Graphic input device
JPH04127379A (en) Method and device for dividing element of analytic object

Legal Events

Date Code Title Description
PB01 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220316

Address after: No.99 Denglong Road, Fuzhou Economic and Technological Development Zone, Fujian Province 350015

Patentee after: YANGO University

Address before: 300384 No. 391 Binshui West Road, Xiqing District, Tianjin

Patentee before: TIANJIN University OF TECHNOLOGY