Convert Sodick's graphics files into agie graphics files CXZ 18:42 04.12.01
AGIE is different from Sodick's graphical file format, which is not universal. How to implement data sharing between the two?
This article describes how to convert Sodick's graphics files into Agie's graphics files.
A series of drawing commands (similar to batch files) are saved in the AGIE graphics file (* .prg). SoDick
The graphics file (* .asc) is saved in the ASCII code. It can generally be divided into five parts: logo area, data area,
Auxiliary zone, element area, control area. (Of course, this is my own points!) Let's take a detailed introduction:
A, logo area: storage version information, view size, layer, Fit and other information; B, data area: stored graphical value in hexadecimal form, this area is the largest, generally more than 140 K; C, Auxiliary Area: Information of the auxiliary line (red line) (starting with C, such as Clin, CCIR, etc.); D, element area: stores the information of each element (white line), five elements in Sodick: Point (POINT), Line (LINE), Circle, Arc (Arc), Fillet, Chamfer; This area is the most valuable, in fact, in this region, it can also be coincident with the auxiliary zone, but when converting This area is generally only used, so it is divided into two districts E, the control area: stores NC path information, which forms this area when generating a cutting path;
Of course, there is also an exception, when you import a DXF file, the system will generate a named ASC file, this file is small
Only the logo area with the element area, once you saved, it will restore its original face - greater than 140K.
As can be seen from the above analysis, we only need to extract the contents of the element zone to form the PRG file. Of course, PRG files
It also needs to be simplified. If you are unified to "PNT / 1, XY, X, Y" form, line or chamfer is "LIN / 1, XY, X1, Y1, XY,
X2, Y2 ", circle" CIR / 1, XY, XC, YC, R, R1 ", round or arc as" Arc2 / XC, YC, RR, SANG, Iang, OUT "
(This macro command is tailored for Sodick, of course, you can use three points of painting, but you need four or five
Strip directive).
Ok, let's analyze the element information of the elemental area. (You can refer to the information format of El Detail,
You will find that both are exactly consistent. Each element consists of three lines: the first second line stores element type, serial number, line style,
Color, etc., the third line stores detailed coordinates, angles and other data. We only need to extract the first line of ELEM-TYPE and the third line.
This can pass "While (CL) {if (! Memicmp (CL," LINE ", 4)) {CL [5] = '/ 0'; str = fgets (fpin);
Str = fgets (fpin); str = STR 6; Str = STRCAT (CL, STR); FPUTS (STR, FP); CL = fgets (fpin);}
Else CL = fgets (fpin);}} "to extract and cooperate. After all useful information is extracted, put it in a temporary file, this
You can import this file with Excel, with H18:
"= If (A18 =" cline "; Concatenate (" lin / "; g18;", xy, "; b18;", "; c18;", xy, ";", " ) "
Form a PRG file. The Sang, IANG in the arc is the starting angle and an angle. If you don't like the Arc2 macro I compiled.
You can pass the like "PNT / 95, XY, -22.18741214, 13.64571649 PNT / 96, XY, -26.4940795, 19.03071649PNT / 97, XY, -20.97407995, XY, -20.9749 PNT / 98, RP, 97, R, 5.52000000, A, -141.348831
CIR / 3, P, 96, P, 98, P, 95 "to paint arc, of course, you must judge the positive and negative of IANG (counterclockwise is positive, clockwise)
Adjust "CIR / 3, P, 95, P, 98, P, 96". In fact, Sodick to AGIE conversion is this difficult.
Of course, there is a simpler method to run the small program I have compiled (Sodick.exe). You just need to choose Sodick you want to convert
The file (* .asc) point is determined. The graphic file that can be the same name in the AGIE. (Note: Do not have the same name in the AGIE directory
I have no time to check! I will not be ignored! If you can't find the original file, you can't com you! Corrected 15:21 07.12.01)
In addition, in order to speed up
Speed, I assume that there is certain aid in your graphic file (if you are deleted with Edit Ln-del Draft LN to remove all red lines
If this is almost impossible! At this time, you just need to add a auxiliary line. I have to know that this speed is increased ten times!
Allows you to put the file in the floppy disk can also get it for a few seconds! (Because the front 140K is skipped).
Thanks by cxz 21:18 04.12.01