2.1 Concept
The APT object is used to create AP-238 files from APT data. APT is a legacy language from the 1950s that defines tool path geometries. In the beginning it was used in a similar way to FORTRAN except it created machine tool programs rather than computer programs. In recent years CAM systems have replaced the APT systems but many CAM systems still write APT so it is the most widely available common denominator for tool path information.
APT is a state driven language. Before a tool path is created a spindle speed, feed rate and cutting tool should be defined and then these values are used for all subsequent paths until they are changed. The APTSTEP Maker object contains a suite of functions to set these little quantities, and a suite of functions to perform large operations such as reading a whole APT file, or a whole STEP file. Most applications only use the large functions, but a few will use the small functions to customize the results of the larger functions.
Perhaps the most important large functions are the ones that read the different flavors of APT files. These functions must decide when to create new workingsteps and tool paths in the STEP-NC data. The underlying logic of the ATPSTEPMaker object gives applications a choice. Using the default method, the APT starts a new toolpath whenever the feed changes and it starts a new workingstep whenever the spindle speed or tool changes. This default can be changed using the workingstep function or the Process object.
APT is the most important but not the only source of data for the DLL. There are functions to read several flavors of RS274D/ISO 6983 files, for example, see the ImportHass, ImportSiemens and ImportFanuc functions, and there are functions to read STEP files to define the geometries of the workpiece, stock, fixtures and cutting tools, for example see the Workpiece and Rawpiece functions.
2.2 Arc
The arc function adds an arc to the current tool path. The tool path is assumed to have a start point defined by the last geometry item added to the path. The arc command moves the cutting tool tip to a new point that then becomes the current point for the next geometry command.
If an arc is not in the XY plane then the required plane must have been previously defined using the SetDirection function.
If the current workplan does not contain any workingsteps then one will be created implicitly. If the workingstep does not contain any tool paths then one will be created implicitly and the new arc wil become the first item in that tool path.
If the arc is the first item in a new tool path after a tool change then the start point of the arc will be (0, 0, 0) or the last point defined using the FirstPathStartPoint function. If there was not a tool change and a point was defined in the last tool path then that point will be used as the start point.
If no feedrate has been defined then the feedrate will be zero. If no spindle speed has been defined then the spindle speed will be zero. If no tool has been loaded then the tool number will be zero.
Arguments:
Label: A string argument that defines a name for the geometry item. Typically this will be the empty string but it can be an identifier to help another application find the item.
x, y, z: The x, y, z coordinates of the end point of the arc.
cx, cy, cz: The x, y, z coordinates of the center of the circle that defines the arc.
radius: The radius of the circle.
ccw If non-zero then the arc will travel from the current point to the new end point in a counter clockwise direction.
The above arguments are partially redundant, for example, the requirement to give a z coordinate for the circle center is redundant if this arc is in the XY plane.
Result:
This function has a void result.
Related Functions
GoToXYZ: This function adds line segments to the geometry.
FirstPathStartPoint: This function defines a start point for the arc if the new arc is the first segment in the first tool path after a tool change.
SetDirection: This function defines a plane for the arc. The default is the XY plane.
Feedrate: This function sets the current feedrate.
SpindleSpeed: This function sets the current spindle speed.
LoadTool: This function sets the current cutting tool.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
In Rapid mode: Most CNC systems will not allow rapid arc moves so this is assumed to mean there is an error in the input data.
The arc function does not check for the semantic error of defining an arc whose radius is too large for the given start, end and center points.
The arc function does not check to make sure the start, end and center points are in the plane previously defined by the SetDirection function.
2.3 ArcABC
The ArcABC function defines an arc that includes a contact normal between the workpiece and the cutting tool. All the other arguments are the same as for the arc function.
The contact normal is used to calculate a five axis displacement for the arc by cutter compensation algorithms.
Unlike the GoTo function the Arc function does not require an Arc_ijk flavor because CNC systems do not allow the tool axis to change while an arc is being executed.
Additional Arguments:
a, b, c: (x, y, z) components for the contact point.
Additional Errors:
None.
2.4 CenterOn
All subsequent toolpaths will be in Cutter Center mode. In this mode the tool path describes the center line of the cutting tool tip. The other mode is Cutter Contact mode see the ContactOn, Left and Right functions.
If the DLL is in the middle of creating a tool path and if that tool path is not in Cutter Center mode then the current tool path is ended and the next geometry item is added to a new tool path.
Arguments:
This function does not have any arguments.
Result:
This function has a void result.
Related Functions
Arc: This function ads arc segments to the geometry.
GoToXYZ: This function adds line segments to the geometry.
ContactOn: This function puts the system into cutter contact mode.
Left: This function puts the system into cutter contact mode with the contact point on the left hand side of the tool.
Right: This function puts the system into cutter contact mode with the contact point on the right hand side of the tool.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.5 Clean
This function cleans the workspace of any data that is not connected to the current project. If the application is short of memory space then the clean function may be able to find enough space to allow for completion of the program. If an application is loosing data because an object is not attached to the project then the clean function may be able to help reveal when this is happening.
Arguments:
This function does not have any arguments.
Result:
This function has a void result.
Related Functions
For related functions see the Eraser object.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.6 ClearancePlane
The clearance plane defines a safety plane for rapid movements. If an application is generating its own tool paths then it can use the clearance plane to move the tool between operations.
In the STEP-NC standard the Clearance Plane is called the Security Plane and it can be any arbitrary plane. In the DLL the Clearance plane has to be an XY plane and the clearance is defined by a positive Z value.
Arguments:
z: The clearance is defined to be an XY plane at Z distance from the origin. All subsequent workingstep will be given this clearance plane until it is reset. If the z value is zero or negative then the clearance plane is set to NULL for subsequent workingsteps.
A more powerful security plane function needs to be written that allows the security plane to be any plane.
Result:
This function has a void result.
Related Functions
Retract: This function defines the retract plane for an operation. This plane is also a safe plane but unlike the security plane it is only safe for the selected operation.
The functions in the Process object that create the different types of milling, drilling and turning objects use the clearance plane.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
The DLL does not contain functionality to check for rapid tool movements below the security plane.
2.7 Connector
A connector is used to connect the end of one tool path with the start of the next tool path. The connector allows the end point of the first to be distinct from the start point of the second. Normally they should be the same though in practice when they are distinct most systems will connect them anyway.
Given that most systems automatically connect the two points at the end of one toolpath and the start of another a more practical use for a connector is to show that the connection between tool paths is not fixed so it can be changed by the user.
Arguments:
This function does not have any arguments.
Result:
This function has a void result.
Related Functions
Arc: This function adds arc segments to the geometry.
GoToXYZ: This function adds line segments to the geometry.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
There is another type of connector allowed by STEP-NC that connects two paths via the security plane. This type of connector has not yet been implemented in the DLL.
2.8 ContactOn
All subsequent toolpaths will be in Cutter Contact mode. Cutter contact mode enables three and five axis tool diameter wear compensation. In this mode the tool path describes the normal of the point of contact between the cutting tool and workpiece. If the part is being made using three axis milling then the contact point between the cutting tool and workpiece can be described using the Left and Right functions. If five axis milling is being used then the point must be defined using versions of the Arc and GoTo functions that include a, b and c parameters.
If the DLL is in the middle of creating a tool path and if that tool path is not in Cutter Contact mode then the tool path is ended and the next geometry item will start a new tool path.
Arguments:
This function does not have any arguments.
Result:
This function has a void result.
Related Functions
ArcABC: This function defines arc segments with a contact normal.
GoToXYZ_ABC: This function defines line segments with a contact normal.
GoToXYZ_IJK_ABC: This function also defines line segments with an axis vector and a contact normal.
CenterOn: This function puts the system into cutter center mode.
Left: This function puts the system into cutter contact mode with the contact normal on the left hand side of the tool. The DLL will calculate abc vectors for the left hand side.
Right: This function puts the system into cutter contact mode with the contact normal on the right hand side of the tool. The DLL will calculate ABC vectors for the right hand side.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.9 CoolantMist
This function turns the coolant on for all subsequent tool paths and working steps and makes the type of the coolant mist instead of flood.
If the coolant is not currently on, or not of type mist then a new tool path is started.
Arguments:
There are no arguments.
Result:
This function has a void result.
Related Functions
CoolantOn: This function turns the coolant on and makes it of type flood.
CoolantOff: This function turns the coolant off.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Through spindle coolant is not yet implemented by the DLL.
2.10 CoolantOn
See CoolantMist.
2.11 CoolantOff
See CoolantMist.
2.12 ConvertWorkplanToSelective
A Selective is a program control structure that defines a selection of operations. Its structure is similar to a workplan but in a workplan each element in the sequence is executed in order, and in a Selective only one of the elements is selected for execution.
The DLL allows a selective to be created by first defining a workplan and then converting that workplan into a selective. All of the elements currently in the workplan are put into the selective and the workplan is reduced to just one element which is the new selective. Items may be added to the original workplan after the selective has been created.
During execution the user must determine which item in a Selective is to be executed. The easiest method is to delete all of the other choices before execution begins.
Arguments:
wp_id: The identifier for the workplan. See the Finder object and the GetCurrentWorkplan function for more information on identifiers.
sname A name for the new selective.
Result:
This function returns the identifier of the new Selective.
Related Functions
NestWorkplan: This function starts a new workplan.
EndWorkplan: This function ends the current workplan.
GetCurrentWorkplan: This function returns the identifier of the current workplan.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Not a workplan: The supplied identifier is invalid or does not identify a workplan.
Functions to add the parallel, non-sequential, if-statement and while-statement programming constructs need to be added to the DLL.
2.13 CutterDiameterCompensationAssignment
This function sets a value in the cutter compensation register to compensate for tool wear. To operate effectively this function requires deep integration between the STEP-NC DLL and the underlying CNC control.
Arguments:
value: The tool wear compensation value.
Result:
This function has a void result.
Related Functions
ContactOn: This function creates tool paths that should use the CutterDiameterCompensationAssignment value to calculate the tool wear compensation see also Left and Right.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
A function that measures the cutting tool wear needs to be added to the DLL.
2.14 DefaultToInches
Some APT tool path programs do not define their units for distance measurements. This function tells the system to assume that the units should be inches.
The default units will be used only if no other units have been defined. The most common case is when a new project has just been started and a new APT file is being read to create a new project. If another APT file has previously been read, or if STEP file has been read then the units of that file will be used instead.
The ratio of inches to millimeters is 1:25.4 so there is a considerable difference in size if the wrong units are applied to a file. If items cannot be seen in the visualization then this may be the reason and you should try changing the default units to see if this has an effect.
Arguments:
There are no arguments.
Result:
The function has a void result.
Related Functions
DefaultToMillimeters: For applications that want the data to default to millimeter units.
Inches: This function sets the length unit to inch for all subsequently defined geometry items.
Millimeters: This function sets the length unit to millimeter for all subsequently defined geometry items.
Common Errors:
None.
2.15 DefaultToMillimeters
See DefaultToInches.
2.16 DefineTool
This function defines the parameters of a cutting tool. There are a large number of parameters. For a full definition see an APT reference manul. In practice the parameters defined in most programs are, in order of popularity, the cutting tool diameter, the cutting tool radius, the cutting tool length and the cutting tool tip angle.
The cutting tool diameter is different to the cutting tool radius and a frequent cause of confusion to new users. The diameter describes the diameter of the tool, but the radius describes the radius of a bevel at the tip of the tool.
STEP-NC defines two significant enhancements for cutting tool definitions. First it defines many more kinds of tools in an object oriented hierarchy. Within this hierarchy the type of tool used for APT tools is known as a User_defined_milling_tool. Second, it allows the geometry of the tool to be defined from an AP-203 model. In the long term this geometry will be more useful than the cutting tool parameters so it is predicted that applications will only want to define the major parameters of diameter, radius and length.
In APT programs a tool is identified by a tool number that corresponds to the placement position of the tool in a tool holder. The SELCTLTool and LoadTool functions in the DLL allow tools to be selected and loaded using these numbers.
In the long term for STEP-NC programs it is going to be more important to know the manufacturers identifier for a tool so that it can be looked up in a catalog. Therefore, a second version of the DefineTool called DefineTool2 allows it to be given a manufacturers identifier. Two tools at different places in the tool holder can be two instances of the same tool and in this case they will have the same identifier but different numbers.
Arguments:
tool_diameter: The diameter of the cutting tool. Called Effective_cutting_diameter in the STEP-NC standard.
tool_radius: The radius of the bevel at the bottom of the tool. Called Corner_radius in the STEP-NC standard.
horizontal_distance: Called Corner_radius_horizontal in the STEP-NC standard.
horizontal_vertical: Called Corner_radius_vertical in the STEP-NC standard.
unused: As per the name this field is not often used in APT programs. Called tip_outer_angle in the STEP-NC standard.
angle: The angle at the tip of the tool. Called Taper_angle in the STEP-NC standard.
height: The length of the tool. Called Overall_assembly_length in the STEP-NC standard.
Result:
The function has a void result.
Related Functions
DefineTool2: Defines a tool with all the above parameters plus an identifier that can be used to search for the tool in libraries.
SELCTLTool: Defines a tool number for the most recently defined tool.
LoadTool: Starts a new workingstep using the tool with the given tool number
SetAutoToolNumberOn: Some APT programs do not define a tool number. This function allows DLL application to control whether or not these tools should be given a number automatically.
SetToolIdentifier: A function to change the identifier of a tool.
ToolGeometry: A function to define the AP-203 geometry of a tool.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Subtle differences between the semantics of how tools are defined are a frequent cause of errors when the DLL is applied to the APT files of a new organization for the first time.
2.17 DefineTool2
This function has all the parameters of the DefineTool function plus one additional parameter to define a unique identifier for the tool. If there are two instances of a tool in two places in the tool holder then each instance should have the same identifier and a different tool number.
Additional Arguments:
identifier: A unique name for the cutting tool.
Result:
The function has a void result.
Additional Related Functions
SetToolIdentifier: Use this function to give two tools the same identifier so that they can share the same AP-203 geometry.
ToolGeometry: This function assigns an AP-203 geometry to a tool identifier.
Additional Common Errors:
None.
2.18 EndWorkplan
The APT object puts all new process items into the current workplan. When a new project is started a main_workplan is created and it is made the current workplan. When a new workplan is created using the NestWorkplan function it is added to the current workplan, then the current workplan is saved onto a stack and the new workplan becomes the current workplan.
The EndWorkplan function reverses this process by closing the current workplan, poping the last nested workplan of the stack and making it the current workplan.
Arguments:
None.
Result:
This function returns a void result.
Related Functions
NestWorkplan: This function starts a new workplan and places it in the current workplan.
NestWorkPlanAfter: Gives greater control over where the new workplan is placed in the old workplan.
GetCurrentWorkplan: This function returns the internal identifier of the current workplan.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Empty stack: If the stack is empty the system will assume you are trying to end the main workplan which is not allowed.
2.19 ExportAll
The APT allows AP-203 geometries and placements to be defined for the workpiece, rawpiece and fixtures. The placements are necessary so that each can be positioned and oriented correctly with respect the tool paths and the other geometries. The ExportAll function allows all these geometries and placements to be exported as an AP-203 file.
Arguments:
File name: File name for the AP-203 file that is to contain the assembly.
Result:
The result is put into the AP-203 file.
Related Functions
There are export functions for the workpiece, rawpiece and fixtures as well as the tool geometries. The tool geometries are not included in the result of ExportAll.
Common Errors:
No geometry: If there is no geometry defined for the workpiece, the rawpiece and the fixture then the system will issue an error message. If at least one has geometry then there will be no error.
2.20 ExportFixture
Fixtures can be defined in STEP-NC so that the CNC can check for correct setup placement and a simulator can check for tool collisions. This function exports the geometry and placement of the fixtures so that they can be analyzed by a program that is performing these functions.
Arguments:
File name: File name for the AP-203 file that is to contain the fixture.
Result:
The result is put into the AP-203 file.
Related Functions
Fixture: This function defines the geometry of the fixture.
FixturePlacement: This function defines the placement of the fixture.
Common Errors:
No geometry: The geometry of the fixture has not been defined in the program.
2.21 ExportAsFanuc
This function converts the tool paths in a STEP-NC program into codes suitable for execution on a Fanuc control. All of the tool paths in all of the workingsteps and workplans of the current project are converted. If a subset is needed then the main_workplan should be edited using the delete functions in the Eraser object before this function is called.
The output of the Fanuc export and the exports for all the other types of controls can be customized using the SetCNCExport functions.
Arguments:
File name: File name for the file that is to contain the codes.
Result:
The result is put into the file.
Related Functions
SetCNCexportInsertStopAfterWorkingstep: Puts a stop after each workingstep to make simulation and verification of the codes easier.
SetCNCexportNumberofDigits: Sets the number of digits of precision for an export.
SetCNCexportUnits: Sets the units for an export.
SetCNCexportUsingBlockNumber: Determines if block numbers are exported.
SetCNCexportUsingTCP: Determines if the export is to be in TCP mode.
SetCNCexportWorkoffset: Determines the workoffset register.
ImportFanuc: Read a Fanuc file and use it to define toolpaths.
Common Errors:
No project open: An AP-238 file must be open - see the Open238 function.
2.22 ExportAsDmisManual
Same functionality as for ExportAsFanuc but for CMM machines that read DMIS programs in manual mode.
2.23 ExportAsDmisCNC
Same functionality as for ExportAsFanuc but for CMM machines that read DMIS programs in cnc mode.
2.24 ExportAsESAB
Same functionality as for ExportAsFanuc but for ESAB plate cutting and marking controls.
2.25 ExportAsHaas
Same functionality as for ExportAsFanuc but for Haas controls.
2.26 ExportAsHeidenhainAC
Same functionality as for ExportAsFanuc but for Heidenhain controls with AC axes.
2.27 ExportAsHeidenhainBC
Same functionality as for ExportAsFanuc but for Heidenhain controls with BC axes.
2.28 ExportAsMDSI
Same functionality as for ExportAsFanuc but for MDSI controls.
2.29 ExportAsOkuma
Same functionality as for ExportAsFanuc but for Okuma controls.
2.30 ExportAsSiemens
Same functionality as for ExportAsFanuc but for Siemens controls.
2.31 ExportRawpiece
The Rawpiece defines the part before machining begins. The rawpiece is also sometimes called the stock. This function exports the geometry and placement of the rawpiece so that it can be checked by other applications.
Arguments:
File name: File name for the AP-203 file that is to contain the rawpiece.
Result:
The result is put into the AP-203 file.
Related Functions
Rawpiece: This function defines the geometry of the rawpiece.
RawpiecePlacement: This function defines the placement of the rawpiece.
Common Errors:
No geometry: The geometry of the rawpiece has not been defined in the program.
2.32 ExportToolGeometry
This function exports the geometry of the cutting tools.
Arguments:
Tool id: The tool number of the tool that is going to be exported.
File name: File name for the AP-203 file that is to contain the tool.
Result:
The result is put into the AP-203 file.
Related Functions
ToolGeometry: This function defines the geometry of a tool.
Common Errors:
No geometry: The geometry of the tool has not been defined in the program.
2.33 ExportWorkpiece
The Workpiece defines the part that is being made by the machining. There are many functions in the STEP-NC DLL to analyze the workpiece and determine the geometry and tolerances that must be met by the machining process. This function exports the geometry and placement of the workpiece so that it can be checked by another application.
Arguments:
File name: File name for the AP-203 file that is to contain the workpiece.
Result:
The result is put into the AP-203 file.
Related Functions
Workpiece: This function defines the geometry of the workpiece.
WorkpiecePlacement: This function defines the placement of the workpiece.
Common Errors:
No geometry: The geometry of the workpiece has not been defined in the program.
2.34 ExtendedNcFunction
The use of NC functions in STEP-NC programs is discouraged because they limit portability and the use of ExtendedNcFunctions is strongly discouraged because they prevent portablity.
Nevertheless there are situations where an ExtendedNcFunction is the only solution. The two most common are while testing potential new STEP-NC functionality and to enable a unique feature of a unique machine.
Arguments:
Label: An optional label for the new function.
Description: The text to be passed to the controller of the chosen machine. Frequently the text describes a Macro that will be expanded on the controller
Result:
The function has a void result.
Related Functions
ExtendedNcFunctionAfter: Inserts the extended nc function into a given location in the STEP-NC program.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.35 ExtendedNcFunctionAfter
Inserts and Extended NC function into a given location in the STEP-NC program.
Arguments:
Label: An optional label for the new function.
Description: The text to be passed to the controller of the chosen machine. Frequently the text describes a Macro that will be expanded on the controller
Result:
The function has a void result.
Related Functions
ExtendedNcFunction: Adds the extended nc function to the current end of the STEP-NC program.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.36 Feedrate
This function defines the feedrate to be used by all subsequent tool paths.
If a toolpath is currently being constructed then it is finished and a new one is started for the next new geometry item with the new feedrate. If the system is currently in rapid mode then this mode is cancelled.
The unit of the feedrate can be set using the FeedrateUnit function.
Arguments:
Speed: The value for the new speed. The Feedrate function is a null operation if the new feed is the same as the current speed and the system is not in rapid mode.
Result:
The function has a void result.
Related Functions
FeedrateUnit: Sets the unit to be used by all subsequent feedrates.
FeedrateCSS: Used to define a constant spindle speed feedrate for turning applications.
SpindleSpeed: Used to define the spindle speed.
Rapid: This function sets the system into rapid mode for all subsequent tool paths.
Arc: This function adds arc segments to the geometry that will be given the new feedrate.
GoToXYZ This function adds line segments to the geometry that will be given the new feedrate.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.37 FeedrateCSS
This function defines a constant spindle speed feedrate for turning applications to be used by all subsequent tool paths.
If a toolpath is currently being constructed then it is finished and a new one is started with the new feedrate.
Arguments:
Speed: The value for the new speed. The Feedrate function is a null operation if the new feed is the same as the current speed.
Result:
The function has a void result.
Related Functions
FeedrateUnit: Sets the feedrate for milling applications.
SpindleSpeed: Used to define the spindle speed.
SetModeTurn: Puts the DLL into turning mode.
SetModeMill: Puts the DLL back into the milling mode (the default).
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Not in turn mode: FeedrateCSS can only be used for turning applications.
The functionality of the DLL for turning applications is weak compared to its functionality for milling applications.
2.38 FeedrateUnit
This function defines the units to be used for all subsequent tool paths. The function should be followed by a call to Feedrate to set the new feedrate value. The function sets the technology object to NULL until a new one is needed for a new tool path.
The following units are allowed for a feedrate.
mmps millimeters per second
mmpm millimeters per minute
cmps centimeters per second
mps meters per second
ips inches per second
ipm inches per minute
fps feet per second
fpm feet per minute
iprev inches per revolution
mmprev millimeters per revolution
Arguments:
Unit: The unit to be used for future feedrates as described by one of the above strings.
Result:
The function has a void result.
Related Functions
Feedrate: Sets feedrate value.
GetCurrentTechnology: Returns the identifier of the technology object currently being used to define feeds and speeds for new tool paths.
SpindleSpeed: Sets the spindle speed which is the other major attribute of a technology object.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Invalid string: The string describing the units does not have one of the values recognized by the STEP-NC DLL.
2.39 FirstPathStartAxis
This function defines the initial values to be used for the tool axis at the start of a program or after the tool has been changed.
Arguments:
i, j, k: The components of the axis.
Result:
The function has a void result.
Related Functions
FirstPathStartPoint: The x, y and z values to be used after the tool change.
LoadTool: The function to change the tool.
Common Errors:
None.
2.40 FirstPathStartPoint
This function defines a start point to be used for the tool at the start of a program or after the tool has been changed.
Arguments:
x, y, z: The coordinates of the point.
Result:
The function has a void result.
Related Functions
FirstPathStartAxis: The i, j and k values to be used for the tool axis.
LoadTool: The function to change the tool.
There is no FirstPathStartNormal because the tool should not be in contact with a surface immediately after a tool change.
Common Errors:
None.
2.41 Fixture
This function defines the geometry of the fixture or fixtures from an AP-203 file. It is common for the fixtures to be defined as an assembly, for example as four bolts that hold the part onto the machine.
The function assumes that all of the geometry in the file is to make up the fixture. Any STEP file can be used to define the geometry provided it is compatible with AP-203.
Arguments:
File name: The name of the STEP file that defines the fixtures.
Result:
The function has a void result.
Related Functions
FixturePlacement: This function changes the placement of the fixtures so that they are positioned and oriented correctly within the context of the tool paths.
ExportFixture: This function exports an AP-203 file describing the fixture(s).
Workpiece: Performs the same function as fixture but for the workpiece
Rawpiece: Performs the same function as fixture but for the rawpiece.
GetCurrentFixture: Returns the id of the current fixture or null (0).
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Bad File: The DLL was unable to open a file with the given name or it was not a valid STEP file.
Bad name: The fixture cannot have the same name as the project.
2.42 FixturePlacement
CAD and CAM systems typically use different coordinate systems. In CAD a part is positioned and oriented to the coordinates it will be given in the final product. In CAM a part is positioned and oriented so that the machining will start in the middle of the top of the rawpiece.
In order to detect collisions between the tool and fixtures the position and orientation of the fixtures must be changed to conform to the coordinates chosen for the tool paths. In STEP this is done using an axis placement. To place the part the user needs to describe the coordinates and orientation that must be given to the origin and axis of the fixture in the coordinate system of the tool path.
The function GetFaceGeometryPlacement in the Tolerance object returns the current coordinates of a face in the coordinate system defined by the toolpaths.
Arguments:
x, y, z: New coordinates for the fixture origin.
i, j, k: New direction for the fixture Z axis
a, b, c New direction for the fixture X axis
Result:
The function has a void result.
Related Functions
Fixture: This function defines the fixture from an AP-203 file.
GetFixturePlacement: Get the current placement values for the fixture.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.43 GeometryForToolNumber
This function is a simpler interface for the ToolGeometry and SetToolIdentifier functions. It is defined from these functions as follow as follows:
Step->GeometryForToolNumber (geometry_file, 1);
Is equivalent to:
Step->ToolGeometry (geometry_file, T1);
Step->SetToolIdentifier (T1, 1);
GeometryForToolNumber assumes that tool numbers are integers. The other two functions allow the tool number to be any identifier. Geometry for tool number prepends a T to the tool number to define an identifier for the tool. Therefore, in the above example the tool will be given the identifier T1.
GeometryForToolNumber only allows one tool to be given an identifier and geometry. The other two functions allow two tools with different numbers, for example, 1 and 3 to be given the same identifier and geometry to show that they are two copies of the same tool made by the same manufacturer.
2.44 GetCurrentFeed
This function returns the current value of the feed variable. This value is set by the Feedrate function and it is the value that will be used for any new toolpath data until it is reset by another call to the Feedrate or FeedrateUnits function.
Arguments:
None.
Result:
The result is a double. The value will be the value last set using the Feedrate function.
Related Functions
Feedrate: This function sets the value of the feed variable.
FeedrateUnits: This function changes the unit that will be used for feeds and resets the value of the feed variable to zero.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.45 GetCurrentFixture
This function returns the identifier of the current fixture so that it can be used to find that fixture at a later time. See Section 2.108 for some important notes on how to use identifiers.
Arguments:
None.
Result:
The result is an integer. The integer will be zero if there is no current fixture.
Related Functions
Fixture: This function defines the fixture from an AP-203 file.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.46 GetCurrentFunction
This function returns the identifier of the object that is currently being used to define the machine functions for new tool paths and workingsteps. The machine functions are used to control attributes such as the coolant. If the coolant changes then a functions object with the new value is made the current functions object. See Section 2.108 for some important notes on how to use identifiers.
Arguments:
None.
Result:
The result is an integer. The integer will be zero if there is no machine functions object.
Related Functions
CoolantMist: One of the functions that changes the coolant value. See also CoolantOn and CoolantOff.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.47 GetCurrentLocation
This function returns coordinates that will be used as the start position for the next geometry item.
Arguments:
None.
Result:
x, y, z: Coordinates set by the last geometry item or by the FirstPathStartPoint function. If both these have not been set than the values (0, 0, 0) will be returned
i, j, k: Axis set by the last geometry item or by the FirstPathStartAxis function. If bith these have not been set then the value (0, 0, 1) will be returned.
Related Functions
GoToXYZ: Adds a line to the current tool path and sets a new current location.
Arc: Adds an arc to the current tool path and sets a new current location.
FirstPathStartPoint: Sets the coordinates for the first point after a tool change.
FirstPathStartAxis: Sets the components for the first axis after a tool change.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.48 GetCurrentProject
This function returns the identifier of the current project so that it can be used to find that project at a later time. See Section 2.108 for some important notes on how to use identifiers.
Arguments:
None.
Result:
The result is an integer. The integer cannot be zero because there is always a current project.
Related Functions
NewProject: This function starts a new project.
Open238: This function makes the project in an AP-238 file the current project.
Open224: This function reads an AP-224 file and constructs a project containing that file.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.49 GetCurrentRawpiece
This function returns the identifier of the current rawpiece so that it can be used to find that rawpiece at a later time. See Section 2.108 for some important notes on how to use identifiers.
Arguments:
None.
Result:
The result is an integer. The integer will be zero if there is no current rawpiece.
Related Functions
Rawpiece: This function defines the rawpiece from an AP-203 file.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.50 GetCurrentSpeed
This function returns the current value of the spindle speed variable. This value is set by the SpindleSpeed function and it is the value that will be used for any new toolpath data until it is reset by another call to the SpindleSpeed or SpindleSpeedUnit function.
Arguments:
None.
Result:
The result is a double. The value will be the value last set using the SpindleSpeed function.
Related Functions
SpindleSpeed: This function sets the value of the spindle speed variable.
SpindleSpeedUnit: This function changes the unit that will be used for speeds and resets the value of the spindle speed variable to zero.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.51 GetCurrentTechnology
This function returns the identifier of the object that is currently being used to define the machine technology for new tool paths and workingsteps. The machine technology is used to control the feedrate and spindle speed of a tool path. See Section 2.108 for some important notes on how to use identifiers.
Arguments:
None.
Result:
The result is an integer. The integer will be zero if there is no machine technology object.
Related Functions
Feedrate: A function that changes the feedrate and therefore the current technology object. The technology object will be NULL until a new toolpath needs the object.
FeedrateUnit: A function that changes the feedrate units and therefore the current technology object. The technology object will be NULL until a new toolpath needs the object.
SpindleSpeed: A function that changes the spindle speed and therefore the current technology object. The technology object will be NULL until a new toolpath needs the object.
SpindleSpeedUnit: A function that changes the spindle speed unit and therefore the current technology object. The technology object will be NULL until a new toolpath needs the object.
GoToXYZ, Arc: Add a geometry item to the current tool path so a technology object will be found or defined with the values currently set for the feed and speed.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.52 GetCurrentTool
This function returns the identifier of the current tool so that it can be used to find that tool at a later time. See Section 2.108 for some important notes on how to use identifiers.
The id returned by this function is NOT the tool number or the tool identifier. These values can be found using the GetToolNumber and GetToolIdentifier functions of the Finder object. They take the result of their GetCurrentTool function as their argument.
Arguments:
None.
Result:
The result is an integer. The integer will be zero if there is no current tool.
Related Functions
LoadTool: Picks the current t