Zoom 到 0 0 原点 或指定坐标点

本文由 shirdon 于 2014-7-29 15:24 发布在  SKILL源码下载    

    这个程序功能:zoom到 0 0点 或指定坐标

    使用命令: 1 .直接在Allegro命令框输入 go ,回车zoom放大到 0 0 原点坐标;

                    2. 在命令框输入 go x y,zoom到 (x,y)坐标

 

    为了尊重开发者,轻保留开发者名称,谢谢!希望对各位layout工作人员有所帮助!

;--------------------------------------------------------------------------------------------------------------------------------------------------
;Written by: 	Dongle Hu
;		Cadence Design Systems
;		ubestch@hotmail.com
;                 http://www.eelayout.com
;		Run with Application: Allegro, SPB
;		Tested against versions 15.51 & 16.6
;
; This program will auto zoom into a exist point
;--------------------------------------------------------------------------------------------------------------------------------------------------
axlCmdRegister( "go" '_GOsuercoordinate ?cmdType "@optional")

defun(_GOsuercoordinate (@optional (vc "")   (vb ""))
	
	prog((P_x P_y Un C_on x1 y1 x2 y2 path all)
	
		layer_pa = "BOARD GEOMETRY/COORNATE"
		
		theOldVisablity = axlVisibleGet() 
	
		 if(axlOKToProceed() != t
       
		then
          
			axlMsgPut("Finish current command first-sh")
       
		else
		
		axlClearDynamics()  ;Clear the dynamic buffer
	
		axlClearSelSet()   ;Clear the chosen data

		P_x= evalstring(vc) ;tranfer string to float data
        
		P_y= evalstring(vb)
	 
		Un=(axlDBGetDesignUnits) ;get design's unit
	        
		case(car(Un)
		         ("millimeters" 
		                 C_on=6
		         )
                         ("mils"
                                 C_on=240
			 )	
		 )
		 
		 if( axlIsLayer(layer_pa) then
		 
			axlSetFindFilter(?enabled list("noall" "lines" )
                                      ?onButtons list( "lines" ))
				         
			axlVisibleDesign(nil)
			
			axlVisibleLayer(layer_pa t)
			
			axlVisibleUpdate(t)
			
			axlAddSelectAll()
			
			axlDeleteObject(axlGetSelSet())
		
			
		 
		 else
		axlLayerCreateNonConductor(layer_pa)  ;create a new non_etch layer
      
		axlVisibleLayer(layer_pa t)  ; display the layer 
	
		axlVisibleUpdate(t) ;update all layer display
		
		)
		 
		if(vc!= "" && vc!= "" then
			
			x1=P_x+C_on
			
			y1=P_y+C_on

			x2=P_x-C_on
	
			y2=P_y-C_on

			path= axlPathStart( (list x2:y1))  ;choose a start point when creating a new "line"
               
			axlPathLine( path, 0.0, x1:y2 ) ;;choose a end point when creating a new "line"  	
             
			axlDBCreatePath( path, layer_pa) ;creating the new "line"  

			path= axlPathStart( (list x2:y2)) 
               
			axlPathLine( path, 0.0, x1:y1 )   	
              
			axlDBCreatePath( path, layer_pa)
		
		else

			x1=C_on
			
			y1=C_on

			x2=-C_on

			y2=-C_on

			path= axlPathStart( (list x2:0)) 
               
			axlPathLine( path, 0.0, x1:0 )   	
             
			axlDBCreatePath( path, layer_pa)

			path= axlPathStart( (list 0:y2)) 
               
			axlPathLine( path, 0.0, 0:y1 )   	
              
			axlDBCreatePath( path, layer_pa)

		)	
			axlClearSelSet()
				
			axlSetFindFilter(?enabled list("noall" "lines" )
                                      ?onButtons list( "lines" ))
               
			axlAddSelectBox(list(x2:y1 x1:y2))
			
			axlHighlightObject(axlGetSelSet())
			
			axlZoomToDbid(axlGetSelSet() t)
		
			axlFlushDisplay()

			axlClearDynamics()
	
			axlClearSelSet()
			
			axlVisibleDesign(nil)
		
			axlVisibleSet(theOldVisablity)
			
			axlVisibleLayer(layer_pa t)
	
			axlFlushDisplay()

		)

	)

)

下载地址 :      SH_zoom_xy_center.7z

 

 

 

 

标签: zoom 原点 坐标

评论:

cherry    2014-07-30 12:46
SKILL怎么用哦?
Dongle    2014-07-30 13:49
@cherry:http://www.eelayout.com/?post=9Cadence Allegro SKILL语言讨论和交流
在PCBENV 下面建一个名为allegro后缀为ilinit的文档,可以用写字板或者像UE 程序编译之类的软件,设置语法如下
setSkillPath(buildString(append1(getSkillPath() "D:/Cadence/SPB_16.6/skill")));
load("xxx.il");
load("xxx.il");



“D:/Cadence/SPB_15.7/skill”就是设定好的SKILL 文件夹的位置,注意“/”而不是“\”,“xxx.il”代表着所要加载的函数。现在可以把所需的skill函数全部放在SKILL文件夹里就可以了。

发表评论:

电子布局网  |  手机版  |  RSS  |  我要留言

All Rights Reserved. Powered by 电子布局--

sitemap

Free Web Hosting