We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Subtype request

Rob
Graphisoft
Graphisoft
How could I request the lib.part subtype lets say from a called macro?
In other words I want to have a macro that could recognise the subtype of the main (calling) script like eg. sectionmarker or detailmarker etc.
The closest match I could have found in the help is REQUEST ("ANCESTRY_INFO", expr, name [,guid, parent_name1, parent_guid1,..., however I do not have an idea how to use that, the help explanation is rather perplexing (at least for me). Any thoughts fellos?
::rk
1 REPLY 1
Frank Beister
Moderator
Try this inside an calling and macro object and gamble a bit. Try to label the object too.
s=-1 ! Line spacing

DIM parents[]
n = REQUEST ("ANCESTRY_INFO", 0, name, guid, parents)

IF n THEN
  TEXT2 0,0, "Replaces: " + name + " / " + guid
  ELSE
  TEXT2 0,0, "No results."
  ENDIF
TEXT2 0,s, "Parents:"
ADD2 0,s*2

IF n > 2 THEN
  FOR i = 1 to n - 2 STEP 2
    TEXT2 t,0, parents + " / " + parents[i+1]
    ADD2 0,s
    NEXT i
  ELSE
  ADD2 0,s
  ENDIF

ADD2 0,s


DIM childs[]
n = REQUEST ("ANCESTRY_INFO", 1, name, guid, childs)
IF n THEN
  TEXT2 0,0, "Replaces: " + name + " / " + guid
  ELSE
  TEXT2 0,0, "No result."
  ENDIF
TEXT2 0,s, "Childs:"
ADD2 0,s*2

IF n > 2 THEN
  FOR i = 1 to n - 2 STEP 2
    TEXT2 t,0, childs + " / " + childs[i+1]
    ADD2 0,s
    NEXT i
  ELSE
  ADD2 0,s
  ENDIF
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm