Jump to content

Julian Carr

Distributor
  • Content Count

    217
  • Joined

  • Last visited

Posts posted by Julian Carr


  1. I guess the first question is why does your PIO need to reset when the zoom level changes? Generally this should not be necessary. Ignoring that for the moment, if this were possible it could only work in an event enabled PIO using SetObjPropVS(). I don't have the full list at hand, but this is the function that allows PIOs to reset if there are layer scale or layer elevation changes, for example.


  2. This works for me:

     

    Procedure T;
    VAR
        BeamHandle : HANDLE;
    BEGIN
        BeamHandle:=CreateCustomObjectN('Wide Flange - 3D',0,0,0,FALSE);
        SetRField(BeamHandle,'Wide Flange - 3D','__series_2', 'AISC (Metric)');
        SetRField(BeamHandle,'Wide Flange - 3D','__size_2', 'W200 x 22.3');
        SetRField(BeamHandle,'Wide Flange - 3D','Length', '3000mm');
        SetRField(BeamHandle,'Wide Flange - 3D','__current_series', '2');
        SetRField(BeamHandle,'Wide Flange - 3D','__current_size_2', 'W200 x 22.3');
        Set3DRot(BeamHandle,0,45,0,0,0);
        ResetObject(BeamHandle);
    END;
    Run(T);

    • Like 1

  3. 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

  4. 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. 


  5. 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.


  6. 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);

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...