pcspon_ow.csc

 Corel Users' Club/Graphicsメーリングリストで生まれた「プロジェクト・コーレルスクリプトでポン」略してPCSPon!、ピーシーすぽん! 第1弾
 選択オブジェクトの輪郭(輪郭ペン)属性と一致するオブジェクトをすべて選択します。


'PCS Pon! Outline Width
'Copyright by Albatross
'Ver 1.00 2000/11/8

dim ooid as long 'original object CDRID
dim soid as long 'original object CDRID
dim lc as long 'loop counter

dim OWidth as long, OoutlineType as long, OEndCaps as long, OJoinType as long
dim OAspect as long, OAngle as long, ODotDash as long, ORArrow as long, OLArrow as long, OBehindFill as boolean, OScalePen as boolean
dim Width as long, outlineType as long, EndCaps as long, JoinType as long
dim Aspect as long, Angle as long, DotDash as long, RArrow as long, LArrow as long, BehindFill as boolean, ScalePen as boolean

'標準インストールでは以下の*.csiファイルがGraphics9\DRAW\Scripts\Scriptsに
'あり、このファイルもそこに置くと仮定する。
'ファイルのフォルダが異なる場合は以下のaddfol文を有効にしてパスを記入すること。

'#addfol  ".\scripts"
#include "ScpConst.csi"
#include "DrwConst.csi"

WITHOBJECT OBJECT_DRAW
    global oo(.GetObjectCount(false, false)) as long
    global oc as long
end withobject

'Add object list and array elements
sub addol(OID as long)
        oc=oc+1
        oo(oc)=OID
end sub

'Main routine
WITHOBJECT OBJECT_DRAW
    if .isselection()=false then
        message "オブジェクトが選択されていません"
        stop
    endif
    .SuppressPainting false

'get object properties
    oft =.getfilltype()
    ooid =.GetObjectsCDRStaticID()
    oc=1
    oo(oc)=ooid
    .GetOutline OWidth, OoutlineType, OEndCaps, OJoinType, OAspect, OAngle, ODotDash, ORArrow, OLArrow, OBehindFill,OScalePen

'find
    .selectnextobject true
    soid=.getobjectsCDRStaticID()
    while (soid<>ooid)
        .GetOutline Width, outlineType, EndCaps, JoinType, Aspect, Angle, DotDash, RArrow, LArrow, BehindFill,ScalePen
        if Width=OWidth and outlineType=OoutlineType and EndCaps=OEndCaps and JoinType=OJoinType and Aspect=OAspect and Angle=OAngle and DotDash=ODtoDash and RArrow=ORArrow and LArrow=OLArrow and BehindFill=OBehindFill and ScalePen=OScalePen then
            addol(soid)
        endif                    
        .selectnextobject true
        soid=.getobjectsCDRStaticID()
    wend

'Select
    for lc=1 to oc
        .AppendObjectToSelection oo(lc)
    next lc

    .ResumePainting 
    .RedrawScreen
END WITHOBJECT

<<戻る