|
久々に問い合わせします。
座標表からNCデータ作成したい
CAD-CAM (製図 ソフト)から座標表の文字を抽出したサンプルを下例1 に示します。
1 現アルファベットは 全て N に置換する
2 数値列の前に 順に X Y D を付加する
3 小数点のない数値列には . を付加する
4 " , - 漢字 を削除
5 N番号だけの行 削除
以上の処理により下例2 のようにしたい。
例1
"NO.","X座標","Y座標","直径","備考"
"EP1","-116.66","-36.68","5.0","-"
"EP2","-145.80","-42.63","5.0","-"
"EP3","-166.51","-42.21","5.0","-"
"EP10","-171.43","20.10","6.1","-"
"EP11","-85.00","20.00","6.1","-"
"EP12","-228.00","-47.50","6.1","-"
"EP13","-232.00","-7.11","6.1","-"
"EP14"
"EP18","29.92","57.76","5.0","-"
"EP19","0.24","59.56","5.0","-"
"EP20","-19.65","65.32","5.0","-"
"B1","-355","-25","14","-"
"B2","-315","-25","14","-"
"B7~18"
"B19","160","280","14","-"
"B20","160","240","14","-"
"B21","160","200","14","-"
下例2
N1X-116.66Y-36.68D5.0
N2X-145.80Y-42.63D5.0
N3X-166.51Y-42.21D5.0
N10X-171.43Y20.10D6.1
N11X-85.00Y20.00D6.1
N12X-228.00Y-47.50D6.1
N13X-232.00Y-7.11D6.1
N18X29.92Y57.76D5.0
N19X0.24Y59.56D5.0
N20X-19.65Y65.32D5.0
N1X-355.Y-25.D14
N2X-315.Y-25.D14
N19X160.Y280.D14
N20X160.Y240.D14
このデータΔΔ1.txtに保存し 次に D によるグループ分けをする。
グループは O 〜M99 にまとめる。 ΔΔ2.txtに保存をする。
下例3
O
N1X-116.66Y-36.68
N2X-145.80Y-42.63
N3X-166.51Y-42.21
N18X29.92Y57.76
N19X0.24Y59.56
N20X-19.65Y65.32
M99
O
N10X-171.43Y20.10
N11X-85.00Y20.00
N12X-228.00Y-47.50
N13X-232.00Y-7.11
M99
O
N1X-355.Y-25.
N2X-315.Y-25.
N19X160.Y280.
N20X160.Y240.
M99
以上が全工程ですがどの程度可能ですか?
by AE86
|
|