TA的每日心情 | 衰 2024-2-27 15:43 |
---|
签到天数: 12 天 [LV.3]偶尔看看II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
这个skill功能是可以将Cline转换成相应层的Shape。将下面文本保存.il格式即可。调用字符cl2s
;============================================================================
; Copyright Tait Electronics Ltd., 2005. All rights reserved.
;
; Program Name: cl2s.il
;
; Author: Dave Elder, PCB Design Manager,
; Tait Electronics, Christchurch, New Zealand
; dave.elder@tait.co.nz
;
; Tested on: allegro 15.2
;
; Purpose: Convert a cline to a shape.
;
; Usage: To run the routine within Allegro type: "cl2s".
;
; History:
;
; 1.3 21-Mar-05 DE Release to Allegro Forum
;
;============================================================================
axlCmdRegister("cl2s" 'CL2S_clineToShape ?cmdType "interactive")
defun( CL2S_clineToShape ()
let((mark, popupAllActive, popupGrayOops, oldSetData, endType, pt, clines, cline, layer, netName, parent, polys, (oopsCount 0), n)
mark = axlDBTransactionStart()
popupAllActive = axlUIPopupDefine(nil '(
("Done" "axlDBTransactionCommit(mark), axlFinishEnteRFun()")
("Oops" "axlDBTransactionOops(mark), when(zerop(--oopsCount), axlUIPopupSet(popupGrayOops))")
("Cancel" "axlDBTransactionRollback(mark), axlCancelEnterFun()")
("MENU_SEPARATOR", nil)
("Toggle End Cap Type"
"endType = nthelem( n++ list( 'SQUARE, 'ROUND, 'OCTAGON))
printf(\"Select cline (End Cap Type will be %s)\\n\", endType)
if( n > 3, n = 1)"
)
))
axlUICmdPopupSet(popupAllActive)
popupGrayOops = axlUIPopupDefine(nil, '(
("Done" "axlDBTransactionCommit(mark), axlFinishEnterFun()")
("Cancel" "axlDBTransactionRollback(mark), axlCancelEnterFun()")
("Toggle End Cap Type"
"endType = nthelem( n++ list( 'SQUARE, 'ROUND, 'OCTAGON))
printf(\"Select cline (End Cap Type will be %s)\\n\", endType)
if( n > 3, n = 1)"
)
))
axlUIPopupSet(popupGrayOops)
endType = 'OCTAGON
n = 1
oldSetData = list(axlGetSelSet(), axlGetFindFilter(nil), axlGetFindFilter(t))
axlSetFindFilter(?enabled list("noall", "CLINES"), ?onButtons list("noall", "CLINES"))
while(pt = axlEnterPoint(?prompts sprintf(nil, "Select cline (End Cap Type will be %s)", endType))
axlClearSelSet()
while(axlAddSelectPoint(pt), t); necessary to add all objects at point
clines = axlGetSelSet()
caseq(length(clines)
(0, axlUIWPrint(nil, 'error, "No cline Here"))
(1
cline = car(clines), layer = cline ->layer, netName = cline ->net ->name, parent = cline ->parent
polys = axlPolyFromDB(cline ?endCapType endType)
if(polys then
axlDBTransactionMark(mark), axlUIPopupSet(popupAllActive), oopsCount++
axlClearSelSet(); Require for Allegro transaction bug that does not clear the find bit (Courtesy fxf).
axlDeleteObject(cline)
foreach(poly, polys, axlDBCreateShape(poly, t, layer, netName, and(parent ->objType, parent)))
else axlUIWPrint(nil, 'error, "Sorry. Could not convert this cline.")
)
)
(t, axlUIWPrint(nil, 'error, "Multiple clines Here. Pick again"))
); caseq
); while
axlSetFindFilter(?enabled cons("noall", cadr(oldSetData)) ?onButtons cons("noall", caddr(oldSetData)))
axlSingleSelectObject(car(oldSetData))
axlDBTransactionCommit(mark)
axlFinishEnterFun()
))
|
|