EDA365电子工程师网

标题: 【源码】按页摆放零件之源码【强烈建议365源码开源】 [打印本页]

作者: shirdon    时间: 2012-2-16 20:27
标题: 【源码】按页摆放零件之源码【强烈建议365源码开源】
本帖最后由 shirdon 于 2012-2-16 20:52 编辑
  1. ;---------------------------------------------------------------------------

  2. ; pg_placement.il ver0.1
  3. ; ------------by shirdon

  4. ; This program can attach the page property to component.


  5. ; I can be reached by:

  6. ; shirdon1@163.com



  7. ;--------------------------------------------------------------------
  8. axlCmdRegister( "pp" '_pg_placement)

  9. defun(_pg_placement ()

  10.     prog((pgfile )

  11.              pgFile = infile( "./pg.xrf" ); read a file named pg1.xrf

  12.             when(pgFile ;pg1.xrf existed

  13.                      while(gets(nextline pgFile) ;-read a line from the file [loop] until readling finished

  14.                              line_lst = parseString(nextline "\t");-make some line from string to list

  15.                              if( length(line_lst) == 6 then ;-if line_lst contains 6 elements

  16.                                        refdes_name = nthelem(3 line_lst) ;-get the third element from the list[line_lst]

  17.                                        page_no = nthelem(5 line_lst);-get the fifth element from the list[line_lst]

  18.                                        if(atof(page_no) then ;-atof(page_no) whether number

  19.                                                   axlClearSelSet()

  20.                                                   axlSetFindFilter(?enabled '("noall" "alltypes" "nameform")
  21.                                                   ?onButtons "alltypes")

  22.                                                   axlSingleSelectName( "component" refdes_name)

  23.                                                 axlDBCreatePropDictEntry( "Page" "INTEGER" list( "components")) ;-set the page  

  24.                                                 axlDBAddProp(axlGetSelSet() list( "Page" truncate(atof(page_no))))
  25.                                                 
  26.                                                 sprintf(info_n "%s has attached the property Page %s" refdes_name page_no)

  27.                                                  println(info_n)

  28.                                       );end if

  29.                              );end if

  30.                     );end while

  31.             );end when

  32.         print("Page property ok")

  33.         close(pgFile)

  34.         axlClearSelSet()

  35.       )
  36. )
复制代码



该程序简单易懂,用于学习分享【提倡开源】


对于该程序的执行方式请参照 deargds的  https://www.eda365.com/thread-4373-1-1.html  【将xpart.xrf 改为pg.xrf即可,也可按照自己的习惯更改】


不过该程序是开源的,便于大家讨论更新,甚至扩展

快捷方式:pp

[attach]48916[/attach]




作者: shirdon    时间: 2012-2-28 12:42
更新一下,
将 if( length(line_lst) == 6 then 【不知道这句为什么没有执行上】

改为when( line_lst && length(line_lst) >5    【后执行ok】


这个程序对线路图无页数限制】
作者: nice0513    时间: 2012-3-1 11:26
mark
作者: hampzhm    时间: 2012-3-1 13:49
原理图是针对什么工具的
作者: shirdon    时间: 2012-3-1 17:54
update [attach]49632[/attach]

refer ro orcad
作者: Mako    时间: 2012-3-13 13:40
shirdon 发表于 2012-3-1 17:54
update

refer ro orcad


请问,怎么用呢?能详细告知吗?
作者: shirdon    时间: 2012-3-13 20:24

对于该程序的执行方式请参照 deargds的  https://www.eda365.com/thread-4373-1-1.html  【将xpart.xrf 改为pg.xrf即可,也可按照自己的习惯更改】




快捷方式:pp

作者: joshuafu    时间: 2012-3-14 14:14
一直希望有一个按ConceptHDL原理图摆放的,哪位大牛能提供一下啊?
作者: shirdon    时间: 2012-3-14 22:50
joshuafu 发表于 2012-3-14 14:14
一直希望有一个按ConceptHDL原理图摆放的,哪位大牛能提供一下啊?

https://www.eda365.com/thread-38785-1-1.html
作者: 长天落彩霞    时间: 2012-3-20 10:50
哈哈,昨天正好也在研究这个。
作者: 长天落彩霞    时间: 2012-3-20 12:36
axlClearSelSet()
axlSetFindFilter(?enabled '("noall" "alltypes" "nameform") ?onButtons "alltypes")
axlSingleSelectName( "component" refdes_name)

貌似这三句可以用axlSelectByName这个函数来替换,不知道行不行!
作者: mako88    时间: 2012-3-27 11:18
非常感谢!
作者: joshuafu    时间: 2012-3-29 15:20
shirdon 发表于 2012-3-14 22:50
https://www.eda365.com/thread-38785-1-1.html

那个有问题,不能用啊
作者: sp507    时间: 2013-6-13 17:02
学习了,收藏了~~
作者: newcomsky    时间: 2013-12-12 08:14
标记一下啊,好啊
作者: asd0252    时间: 2014-2-18 10:52
感謝分享
使用ok
作者: xinpcb    时间: 2014-2-28 09:33
看不到
作者: 螭虎    时间: 2014-4-1 22:47
好东西,谢谢分享
作者: kkman2000    时间: 2015-8-21 21:40
支持支持支持  非常感謝
作者: carol8688    时间: 2015-9-21 15:30
學習
作者: xie921220    时间: 2015-9-22 09:59
有用吗?那就再也不用LST了
作者: xie921220    时间: 2015-9-22 10:00
有用吗?那就再也不用LST了
作者: shirdon    时间: 2015-9-23 10:34
真心有用,西西,




欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/) Powered by Discuz! X3.2