2022-06-18 01:09 AM - edited 2022-06-18 01:10 AM
Hello,
I have created a very simple GDL object. It currently only contains a 2D script that allows the user to modify a couple of points using hotspots:
FOR i=1 TO VARDIM1(points) STEP 1
_id = i * 6
HOTSPOT2 points[i][1], 0, i+0, points[i][2], 1 + 128 ! BASE
HOTSPOT2 points[i][1], 0, i+1, points[i][2], 3 ! REFERENCE
HOTSPOT2 points[i][1], points[i][2], i+2, points[i][2], 2 ! MOVING
HOTSPOT2 0, points[i][2], i+3, points[i][1], 1 + 128 ! BASE
HOTSPOT2 0, points[i][2], i+4, points[i][1], 3 ! REFERENCE
HOTSPOT2 points[i][1], points[i][2], i+5, points[i][1], 2 ! MOVING
IF i < VARDIM1(points) THEN
LINE2 points[i][1], points[i][2], points[i+1][1], points[i+1][2]
ENDIF
NEXT i
In Action:
Then i save the object to disk File -> Libraries and Objects -> Save Selection as... -> Object
(Selecting browse instead of embedded library)
When opening the saved .gsm file again the 2D script has changed (compared to the code that I posted above):
!
! Name : test.gsm
! Date : Saturday, June 18, 2022
! Version : 25.00
! Written by Archicad
!
mul2 A/13.599278, B/5.216145
add2 29.01578502415, -36.78886568381
drawindex 10
pen penAttribute_1
set line_type lineTypeAttribute_1
add2 -30.01578502415, 35.78886568381
DIM tmp_points[3][2]
tmp_points[1][1] = 1
tmp_points[1][2] = 1
tmp_points[2][1] = 4.205397216681
tmp_points[2][2] = 6.216144840519
tmp_points[3][1] = 14.59927750822
tmp_points[3][2] = 1.3551285825
call "road",
PARAMETERS A = 1, B = 1, ZZYZX = 1,
AC_show2DHotspotsIn3D = 1, ac_bottomlevel = 1,
ac_toplevel = 0, points = tmp_points
del 1
How can i tell Archicad not to mess with the scripts (2D in this case) when the object is saved to disk?
Thanks.
Solved! Go to Solution.
2022-06-18 11:04 PM - edited 2022-06-19 01:53 AM
I found the solution to instead move the GSM object from the embedded library to a folder on the disk using the Libraries and Objects dialog under "File".
2022-06-20 03:37 AM
Yes, you have saved an already existing object as an object, so what you will find in that 'saved' object, it will be 'CALL'ing your original object.
Yes, you just need to go to the Library Manager and save a copy of you object from the embedded library to an external folder.
Or when you initially create the GDL and 'save' for the first time, you can choose to brows for a folder to save it in rather than the embedded library.
That folder will need to be a loaded library folder for you to be able to use the object.
Barry.
2022-06-18 11:04 PM - edited 2022-06-19 01:53 AM
I found the solution to instead move the GSM object from the embedded library to a folder on the disk using the Libraries and Objects dialog under "File".
2022-06-18 11:56 PM
Is this 2D script replacement when saving to the embedded library reproducible? The script you show is an auto-script typically generated by dragging 2D content into the 2D script window of the object... but definitely a bug if anything causes your own scripts to be replaced.
2022-06-19 01:51 AM
I think with my first approach the object was just saved "stupidly", almost like a picture of it was taken and serialized without saving any "logic". I guess you maybe want this in some cases? But i managed to solve it with in my other reply
2022-06-20 03:37 AM
Yes, you have saved an already existing object as an object, so what you will find in that 'saved' object, it will be 'CALL'ing your original object.
Yes, you just need to go to the Library Manager and save a copy of you object from the embedded library to an external folder.
Or when you initially create the GDL and 'save' for the first time, you can choose to brows for a folder to save it in rather than the embedded library.
That folder will need to be a loaded library folder for you to be able to use the object.
Barry.