Library object inclusion with CALL command?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-05-08 10:27 AM
2008-05-08
10:27 AM
I have created my first HelloGDL parametric table. However, instead of the BLOCKs I used as chairs (that are parametrically laid out around the table) I would like to use one of the many chairs from the built in library.
I could certainly copy the Script from the chair in mind from the library into my script and call a subroutine or s.th. but I am convinced there is a more ellegant way than this.
I guess the CALL command is a potential candidate, but I could not figure out how to use it properly .
I was not able to retrieve anything after browsing the docs.
Has somebody a small example for me?
Thanks a lot in advance
Jakob
1 REPLY 1
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2008-05-08 11:07 AM
2008-05-08
11:07 AM
Hello,
Just make new (length) parameters in the main object;
leg_x_dim
leg_y_dim
leg_z_dim
and the main object's 3D-code;
!--calling lower left leg
add -a/2+ leg_x_dim/2, -b/2+leg_y_dim, 0
call 'legmacro' parameters a=leg_x_dim, b=leg_y_dim, zzyzx=leg_z_dim
del 1
!--calling lower right leg
add a/2- leg_x_dim/2, -b/2+leg_y_dim, 0
call 'legmacro' parameters a=leg_x_dim, b=leg_y_dim, zzyzx=leg_z_dim
del 1
In the 'legmacro.gsm' you have 3D-code;
add -a/2, -b/2, 0 !<--movement to centralize the leg
block a, b, zzyzx
del 1
!--the leg dimensions can be hard coded too -> so no need to make parameters 'leg_x_dim' , etc.
call 'legmacro' parameters a=0.03, b= 0.04, zzyzx=0.7
The point here is to have parameters of same name and type when transferring data; here A, B, ZZYZX.
You could also;
call 'legmacro' parameters
In this case the leg has the macro's default dimensions.
Hope this helps.
Just make new (length) parameters in the main object;
leg_x_dim
leg_y_dim
leg_z_dim
and the main object's 3D-code;
!--calling lower left leg
add -a/2+ leg_x_dim/2, -b/2+leg_y_dim, 0
call 'legmacro' parameters a=leg_x_dim, b=leg_y_dim, zzyzx=leg_z_dim
del 1
!--calling lower right leg
add a/2- leg_x_dim/2, -b/2+leg_y_dim, 0
call 'legmacro' parameters a=leg_x_dim, b=leg_y_dim, zzyzx=leg_z_dim
del 1
In the 'legmacro.gsm' you have 3D-code;
add -a/2, -b/2, 0 !<--movement to centralize the leg
block a, b, zzyzx
del 1
!--the leg dimensions can be hard coded too -> so no need to make parameters 'leg_x_dim' , etc.
call 'legmacro' parameters a=0.03, b= 0.04, zzyzx=0.7
The point here is to have parameters of same name and type when transferring data; here A, B, ZZYZX.
You could also;
call 'legmacro' parameters
In this case the leg has the macro's default dimensions.
Hope this helps.