allegro skill : copy silk to assemble

procedure( ex6_select()


from_class_value = "PACKAGE GEOMETRY"
from_subclass_value = "Silkscreen_Top"
to_class_value = "PACKAGE GEOMETRY"
to_subclass_value = "Assembly_Top"


classes_list = list("BOARD GEOMETRY" "PACKAGE GEOMETRY" "MANUFACTURING" "DRAWING FORMAT" "ETCH" "ANTI ETCH" ) 




from_layer = strcat(from_class_value "/" from_subclass_value)
to_layer = strcat(to_class_value "/" to_subclass_value)


printf("Lines copied \n from_layer :%s\n to_layer   :%s\n\n"  axlPPrint(from_layer) axlPPrint(to_layer))


;axlVisibleDesign(nil)


axlVisibleLayer(from_layer t)
axlVisibleUpdate(t)


axlSetFindFilter(?enabled list( "noall" "lines") ?onButtons list( "noall" "lines"))


copy_objs=axlGetSelSet(axlAddSelectAll())
;printf("sellect %L\n" copy_objs)


;axlVisibleLayer(to_layer t)
;axlVisibleUpdate(t)


;axlHighlightObject(copy_objs)
;foreach(o copy_objs 
;axlHighlightObject(o)
; printf("sellect %L\n" o)
;


foreach( obj, copy_objs 
  l_path = AFn_getPathFromSegments(obj ->segments )
axlDBCreatePath(l_path, to_layer)
);foreach




;axlDeleteObject(axlGetSelSet())


)


;---------------------------------------------------------------------
; external function ( can be removed if you use it )
;---------------------------------------------------------------------
defun( AFn_getPathFromSegments (segments @optional newWidth)
 let((path, end, width)
  path = axlPathStart(list(car(car(segments) ->startEnd)))
  foreach(seg, segments
    end = cadr(seg ->startEnd)
    width = newWidth || seg ->width
    case(seg ->objType
      ("line", axlPathLine(path, width, end))
      ("arc"
if(seg ->isCircle
then path = axlPathStartCircle(list(seg ->xy, seg ->radius) width)
else path = axlPathArcCenter(path, width, end, seg ->isClockwise, seg ->xy)
)
      )
    )
  )
  path
))
;---------------------------------------------------------------------
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值