Jump to content

Julian Carr

Distributor
  • Posts

    320
  • Joined

  • Last visited

Posts posted by Julian Carr

  1. Untested, but something like this should work...

     

    Procedure CheckSymbolExists;

    VAR

        gsSymNameCurrent : STRING;

     

    Function DoIt(h1 : HANDLE) : BOOLEAN;
    VAR
        sSymNameExist : STRING;
    BEGIN
        IF (h1 <> Nil) & (GetType(h1) = 16) THEN BEGIN
            sSymNameExist := GetSDName(h1);
            IF sSymNameExist = gsSymNameCurrent THEN SysBeep;
        END;
    END;

     

    BEGIN

        gsSymNameCurrent := StrDialog('Symbol name to search for:', '');
        ForEachObjectInList(DoIt, 0, 2, FSymDef);
    END;
    Run(CheckSymbolExists);

    • Like 1
  2. It sometimes behaves like this Pat but I just tolerate the quirkiness and restart VW, Edit/Exit the WS Editor, etc. until it works. Typical of VS though. You steam along making great progress then something like this of another odd result stops you in your tracks. 

  3. Draw a rectangle on any sheet layer, that is just a bit bigger than the page size. Give it a unique name like 'Custom-Select-Rect'. Run the script below and substitute your PIO name for My PIO Name

     

    ForEachObject(SetSelect, ((LOC='Custom-Select-Rect') & (PON='My PIO Name')));

     

    This will select the objects on ALL sheet layers.

  4. Try this slight variation (untested):

     

    Procedure SomeCalloutMrgnDialog;
    Var    
        H1:Handle;
        B1:Boolean;
        MrgnCall, MrgnValue,LyrScale:Real;
        MrgnValueStrng,default,request:String;

    Procedure GetValues;
    Begin
        
        request:='CallOut PIO Page Unit Margin';
        default:='0.0625';
        
        MrgnCall:=DistDialog(request,default);
        
        LyrScale:=GetLScale(ActLayer);
        MrgnValue:=LyrScale*MrgnCall;
        
        MrgnValueStrng:=Concat(MrgnValue);
    End;

    Procedure SetObj_Value(H1:Handle);
    Begin
        
        SetRField(H1,'Callout','Margin',MrgnValueStrng);
        
        ResetObject(H1);
        
        SetDSelect(H1);
        
    End;
        

    Begin
        GetValues;
        ForEachObject(SetObj_Value,(((VSEL=TRUE) & (PON='Callout'))));
        DoMenuTextByName('Previous Selection',0);
        
    End;
    Run(SomeCalloutMrgnDialog);

  5. It's possible you have picked up an invisible character by copying from the browser. Try deleting the last line and everything below it then retyping it manually. Or copy the script to a text editor and turn on invisible characters to see if you can spot something.

  6. You can do this using the single most powerful procedure in VS: ForEachObject. It also filters out other object so will only affect dimensions in this case.

     

    PROCEDURE DimTypical;

    PROCEDURE DoIt(h1 : HANDLE);
    BEGIN
        SetObjectVariableString(h1, 10, ' Typ.');
        ResetObject(h1);
    END;
    BEGIN
        ForEachObject(DoIt, (T=DIMENSION) & Sel);
    END;
    Run(DimTypical);

×
×
  • Create New...