レイアウトSKILLマクロ関数のサンプルです。
Expand Shrink Path :既存Pathの端(エッジ選択)を任意の方向に曲げるor伸縮
※mosaicを選択していた場合はuX,uYが変わります。その他、自前Pcell用の動作も入ってます。
pathのみにしたければcase文の他の分岐箇所を削除してください。
;----------------------------------------
;@ NAME @ (shi_ExpandShrink ?mosaic_dx ?mosaic_dy ?path_dx ?path_dy)
;@ EXPL @ mosaic/pc_VIA/pc_VIA0/pc_CONNECT ... expand/shrink uX/uY/pitch_x/pitch_y
; path ... expand/shrink path line (not width)
;@USAGE @
;----------------------------------------
(procedure (shi_ExpandShrink @key (mosaic_dx 0.1) (mosaic_dy 0.1) (path_dx 0.5) (path_dy 0.5))
(foreach s (geGetSelectedSet)
(case s~>objType
;#--- mosaic ---#
("mosaic"
(when mosaic_dx (s~>uX = (s~>uX + mosaic_dx)))
(when mosaic_dy (s~>uY = (s~>uY + mosaic_dy)))
) ; "mosaic"
;#--- inst(pc_CA/pc_VIA/pc_VIA0/pc_CONNECT) ---#
("inst"
(cond
((equal s~>cellName PCELL_CA_NAME)
(let
(
(x_space (or (dbFindProp s "x_space") (dbCreateProp s "x_space" "float" 0.0)))
(y_space (or (dbFindProp s "y_space") (dbCreateProp s "y_space" "float" 0.0)))
)
(x_space~>value = (x_s_prop~>value + mosaic_dx))
(y_space~>value = (y_s_prop~>value + mosaic_dy))
)
) ; PCELL_CA_NAME
((or (equal s~>cellName PCELL_VIA0_NAME) (equal s~>cellName PCELL_VIA_NAME))
(let
(
(plus_x_space (or (dbFindProp s "plus_x_space") (dbCreateProp s "plus_x_space" "float" 0.0)))
(plus_y_space (or (dbFindProp s "plus_y_space") (dbCreateProp s "plus_y_space" "float" 0.0)))
)
(plus_x_space~>value = (plus_x_space~>value + mosaic_dx))
(plus_y_space~>value = (plus_y_space~>value + mosaic_dy))
)
) ; PCELL_CONNECT_NAME || PCELL_VIA_NAME
((equal s~>cellName PCELL_CONNECT_NAME)
(let
(
(pitch_x (or (dbFindProp s "pitch_x") (dbCreateProp s "pitch_x" "float" PC_CONNECT_PITCH_X)))
(pitch_y (or (dbFindProp s "pitch_y") (dbCreateProp s "pitch_y" "float" PC_CONNECT_PITCH_Y)))
)
(pitch_x~>value = (pitch_x~>value + mosaic_dx))
(pitch_y~>value = (pitch_y~>value + mosaic_dy))
)
) ; PCELL_CONNECT_ANEM
) ; cond
) ; "inst"
;#--- path ---#
("path"
(let ((ps s~>points) (ps_isReversed nil))
;if edge select
(unless (car (geGetSelSetFigPoint s))
(setq ps (reverse ps))
(setq ps_isReversed t)
)
(let ((p0 (car ps)) (p1 (cadr ps)) (p_new nil))
(setq ps
(cond
((and (zerop path_dx) path_dy (eqv (xCoord p0) (xCoord p1)))
(cons (Point_translate_XY p0 0.0 path_dy) (cdr ps))
)
((and path_dx (zerop path_dy) (eqv (yCoord p0) (yCoord p1)))
(cons (Point_translate_XY p0 path_dx 0.0) (cdr ps))
)
(t
(setq p_new (Point_translate_XY p0 path_dx path_dy))
(cons p_new ps)
)
) ; cond
) ; setq ps
(when ps_isReversed
(setq ps (reverse ps))
)
(s~>points = ps)
(when p_new
(geSelectArea (hiGetCurrentWindow)
(list
(Point_translate_XY p_new -0.00025 -0.00025)
(Point_translate_XY p_new +0.00025 +0.00025)
)
)
) ; when
) ; let - p0, p1, p_new
) ; let - ps, ps_isReversed
) ; "path"
) ; case
) ; foreach
) ; procedure
; ----------------------------------------------------------------------------- ; (Point_translate_XY this dx dy) ; ----------------------------------------------------------------------------- ; 点 this に対して X方向に dx、Y方向に dy だけ離れた位置の点を生成する汎用の関数。 ; ----------------------------------------------------------------------------- (define (Point_translate_XY this dx dy) (range (plus (car this) dx) (plus (cadr this))) )