Jump to content
Developer Wiki and Function Reference Links ×

Door Numbering for Apartments

Julian Carr

Recommended Posts

  • 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()?



Link to comment

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);
        h2, h3, h4 : HANDLE;
        s1 : STRING;
        WSScript_AddHandle(h1); { add handle to symbol instance }
        s1 := GetSymName(h1);
        h2 := GetObject(s1);
        h3 := FInSymDef(h2);
            IF GetType(h3) = 68 THEN BEGIN
                h4 := FIn3D(h3);
                    IF GetType(h4) = 86 THEN WSScript_AddHandle(h4); { add handle to door objects }
                    h4 := NextObj(h4);
                UNTIL h4 = Nil;
            h3 := NextObj(h3);
        UNTIL h3 = Nil;

    ForEachObject(DoIt, (T=15));


This gets the data I need on different rows:



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



Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...