Jump to content

Julian Carr

  • Content Count

  • Joined

  • Last visited

Posts posted by Julian Carr

  1. Yes, in an old PIO. It still works in 2020. Here is the code:


    Function GetColourIndex(CurrentIndex : INTEGER) : INTEGER;
        DialogID, DlogResult : INTEGER;

        Function Define_Dialog: INTEGER;
            dialogID : INTEGER;
            dialogID := CreateLayout('Choose Colour', False, 'OK', 'Cancel');
            CreateGroupBox(dialogID, 4, '', False);
            CreateControl(dialogID, 5, 2,'',0);
            SetFirstLayoutItem(dialogID, 4);
            SetBelowItem(dialogID, 4, 5, 5, 0);
            Define_Dialog := dialogID;

        Procedure Drive_Dialog(VAR item:LONGINT; data:LONGINT);
            red, green, blue : LONGINT;
            CASE item OF
                SetupDialogC: BEGIN
                    ColorIndexToRGB(CurrentIndex, red, green, blue);
                    SetColorButton(DialogID, 5, red, green, blue);
                1: BEGIN
                    GetColorButton(DialogID, 5, red, green, blue);
                    RGBToColorIndex(red, green, blue, GetColourIndex);
                2: GetColourIndex := CurrentIndex;

        DialogID := Define_Dialog;
        IF VerifyLayout(DialogID) THEN DlogResult := RunLayoutDialog(DialogID, Drive_Dialog);

  2. There is no official way to do it, however if you used CreateImageControl2() to insert the image as the first item in the dialog, you could probably then use SetBelowItem() with a large negative Y value to place the next item over the image and subsequent items below that. You will need to create a VWR file to store the image, which is simply a zip file of the image or images (without a parent folder), which you then just change the file suffix from .zip to .vwr.  If your zip/vwr file was called MyImages.vwr, and the image in there was called image1.png (use png images), then the call to place the image would be something like this:


    CreateImageControl2        (Dialog1, ItemID, 500, 400, 'MyImages/image1.png');


    The VWR file lives in the Plug-ins folder and 500/400 is the pixel size you want the image to appear in the dialog. Just make sure to preserve the image proportions. For example, this would work if the actual image was 1000 x 800 pixels, or 1500 x 1200, etc.

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

  4. This works for me:


    Procedure T;
        BeamHandle : HANDLE;
        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');

    • Like 1

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


    Procedure CheckSymbolExists;


        gsSymNameCurrent : STRING;


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



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

    • Like 1

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

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

  8. Try this slight variation (untested):


    Procedure SomeCalloutMrgnDialog;
        MrgnCall, MrgnValue,LyrScale:Real;

    Procedure GetValues;
        request:='CallOut PIO Page Unit Margin';

    Procedure SetObj_Value(H1:Handle);

        ForEachObject(SetObj_Value,(((VSEL=TRUE) & (PON='Callout'))));
        DoMenuTextByName('Previous Selection',0);


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