We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2018-04-03 10:24 AM
2018-04-03 10:33 AM
2018-04-03 10:38 AM
Erwin wrote:Sorry, I don't quite understand. How do I implement this? I want my object to read whatever the home story is and then instead of outputting the entire text e.g "GF-Ground Floor", just output GF.
Autotext string is #DrawingID, assuming you are using the ID field for 'GF'.
2018-04-03 10:55 AM
2018-04-03 11:01 AM
Erwin wrote:#DrawingID doesn't seem to do anything. I tried <DRAWINGID> which gave me an output of #DrgID which is obviously not what I would like. The SPLIT command doesn't make much sense to me.
If you place text (or object with text) on a story and use Autotext #DrawingID in the textfield, it will display the Drawing ID on layout, which would be GF instead of 0 I guess for your project. If "GF" is part of the the DrawingName field, you would have to split up the text string or make a range of IF ... THEN statements to setup a custom parameter based on the story number.
Look at SPLIT command (page 295 in GDL Reference Guide) on how to split up a single string into multiple variables.
x = REQUEST ("Home_story", "", index, story_name)I just don't know how to do it.
2018-04-03 11:43 AM
2018-04-03 01:24 PM
n = SPLIT (story_name, "%s", num) IF n = 1 THEN text2 0, 0, num ENDIFit is currently showing as GF-Ground rather than GF-Ground Floor which is a step in the right direction but I can't get any further. I need the string to stop after the GF part.
2018-04-04 08:23 AM
x = REQUEST (“Home_story”, “”, index, story_name) n = SPLIT (story_name, "%s %s", split1, split2) IF n THEN text2 0, 0.5, story_name text2 0, 0, split1 text2 0, -0.5, split2 ENDIFWhat you actually need to do is search for the “-” character.
pos = STRSTR (story_name, "-") ! text2 0, 0, pos prefix = STRSUB (story_name, 1, pos-1) text2 0, -2, prefixOf course if the prefix is always 2 characters you know this already so you can just output the first 2 characters with STRSUB.