Julian Carr Posted November 11, 2021 Share Posted November 11, 2021 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. Quote Link to comment
Peter Vandewalle Posted November 11, 2021 Share Posted November 11, 2021 I think runscript would be able to do this. Once you get the handle to the door object, go for the parent object to get the symbol. Could that work? Quote Link to comment
Julian Carr Posted November 12, 2021 Author Share Posted November 12, 2021 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: but there is no way to combine the door ID, Unit Type and Unit No. that I can see?? Quote Link to comment
Peter Vandewalle Posted November 12, 2021 Share Posted November 12, 2021 Just thinking out loud… I suppose that if you use a database list of the doors with INSYMBOL, the handles are referring to the door in the symbol definition? And the x and y position values also? If that’s the case I’m afraid we’re running into the limits of worksheets… Quote Link to comment
Recommended Posts
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.