2022-01-10 08:43 AM
Hi everyone,
I'm developing a library of furniture/millwork objects for my office, and for each of them I'd like to use a subroutine to set up and position a section plane, to be used together with PROJECT2 to create the millwork details right from the object. (I can't use a macro in this case, because section planes created in a macro only apply to geometry in that macro). My objects should not be duplicating the same code, so my question is whether there's a way to create a subroutine library? I had a few ideas:
The last option brings up the question of how macro calls relate to the different GDL scripts. With a bit of experimentation it appears to me that if a macro is called from a master script, then the entire macro is also called. But a macro call from a 2D script runs just the 2D script of the macro, and similar behavior with all the other scripts. Is that more or less correct? I can't find any documentation on this, but many GS objects seem to do this to set up parameters, or draw 2D symbols, for example.
Solved! Go to Solution.
2022-01-11 09:09 AM
Hi,
subroutines can only be called from within the object.
The third option works well, you can return values from a macro or just PUT them if they are used for the same command.
Called macro's master script is always executed. A macro could be called from 2d in one object and from 3d in another, the master script is executed in both cases, the 2d and 3d only once each.
2022-01-10 10:33 AM
@s_p_b Just a quick thought because I may be encountering similar challenges. I am increasingly moving away from wrestling with AC's standard 2D projection and relying more on axonometric 3D documents. For isolated objects this removes many of the 2D plan coding issues. The downside is 2D dimensioning in 3D documents is in need of a major refresh; it works but could be better. The upside is each 3D document can have its own cut plane location settings.
2022-01-10 12:20 PM
@s_p_b wrote:(I can't use a macro in this case, because section planes created in a macro only apply to geometry in that macro).
Why is this so? Can't the cutting planes be calculated within the macro and returned via RETURNED_PARAMETERS?
Have you tried it with an object from the subtype „Library Master“ which only has a Master-Script? I think it works similar to a master_gdl.file and I am afraid it has the same limitations (and unfortunately no documentation)
Try to look at examples of both types how Graphisoft uses those. Unfortunately, I have never seen a script that you have in focus. The main function of master_gdl.files is to define attributes and for library-master-files to set global VALUS-Lists.
And last: Yes the macro call from a Master-Script calls all other Scrips from the Macro and a call from any other script only calls that special script within then macro.
2022-01-11 09:09 AM
Hi,
subroutines can only be called from within the object.
The third option works well, you can return values from a macro or just PUT them if they are used for the same command.
Called macro's master script is always executed. A macro could be called from 2d in one object and from 3d in another, the master script is executed in both cases, the 2d and 3d only once each.
2022-01-11 04:52 PM
Thanks everyone! I will go with a macro to set up the cutting plane as Peter and Joachim suggest. I didn't realize that the stack is shared between the caller and the macro, that could be useful in all kinds of ways.
@DGSketcher
I really like axos, but the millworkers I work with still ask for conventional orthographic drawings. So I use the 3D views more as illustrations to help them understand a design. My hope is to set up a macro that takes care of all the 2D generation / section plane setup, and then the individual furniture objects should need minimal boilerplate code.