Objects used in Macro programming |
Top | Previous | Next |
The text generated by JS Macro program may require the inclusion of information about the base point of the JS Macro program, about the orientation, etc. A Macro object is provided for this purpose, whose methods and various properties can be used to place that data at the required location in the Front-End program being generated.
Below is a description of the essential properties of the Macro object. Some properties have been omitted from this description and a full description of the methods and data can be found in the description of the Macro API user interface, which is available here:
C:\Users\Public\Documents\Woodwork for Inventor\2022\v13\SDK\Macro\Woodwork for Inventor Macro API Help.chm
Returns the name of Macro.
|
Returns the name of the sculpt body with which the given Macro was associated.
|
Macro.ReferenceCoordinateSystem.<Coordinate system setup methods> sets the reference coordinate system. All coordinate and direction vector queries in the following program commands are returned in the specified reference coordinate system. The method functions on a modal basis. The defined reference coordinate system is valid until otherwise specified. Methods that allow control of the setting of the reference coordinate system::
Example:
//Modifies W4INV Clamping Coordinate system to Woodwop 000 Coordinate system by shfting it from top to bottom of workpiece Macro.ReferenceCoordinateSystem.SetToClamping();
var oversize = Macro.Workpiece.Oversize; var ShiftByX=-oversize.MinusX-oversize.Sizing; var ShiftByY=-oversize.MinusY-oversize.Sizing;
//Creates Shifting Vector for Reference Coordinate system. //Vector counts Reference Coordinate shifting from Top to Bottom of Workpiece and shifting because oversize of Workpiece.
var ShiftVector = new wVector(ShiftByX,ShiftByY, -Macro.Workpiece.Thickness);
Macro.ReferenceCoordinateSystem.SetNewOrigin(ShiftVector);
//From this point on the program, all coordinates are given in the offset Reference Coordinate System
|
Macro.Workpiece.<Property Name> - returns the parameters of the workpiece to which the given Macro processing is applied
|
Macro.Side.<Property Name> - returns the properties of the plane coordinate system in which the JS Macro operation itself is placed. .
All coordinates and vectors are returned in the current ReferenceCoordinateSystem.
|
Macro.AlignedSide.<Property Name> - returns the properties of the plane coordinate system in which the Macro operation itself is placed. The coordinate system is always oriented in the same way as the Macro coordinate system itself..
All coordinates and vectors are returned in the current ReferenceCoordinateSystem.
|
Returns Macro coordinate system properties in the current ReferenceCoordinateSystem.
|