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

SPLIT command

fuzzytnth3
Booster
Hi a while back I posted a Keynote Label object in the freebie bit of the forum.

I would like to improve it but I'm getting stuck trying to use the SPLIT command. A bit annoying as I used it quite easily with my metal stud object.

What I'm trying to do is allow the user to make a selection from a pop up list of possible notes that he/she/it can choose from. I only want the first two digits of the selected note as that then tells the script which note to use.

The Notes look like this....

"01 Internal lining system comprising two layers",
"02 Weatherproof internal lining system comprising",
"03 Secondary steelwork to Engineer's detail WP220",
"04 Stone rainscreen cladding incorporating ",
"05 Black tissue faced mineral wool insulation WP325",
"06 Standard pressure capped PPC finished",
"07 Structural silicone glazing comprising extruded",
"08 Shopfront glazing comprising extruded",
"09 Shuffle glaz.... etc etc

In the Master script I have this...

knserial = SPLIT (kncon, "%s" , knselec)

knoteref = knselec

kncon is a parameter that the Parameter Script uses to give the user a list of possible notes to choose from

In the 2d script I have this



IF knoteref = "01" THEN GOSUB 101
IF knselec = "02" THEN GOSUB 102
IF knselec = "03" THEN GOSUB 103
IF knselec = "04" THEN GOSUB 104
IF knselec = "05" THEN GOSUB 105


but I get an error saying
Incompatible expression at line 153

I've tried getting it to extract it as a numerical expression and and as a string expression but I still get the error.

Any help would be much appreciated
AC versions 3.41 to 25 (UKI Full 5005).
Using AC25 5005 UKI FULL
Mac OSX 10.15.7 (19G2021) Mac Pro-2013 32gbRam AMD FirePro D500 3072 MB graphics
7 REPLIES 7
Frank Beister
Advisor
Why don't you use this:
IF STRSUB(kncon,1,2) = "01" THEN GOSUB 101
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
fuzzytnth3
Booster
Thanks I will give that a spin

AC versions 3.41 to 25 (UKI Full 5005).
Using AC25 5005 UKI FULL
Mac OSX 10.15.7 (19G2021) Mac Pro-2013 32gbRam AMD FirePro D500 3072 MB graphics
Frank Beister
Advisor
This should work too:
knserial = SPLIT (kncon, "%n %s" , knselec, dummystring)
knoteref = knselec
IF knoteref = 1 THEN GOSUB 101
If it does not work, you should upgrade your AC9v1 to v2, because here the v1 has a bug.

(Works without dummy in AC 8.1 too.)
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
Anonymous
Not applicable
Hello Frank,
I did not know that there was a v2 version of AC 9.
When I "get info" on my AC 9 application, it says
"version 9.0.0 v1 USA (8335/2219)".
I launched AC 9 and went to "check for updates"
and found that my version was the latest.
Are you referring to the 2219 build or is there
a v2 of the AC 9 application you have ?
Thanks,
Peter Devlin
Frank Beister
Advisor
Can't proof it and maybe you are right. The first was 18-something and the second 2219 I guess. May be they didn't call it v2, because the programmers wear a shirt "no v2 anymore" before the launch. There was a picture in the web of them.

In every case there was a bug with SPLIT in the fdirst release of AC9.
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
Anonymous
Not applicable
Thanks, Frank,
I was worried there for a minute that I had missed something
(like maybe a T shirt).
Peter Devlin
fuzzytnth3
Booster
F. wrote:
Why don't you use this:
IF STRSUB(kncon,1,2) = "01" THEN GOSUB 101
Thanks Frank that worked a treat. I shall post the latest version once I've finished tweaking the "Help" prompts I have in the object.

Thanks again
AC versions 3.41 to 25 (UKI Full 5005).
Using AC25 5005 UKI FULL
Mac OSX 10.15.7 (19G2021) Mac Pro-2013 32gbRam AMD FirePro D500 3072 MB graphics