Board logo

标题: 有谁对basic scripting-----basic editor这块比较熟的,帮忙进来看看 [打印本页]

作者: threedays    时间: 2005-9-2 10:01     标题: 有谁对basic scripting-----basic editor这块比较熟的,帮忙进来看看

我在libary中编辑了一个器件封装,特地在manage liabry attributes添加器件属性“制作:某某某”,想在basic scripts中以excel part list report的方式导出时可以在其中一个列中观察到。想必需要通过修改excel part list report 代码,但是不知道怎么修改,我不清楚它的固定参数像:ActiveDocument.Components、PartType、Name、Decal、Pins.Count等这哪里有定义,谁能够帮帮我?
excel part list report 的原代码是这样的:(红色部门为我添加的,蓝色处有请专家提点)
Sub Main
' Open temporarly text file
Randomize
filename = DefaultFilePath & "\tmp"  & CInt(Rnd()*10000) & ".txt"
Open filename For Output As #1
' Output Headers
Print #1, "artType"; Space(22);
Print #1, "RefDes";  Space(24);
Print #1, "artDecal"; Space(22);
Print #1, "ins";  Space(6);
Print #1, "Layer";  Space(26);
Print #1, "Orient.";  Space(24);
Print #1, "X";   Space(30);
Print #1, "Y";   Space(29);
Print #1, "SMD";  Space(7);
Print #1, "Glued";  Space(7);
Print #1, "Editor";  Space(0)

' Lock server to speed up process
LockServer
' Go through each component in the design and output values
For Each nextComp In ActiveDocument.Components
  Print #1, nextComp.PartType; Space$(30-Len(nextComp.PartType));
  Print #1, nextComp.Name;  Space$(30-Len(nextComp.Name));
  Print #1, nextComp.Decal;  Space$(30-Len(nextComp.Decal));
  Print #1, nextComp.Pins.Count; Space$(10-Len(nextComp.Pins.Count));
  Print #1, ActiveDocument.LayerName(nextComp.layer); Space$(30-Len(ActiveDocument.LayerName(nextComp.layer)));
  Print #1, nextComp.Orientation; Space$(30-Len(nextComp.Orientation));
  Print #1, nextComp.PositionX; Space$(30-Len(nextComp.PositionX));
  Print #1, nextComp.PositionY; Space$(30-Len(nextComp.PositionY));
  Print #1, nextComp.IsSMD;  Space$(10-Len(nextComp.IsSMD));
  Print #1, nextComp.Glued;  Space$(10-Len(nextComp.Glued));
Print #1, nextComp.???????(10-Len(nextComp.?????))
  

Next nextComp
' Unlock the server
UnlockServer
' Close the text file
Close #1

' Start Excel and loads the text file
On Error GoTo noExcel
Dim excelApp As Object
Set excelApp = CreateObject("Excel.Application")
On Error GoTo 0
excelApp.Visible = True
excelApp.Workbooks.OpenText  FileName:= filename
excelApp.Rows("1:1").Select
With excelApp.Selection
  .Font.Bold = True
  .Font.Italic = True
End With
excelApp.Range("A1").Select
Set excelApp = Nothing
End
noExcel:
' Display the text file
Shell "Notepad " & filename, 3
End Sub




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0