图1
所以我们可手动的添加这个属性,并通过修改其属性false掉不想产生网标的block。但该方法存在缺点就是没有标识,不够直观,需要点开才能确认是否包含nlaction属性及其属性值。
图2
只能一个个的添加,选中多个,只对第一个有效。
标识“X”的位置有些会偏一点点。
但基本满足了我的需要,这里分享给大家,也希望skill脚本大牛能够改进完善。
目前实现效果如图3和图4所示。
图3
图4
图5
图6
图7
图8
图9
procedure(InstIgnore()
let((cvId inst_sel bbox_x0 bbox_y0 bbox_x1 bbox_y1 new_x0 new_y0 new_x1 new_y1 obj_list obj_list_index)
cvId = geGetEditCellView()
inst_sel=car(geGetSelSet())
; if Not find nlaction
if(dbFindProp(inst_sel 'nlAction')==nil then
; add user property nlAction ignore
dbCreateProp(inst_sel 'nlAction' 'string' 'ignore')
; get selected instance bbox dimension
bbox_x0=nth(0 nth(0 inst_sel~>bBox))
bbox_y0=nth(1 nth(0 inst_sel~>bBox))
bbox_x1=nth(0 nth(1 inst_sel~>bBox))
bbox_y1=nth(1 nth(1 inst_sel~>bBox))
; calulate noteshape ' X ' located on symbol
new_x0=bbox_x0+(bbox_x1-bbox_x0)/2.5
new_y0=bbox_y0+(bbox_y1-bbox_y0)/5
new_x1=bbox_x1-(bbox_x1-bbox_x0)/2.5
new_y1=bbox_y1-(bbox_y1-bbox_y0)/5
; draw noteshape
schCreateNoteShape( cvId 'line' 'solid' list(new_x0:new_y0 new_x1:new_y1 ) 0.025)
schCreateNoteShape( cvId 'line' 'solid' list(new_x0:new_y1 new_x1:new_y0 ) 0.025)
else
; if find nlAction property ,delete it
dbDeletePropByName(inst_sel 'nlAction')
; get selected instance bbox dimension
bbox_x0=nth(0 nth(0 inst_sel~>bBox))
bbox_y0=nth(1 nth(0 inst_sel~>bBox))
bbox_x1=nth(0 nth(1 inst_sel~>bBox))
bbox_y1=nth(1 nth(1 inst_sel~>bBox))
; selcet New Area based on selected instance
geSelectArea(hiGetCurrentWindow() list(list(bbox_x0 bbox_y0) list(bbox_x0 bbox_y1) list(bbox_x1 bbox_y1) list(bbox_x1 bbox_y0)) 'polygon')
obj_list=geGetSelSet()
obj_list_index=0
foreach(var obj_list~>objType
; find objType path ,only delete previous added noteshpe 'X'
if(var=='path' then
dbDeleteObject(nth(obj_list_index obj_list))
)
obj_list_index++
)
geSingleSelectPoint(hiGetCurrentWindow() nil list(0 0))
)
)
)
hiSetBindKey('Schematics' 'Shift<Key>Delete' 'InstIgnore()')
联系客服