Intermediate Tooling:IT Fixture Callbacks: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
Created page with "== INT_TOOL Variables — Intermediate Tooling Fixture Callback == These variables are the interface between GibbsCAM and a fixture macro. The macro must reside in the same folder as the fixture and have the same name except with the .MAC extension. The macro is called once '''per solid''' in the fixture. GibbsCAM sets inputs before the macro runs; the macro writes outputs before it exits. === Inputs (set by the engine, read by the macro) === {| class="wikitable" ! V..." |
|||
| Line 3: | Line 3: | ||
These variables are the interface between GibbsCAM and a fixture macro. The macro must reside in the same folder as the fixture and have the same name except with the .MAC extension. The macro is called once '''per solid''' in the fixture. GibbsCAM sets inputs before the macro runs; the macro writes outputs before it exits. | These variables are the interface between GibbsCAM and a fixture macro. The macro must reside in the same folder as the fixture and have the same name except with the .MAC extension. The macro is called once '''per solid''' in the fixture. GibbsCAM sets inputs before the macro runs; the macro writes outputs before it exits. | ||
=== Inputs (set by | === Inputs (set by GibbsCAM, read by the macro) === | ||
{| class="wikitable" | {| class="wikitable" | ||
Latest revision as of 19:10, 16 April 2026
INT_TOOL Variables — Intermediate Tooling Fixture Callback
These variables are the interface between GibbsCAM and a fixture macro. The macro must reside in the same folder as the fixture and have the same name except with the .MAC extension. The macro is called once per solid in the fixture. GibbsCAM sets inputs before the macro runs; the macro writes outputs before it exits.
Inputs (set by GibbsCAM, read by the macro)
| Variable | Type | Description |
|---|---|---|
INT_TOOL_NODE_NAME$ |
string | The name of the node (component/assembly node) this fixture belongs to |
INT_TOOL_FIXTURE_NAME$ |
string | The name of the fixture item |
INT_TOOL_FIXTURE_TYPE$ |
string | The type/category string of the fixture |
INT_TOOL_SOLID_NUM |
int | Which solid is currently being processed (1-based). The macro is invoked once per solid; use this to distinguish the first solid from subsequent ones |
INT_TOOL_RETURNCODE |
int | Pre-initialized to 999 by the system before the macro runs (acts as a sentinel — if the macro does not set it, the system knows something went wrong)
|
Outputs (set by the macro, read back by GibbsCAM)
| Variable | Type | Description |
|---|---|---|
INT_TOOL_NUM_COPIES |
int | How many copies/instances of this solid to place. Set to 0 to skip the solid, -1 to explicitly exclude it, max 99
|
INT_TOOL_MATRIX |
double array | Packed array of 4×3 transformation matrices (12 doubles each). Must be sized INT_TOOL_NUM_COPIES * 12. Each block of 12 doubles is the transform for one copy. Can be declared local or global
|
INT_TOOL_RETURNCODE |
int | Set to 0 on success. Any non-zero value signals an error back to the engine
|
How the macro is structured
The typical example is:
degrees NodeName$ = INT_TOOL_NODE_NAME$ ' read inputs FixtureName$ = INT_TOOL_FIXTURE_NAME$ FixtureType$ = INT_TOOL_FIXTURE_TYPE$ iSolidNum = INT_TOOL_SOLID_NUM ' Handle solid #1 specially — it is typically the "base" solid ' placed at the identity (no transform) if iSolidNum = 1 then global INT_TOOL_MATRIX(12) if iSolidNum = 1 then get_identity_matrix INT_TOOL_MATRIX if iSolidNum = 1 then goto done ' For subsequent solids, compute N copies and fill the matrix array global INT_TOOL_MATRIX(36) ' 3 copies × 12 = 36 ...build mat1, mat2, mat3... INT_TOOL_MATRIX(i) = mat1(i) INT_TOOL_MATRIX(i+12) = mat2(i) INT_TOOL_MATRIX(i+24) = mat3(i) iNumCopies = 3 :done INT_TOOL_NUM_COPIES = iNumCopies ' write outputs INT_TOOL_RETURNCODE = 0
Key rules
INT_TOOL_MATRIXmust be declared (localorglobal) before the engine reads it back — undeclared or wrong-sized arrays produce error codes-31/-32/-33.- The array size must be exactly
INT_TOOL_NUM_COPIES * 12or larger. INT_TOOL_RETURNCODEmust be set to0for the system to accept the outputs. Leaving it at its initial value of999(or any non-zero value) signals failure.