We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-04-26 03:56 AM - edited 2023-04-26 04:09 AM
Hi all,
I have a macro call in which the user can inser their own symbol objects, and I was wondering if there was a way to detect whether the inserted name exists so that I can ignore the input if it does not whilst giving a notice about it. At the moment it just fails to generate which is highly inconvenient.
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
Solved! Go to Solution.
2023-04-27 08:23 AM - edited 2023-04-27 08:43 AM
@DGSketcher - Could you use OPEN to test for the file presence and use the return values followed by CLOSE?
Figured out how to use the text I/O to query if the file exists
channel = OPEN ("TEXT", marker_call, "library")
IF marker_call # "" & channel # -1 then !Name inserted, name exists (actually > -1)
MUL2 marker_height * (-10) * GLOB_SCALE, marker_height * 10 * GLOB_SCALE
CALL marker_call parameters ALL,
penAttribute_1 = penAttribute_1,
penAttribute_2 = penAttribute_2,
penAttribute_3 = penAttribute_3,
penAttribute_4 = penAttribute_4,
fillAttribute_1 = fillAttribute_1,
fillAttribute_2 = fillAttribute_2,
lineTypeAttribute_1 = lineTypeAttribute_1,
lineTypeAttribute_2 = lineTypeAttribute_2
DEL 1
TEXT2 0, 0, channel
else
IF i = 1 then
TEXT2 0, 0, "Marker Name Not Found"
endIF
endIF
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-04-26 03:54 PM
Could you use OPEN to test for the file presence and use the return values followed by CLOSE?
2023-04-27 04:46 AM - edited 2023-04-27 08:11 AM
folder = OPEN (called_object, "c:", "FILES")
Any idea how you would point that at the loaded libraries?
Hm. Found Runxel's thread about this...
Similar thread
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-04-27 08:23 AM - edited 2023-04-27 08:43 AM
@DGSketcher - Could you use OPEN to test for the file presence and use the return values followed by CLOSE?
Figured out how to use the text I/O to query if the file exists
channel = OPEN ("TEXT", marker_call, "library")
IF marker_call # "" & channel # -1 then !Name inserted, name exists (actually > -1)
MUL2 marker_height * (-10) * GLOB_SCALE, marker_height * 10 * GLOB_SCALE
CALL marker_call parameters ALL,
penAttribute_1 = penAttribute_1,
penAttribute_2 = penAttribute_2,
penAttribute_3 = penAttribute_3,
penAttribute_4 = penAttribute_4,
fillAttribute_1 = fillAttribute_1,
fillAttribute_2 = fillAttribute_2,
lineTypeAttribute_1 = lineTypeAttribute_1,
lineTypeAttribute_2 = lineTypeAttribute_2
DEL 1
TEXT2 0, 0, channel
else
IF i = 1 then
TEXT2 0, 0, "Marker Name Not Found"
endIF
endIF
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-04-27 08:45 AM
Hm. The OPEN command does post around 80 lines to the Session Report saying that the file is not found which is a bit excessive...
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |