-
打开原理图,点击“file”,“export”
-
输出ASCII文件到指定位置,跳出设置框,点击“select all”,“OK”
-
用notepad++或editplus等记事本软件打开,搜索netnames,尽量不要选择记事本,因为notepad++有一个很重要的技巧,能够同时操作多行,详见经验“怎样在Notepad++中列选”
-
每行各项所对应含义为,netname itemname x y ori just shx shy shori shjust shn fontinfo,
其中Justification of the text string
The value is a bit string as follows:
Bit 0 = 0 Left justified or center (X direction) justified Bit 0 = 1 Right justified
Bit 1 = 0 Bottom justified or middle (Y direction) justified Bit 1 = 1 Top justified
Bit 2 = 0 Left or right justified Bit 2 = 1 Center justified
Bit 3 = 0 Bottom or top justified Bit 3 = 1 Middle justified.
When text is rotated the definitions for bits 0 and 1 are interchanged.
-
把对应值改为相同的值,在pads logic新建一个空的原理图,点击“file”,“import”
-
更进一步可以编写脚本,实现自动对齐。
#!/usr/bin/python
# -*- coding: UTF-8 -*-
filepath = input("Please input the filepath:\n(In Powershell you can drag and drop the file!!!)\n")
file = open(filepath,"r")
rows = file.readlines()
lines = []
line = []
flag = 0
data = []
str_data = ""
str_row = ""
for row in rows:
str_row = row
if ("*NETNAMES*") in row:
flag = 1
print("flag changed: 0--1")
elif flag == 1 and (("*SHT*") in row or ("*END*") in row):
flag = 0
lines.append(line)
line = []
print("flag changed: 1--0")
elif flag == 1:
#line.append(row)
data = row.split()
if len(data) > 1:
data[3] = "0"
data[7] = "40"
data[11] = "20"
if data[4] == "90":
data[2] = "0"
data[3] = "400"
data[6] = "-40"
data[7] = "800"
data[5] = "8"
data[8] = "90"
data[10] = "10"
elif data[2][0] == "-":
data[2] = "-400"
data[6] = "-800"
data[5] = "9"
data[10] = "8"
else:
data[2] = "400"
data[6] = "1000"
data[5] = "8"
data[10] = "9"
#if data[0] == "VSYS" or data[0] == "VIO1V8":
if data[0] != "GND":
str_row = ""
for d1 in data:
str_row += (d1 + " ")
str_row += "\n"
else:
flag = flag
str_data += str_row
filepath1 = input("Please input the target file:\nBy default, you can press \"Enter\" directly!\nThe file will be rewrited!")
if filepath1 == "":
filepath1 = filepath
file = open(filepath1,"w")
file.write(str_data)
file.close()