Jump to content

Julian Carr

Distributor
  • Posts

    320
  • Joined

  • Last visited

Posts posted by Julian Carr

  1. Unfortunately this is not possible as it was developed specifically for the Australian and New Zealand markets, and there would be a lot of work involved to start supporting other countries, some of which have very different standards or ways of displaying compliance.

  2. Yeah that was my exact thinking too Peter and the first thing I tried. The parent is the symbol definition though, not the symbol instance. I then wrote a DatabaseByScript script to build a list of the symbol instances, then look inside those for the doors:
     

    Procedure Test;

        Procedure DoIt(h1 : HANDLE);
        VAR
            h2, h3, h4 : HANDLE;
            s1 : STRING;
        BEGIN
            WSScript_AddHandle(h1); { add handle to symbol instance }
            s1 := GetSymName(h1);
            h2 := GetObject(s1);
            h3 := FInSymDef(h2);
            REPEAT
                IF GetType(h3) = 68 THEN BEGIN
                    h4 := FIn3D(h3);
                    REPEAT
                        IF GetType(h4) = 86 THEN WSScript_AddHandle(h4); { add handle to door objects }
                        h4 := NextObj(h4);
                    UNTIL h4 = Nil;
                END;
                h3 := NextObj(h3);
            UNTIL h3 = Nil;
        END;

    BEGIN
        ForEachObject(DoIt, (T=15));
    END;
    Run(Test);

     

    This gets the data I need on different rows:

    681676732_ScreenShot2021-11-12at11_08_18am.thumb.png.0e4cd8cca136bea0081873dc6142e392.png

     

    but there is no way to combine the door ID, Unit Type and Unit No. that I can see??

     

     

    • I am using symbols for repeated apartments in a building.
    • Each apartment symbol instance has a record attached that contains a field for the apartment type and apartment number.
    • The apartments contain doors in walls that need to be numbered in a schedule, and the required numbers are a concatenation of the door ID + apartment type + apartment number. So in one WS row I need to derive the three bits of data.
    • A DB worksheet reporting doors with INSYMBOL will identify the door objects, but these are derived from the symbol definition and not the symbol instances, so there is no path to the apartment information there. Using DatabaseByScript I can build a DB that contains handles to the door objects and apartments in separate rows, but there is no ability to mix that data.

     

    Can anyone think of an approach where this might work, using DatabaseByScript and/or RunScript? For example, is it possible for a DatabaseByScript script to not only build a list of handles, but to populate cells in the row via WSScript_SetResStr()?

     

    Thanks.

  3. Explode = SymbolToGroup() = STG. If it will be a PIO and you want to rotate a symbol in the Z axis, then it must not be hybrid. You will need to investigate a way to restore the view after you switch it to 3D for the STG. Alternatively if the symbols don't contain groups or nested symbols, then you could get a handle to the symbol definition, enter the definition, loop through and duplicate 3D objects then use SetParent() to move them to the PIO, all within BeginGroup/EndGroup, then rotate the group.

    • Like 1
  4. Assuming this is just a script not a PIO, this should work:

     

    VSave('XYZ');

    DoMenuTextByName('Standard Views', 2); { top}

    Explode;

    VRecall('XYZ');

    VDelete('XYZ');

     

    Also, the following will be true for a 3D object (mostly):  GetObjectVariableBoolean(h1, 650);

  5. It works in my code as does this:

     

                BeginGroup;
                    Symbol(GetSymName(hSym), x1, y1, GetSymRot(hSym));
                    SymbolToGroup(LNewObj, 2);
                EndGroup;
                hGroup := LNewObj;

     

    But does SetRot3D() support groups? 

  6. Even better as a function:

     

    Function GetDimAngle(h1 : HANDLE) : REAL;
    VAR
        h2 : HANDLE;
        i1 : INTEGER;
        r1 : REAL;
        b1, b2, b3 : BOOLEAN;
    BEGIN
        h2 := FIn3D(h1);
        REPEAT
            IF (GetType(h2) = 2) THEN BEGIN 
                GetMarker(h2, b2, b3, i1, r1);
                IF b2 | b3 THEN BEGIN
                    b1 := True;
                    GetDimAngle := HAngle(h2);
                END;
            END;
            h2 := NextObj(h2);
        UNTIL (h2 = Nil) | b1;
    END;

    • Like 2
  7. Hi Dom,

     

    Try this:


    Procedure T;
    VAR
        h1 : HANDLE;
        b1, b2, b3 : BOOLEAN;
        i1 : INTEGER;
        r1, rAngle : REAL;
    BEGIN
        h1 := FIn3D(FSActLayer);
        REPEAT
            IF (GetType(h1) = 2) THEN BEGIN 
                GetMarker(h1, b2, b3, i1, r1);
                IF b2 | b3 THEN BEGIN
                    b1 := True;
                    rAngle := HAngle(h1);
                END;
            END;
            h1 := NextObj(h1);
        UNTIL (h1 = Nil) | b1; 
        Message('Angle is: ', rAngle);
    END;
    Run(T);

  8. I think you'll need something like this (untested):

     

    Function DoesClassExist(sMyClassName : STRING) : BOOLEAN;
    VAR
        i1 : INTEGER;
    BEGIN
        DoesClassExist := False;
        FOR i1 := 1 TO ClassNum DO BEGIN
            IF ClassList(i1) = sMyClassName THEN BEGIN
                DoesClassExist := True;
                i1 := ClassNum;
            END;
        END;
    END;

×
×
  • Create New...