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 APT systems but many CAM systems still write APT data so it is the most widely available common denominator for tool path information.
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 and tolerances of the workpiece, stock, fixtures and cutting tools, for example see the Workpiece and Rawpiece functions.
The legacy APT programming language is state driven. Each time a new tool path is created the current feed, speed and other quantities are added to that tool path as necessary. The APT object has been written for APT parsers so it is also state driven. Hence, at any time there is a current workpiece, workplan, workingstep, feed, speed and so on (see the GetCurrent functions).
STEP-NC is NOT state driven. The APT object takes the state driven commands of APT and converts them into a graph of STEP-NC objects where every quality of every object is explicitly attached to that object. Only the APT object has a state model in the STEP-NC DLL. The other objects use navigation models in which a given argument is used as the starting point to find other objects. It can be argued that another version of the APT object should be written for more modern applications that is not state driven. The process object contains some of the required functionality.
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 point defined using the FirstPathStartPoint function will be used as the start point for the arc. If no such point has been defined then there will be an error.
If this is the first point in a new tool path but there was not a tool change then the last point defined in the last tool path 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 any identifier.
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.
No first point: This is the first move in the first tool path after a tool change and no starting point has been defined using FirstPathStartPoint.
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 CamModeOn
In Cam mode the system assumes that the applicaton will create new workingsteps explicitly by changing the tool or calling the Workingstep function. If the mode is off then the DLL will assume that the application does not have this level of control and it will create a new workingstep whenever the spindle speed changes. Cam mode is set to off by default and should normally be off when using the APT parsers because otherwise the workingsteps made by the parsers will be very long and difficult to manage.
Arguments:
This function does not have any arguments.
Result:
This function has a void result.
Related Functions
CamModeOff: Sets the Cam mode to off (the default).
SpindleSpeed: If Cam mode is on then a change to the spindle speed will create a new tool path but not a new workingstep. If Cam mode is off then a change will only create a new tool path.
LoadTool: A new workingstep is created whenever the tool is changed.
Feedrate: A new toolpath is created wheneve the feedrate is changed.
Workingstep: CAM translators can use this function to explicitly create new workingsteps and thereby make sure that each CAM operation corresponds to one workingstep even if the spindle speed changes.
2.5 CamModeOff
See CamModeOn.
2.6 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 cutter center 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.7 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
Reset: This function sets the APT object back to its initial state.
Shutdown: This function deletes all the memory used by the APT object.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.8 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.9 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 anyway though in practice when they are distinct many systems will connect them regardless. Other systems may issue a warning message.
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.10 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 cutter contact 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.11 CoolantMist
This function turns the coolant on for all subsequent tool paths 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.12 CoolantOn
See CoolantMist.
2.13 CoolantOff
See CoolantMist.
2.14 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.
Before CNC 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 Section 2.165 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.
Functions in the finder object can be used to find any workplan in a STEP-NC program.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Bad identity: 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.15 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.
The tolerance object contains functions to measure tool wear.
2.16 DefaultToInches
Some APT tool path programs do not define their units for distance measurements. This function tells the system to use a default of 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 again with different default units.
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 but it is only used inside the APT parser functions if there is an APT inches command in the APT program.
Millimeters: This function sets the length unit to millimeter for all subsequently defined geometry items but it is only used inside the APT parser functions if there is an APT inches command in the APT program.
Common Errors:
None.
2.17 DefaultToMillimeters
See DefaultToInches.
2.18 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 taper angle.
The cutting tool diameter is different to the cutting tool radius and a frequent cause of confusion to new CNC users. The diameter describes the diameter of the tool, but the radius describes the radius of a fillet between the diameter and the length of the cylinder.
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.
Arguments:
tool_diameter: The diameter of the cutting tool. Called Effective_cutting_diameter in the STEP-NC standard.
tool_radius: The radius of the fillet 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: 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.
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.19 DefineTool2
This function has all the parameters of the DefineTool function plus one additional parameter to define a unique identifier for the tool that can be used to find the tool in manufacturers catalogs. The geometry of a tool is associated with this identifier and not the tool number so if two tools have the same identifier they will have the same geometry.
Additional Arguments:
identifier: A unique name that can be used to find reference data for the tool in a manufacturers catalog or ISO 13399 file.
Result:
The function has a void result.
Additional Related Functions
SetToolIdentifier: Function to define and change the identifier of a tool.
ToolGeometry: This function assigns AP-203 geometry to a tool using its identifier.
GetToolIdentifier: Get the identifier for a tool with a given number.
Additional Common Errors:
None.
2.20 DeleteExecutable
Delete the given workingstep, nc function, workplan or selective from the STEP-NC program.
Arguments:
ex_id: The identity of the workinstep, workplan, nc function or selective to be deleted.
Result:
This function returns a void result.
Related Functions
Any function that makes an executable.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Bad identity: The ex_id does not identify an executable.
2.21 DeleteFixture
Delete the current fixture.
Arguments:
None.
Result:
This function returns a void result.
Related Functions
GetCurrentFixture: Returns the identity of the current fixture or 0.
Fixture: Defines the fixture using an AP-203 file.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.22 DeleteRawpiece
Delete the current rawpiece.
Arguments:
None.
Result:
This function returns a void result.
Related Functions
GetCurrentRawpiece: Returns the identity of the current rawpiece or 0.
Rawpiece: Define a rawpiece using an AP-203 file.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.23 DeleteWorkpiece
Delete the current program workpiece.
Arguments:
None.
Result:
This function returns a void result.
Related Functions
GetCurrentWorkpiece: Returns the identity of the current workpiece or 0.
Workpiece: Define a workpiece using an AP-203 file.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.24 DeleteToolGeometry
Delete the geometry defined for a tool.
Arguments:
tool_identifier: The identifier of the tool to be deleted.
Result:
This function returns a void result.
Related Functions
GetToolIdentifier: Returns the identifier of a tool so that it can be deleted.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
2.25 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 STEP-NC program.
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.26 ExecutableWorkpieceAsIs
This function defines the geometry of a workingstep as-is volume from an AP-203 file. The function assumes that all of the geometry in the file is to make up the as-is model Any STEP file can be used to define the geometry provided it is compatible with AP-203. If the STEP file is an AP-203 Edition 2 file then tolerances and dimensions can be included on the model. See the Tolerance object for more information.
This function define a model of what the geometry of the workpiece should look like before the workingstep begins executing.
The intent of the ExecutableWorkpieceAsIs, ExecutableWorkpieceToBe and ExecutableWorkpieceRemoval functions is to define additional geometry for a workingstep or other executable so that work instructions can be given to the operator.
Arguments:
File name: The name of the STEP file that defines a geometry model.
exe_id: The identity of an workingstep, nc function, workplan or selective.
Result:
The function has a void result.
Related Functions
PutPlacement: This function changes the placement of the workpiece so that it can be positioned and oriented correctly within the context of the tool paths.
GetCurrentWorkingstep: Returns the id of the current workpiece or null (0).
ExecutableWorkpieceToBe: Define the To-BE geometry of a workingstep.
ExecutableWorkpieceRemoval: Defined the removal geometry of a workinstep.
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 workpiece cannot have the same name as the project.
Bad identity: The exe_id does not identify an executable.
2.27 ExecutableWorkpieceToBe
See ExecutableWorkpieceAsIs. This function define a model of what the geometry of the workpiece should look like after the workingstep has finished executing.
2.28 ExecutableWorkpieceRemoval
See ExecutableWorkpieceAsIs. This function define a model of the geometry that will be removed while the workingstep is executing.
2.29 ExecutableReuse
This function repeats an executable by putting it into the current workplan. For example, if the same operation is needed in more than one alternative of a Selective.
Arguments:
exe_id The identity of the executable that is to be repeated. The executable may be a workingstep, workplan, NC function or selective.
Result:
The function has a void result.
Related Functions
ExectuableReuseAfter: This function has parameters to control the placement of the repeated executable.
WorkingstepReuse: Repeats workingsteps only.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Bad identity: The exe_id does not identify a workingstep.
2.30 ExecutableReuseAfter
Repeats an executable at a given location in the STEP-NC program.
Arguments:
exe_id The identity of the executable that is to be repeated. The executable may be a workingstep, workplan, NC function or selective.
index: The desired position for the executable in the workplan.
plan_id: The identity of the workplan that is to contain the new executable. See Section 2.165 for some important notes on how to use identifiers.
Result:
The function has a void result.
Related Functions
ExecutableReuse: Repeats the executable at the current end of the STEP-NC program.
WorkingstepReuseAfter: Repeats workingsteps only.
Common Errors:
No project open: An AP-238 file must be open - see the NewProject function.
Bad identity: The exe_id does not identify an executable.
2.31 ExportAll
The APT allows all the AP-203 geometries and placements defined for the workpiece, rawpiece and fixtures 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
ExportWorkpiece: Export a specific workpiece which may be a rawpiece, fixture, in-process geometry model or any other model in the STEP-NC program.
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.32 ExportApt
Write the tool paths defined for the STEP-NC program into an APT file.
Arguments:
File name: File name for the APT file that is to contain the tool paths.
Result:
The result is put into an APT file using the UGS syntax.
Related Functions
ReadUGSAPTclfile: Read an APT file and use it to define the geometry of tool paths.
Common Errors:
No geometry: The geometry of the fixture has not been defined in the program.
2.33 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 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.
SetCNCexportUsingBlockNumbers: 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.34 ExportAsDmisManual
Same functionality as for ExportAsFanuc but for CMM machines that read DMIS programs in manual mode.
2.35 ExportAsDmisCNC
Same functionality as for ExportAsFanuc but for CMM machines that read DMIS programs in cnc mode.
2.36 ExportAsESAB
Same functionality as for ExportAsFanuc but for ESAB plate cutting and marking controls.
2.37 ExportAsHaas
Same functionality as for ExportAsFanuc but for Haas controls.
2.38 ExportAsHeidenhainAC
Same functionality as for ExportAsFanuc but for Heidenhain controls with AC axes.
2.39 ExportAsHeidenhainBC
Same functionality as for ExportAsFanuc but for Heidenhain controls with BC axes.
2.40 ExportAsMDSI
Same functionality as for ExportAsFanuc but for MDSI controls.
2.41 ExportAsOkuma
Same functionality as for ExportAsFanuc but for Okuma controls.
2.42 ExportAsSiemens
Same functionality as for ExportAsFanuc but for Siemens controls.
2.43 ExportToolGeometry
This function exports the geometry of the cutting tools.
Arguments:
Tool_identifier: The identifier of the tool whose geometry is to be exported.
File name: File name for the AP-203 file.
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.44 ExportWorkpiece
This function exports the geometry and placement of a workpiece so that it can be read by another application. The workpiece can be a rawpiece, fixture, in-process geoemetry as well as the workpiece of the STEP-NC program.
Arguments:
wp_id: The identifier for a workpiece. See Section 2.165 for a note on identifiers
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
PutPlacement: This function defines a placement for a workpiece.
GetCurrentWorkpiece: This function returns the identity of the current program workpiece.
GetCurrentRawpiece: This function returns the identity of the rawpiece of the current program workpiece.
GetCurrentFixture: This function returns the identity of the current fixture model.
GetExecutableWorkpieceAsIs: This function returns the identity of the workpiece that defines the as-is (before machining) geometry for a workinstep.
GetExecutableWorkpieceToBe: This function returns the identity of the workpiece that defines the to-be (after machining) geometry for a workinstep.
GetExecutableWorkpieceRemoval: This function returns the identity of the workpiece that defines the removal volume for a workingstep.
Common Errors:
No geometry: The geometry of the workpiece has not been defined in the program.
Bad identity: The wp_id does not identify a workpiece.
2.45 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. 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.46 ExtendedNcFunctionAfter
Inserts an 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
Index: The desired position for the function in the workplan.
Plan_id: The identity of the workplan that is to contain the new function. See Section 2.165 for some important notes on how to use identifiers.
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.47 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.48 FeedrateCSS
This function defines a constant spindle speed feedrate for turning applications.
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.49 FeedrateUnit
This function defines the feedrate units to be used for all subsequent tool paths and sets the current feedrate to 0. The function should be followed by a call to Feedrate to set a new feedrate value.
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 current technology object. Will be NULL when new feedrate units or spindle speed units have been set but not yet used.
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.50 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 if no other axis has been given.
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.51 FirstPathStartPoint
This function defines a start point to be used for the tool path at the start of a program or after the tool has been changed if no other point has been given.
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.52 Fixture
This function defines the geometry of the fixture from an AP-203 file. The function assumes that all of the geometry in the file is to make up the fixture. Any STEP file can be used provided it is compatible with AP-203. It is quite common for a fixture to be defined as an assembly of parts such as four bolts. If the file is an AP-203 Edition 2 file then the geometry may include dimensions and tolerances.
Arguments:
File name: The name of the STEP file that defines the fixture.
Result:
The function has a void result.
Related Functions
PutPlacement: This function changes the placement of the fixture so that it can be positioned and oriented correctly within the context of the tool paths.
Workpiece: Performs the same function as rawpiece but for the workpiece
Rawpiece: Performs the same function as rawpiece but for the fixture.
GetCurrentRawpiece: Returns the id of the current rawpiece 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 rawpiece cannot have the same name as the project.
2.53 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 (1, T1);
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.
2.54 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 FeedrateUnit function.
Arguments:
None.
Result:
The result is a double. The value last set using the Feedrate function.
Related Functions
Feedrate: This function sets the value of the feed variable.