Class SessionShell
- Namespace
- Hi.MachiningProcs
- Assembly
- HiNc.dll
End-user-facing facade for a machining session: aggregates session lifecycle, NC playback, optimization, geometry I/O, and scripting infrastructure into a single delegation surface. Used as the C# script globals object and as the concrete target of ISessionCommand implementations.
public class SessionShell : ISessionShell
- Inheritance
-
SessionShell
- Implements
- Inherited Members
- Extension Methods
Fields
DefaultScriptOptions
The default Roslyn ScriptOptions for session scripts — references the SessionShell-domain assemblies and imports. Used as the initial value of the project-level ScriptOptions.
public static readonly ScriptOptions DefaultScriptOptions
Field Value
Properties
DefaultParaTemplateDimension
Gets or sets the parameter template dimension (2D or 3D).
[JsAce]
public int DefaultParaTemplateDimension { get; set; }
Property Value
DiffVisualRadius_mm
Gets or sets the visual radius in millimeters for difference visualization: the colour-scale ceiling of the diff overlay. A project setting (saved with the project, see DiffVisualRadius_mm) that recolours the current overlay live; independent of the detection radius Diff(double) ran with. Finite and positive.
[JsAce]
public double DiffVisualRadius_mm { get; set; }
Property Value
DispCacheMb
Gets or sets the display cache size in megabytes.
[Obsolete]
public long DispCacheMb { get; set; }
Property Value
DispCache_Mb
Gets or sets the display cache size in megabytes.
[JsAce]
public long DispCache_Mb { get; set; }
Property Value
EmbeddedLogMode
Gets or sets the embedded log mode for NC optimization.
[JsAce]
public static NcOptimizationEmbeddedLogMode EmbeddedLogMode { get; set; }
Property Value
EnableCollisionDetection
Gets or sets whether collision detection is enabled.
[JsAce(DocContentHtml = "Enable Collision Detection.")]
public bool EnableCollisionDetection { get; set; }
Property Value
EnableCwePhasePairing
Whether the milling-parameter trainings (TrainMillingPara(SampleFlag, string, double, ICuttingPara),
ReTrainMillingPara(SampleFlag, string, double)) read the rotation phase of the steps built from this
position of the play on by the CWE block pairing, instead of the self-bootstrapped lead
parameter (Train) or the seed (ReTrain). In effect from the position it is set at, as
MachiningResolution_mm and NcOptOption are: set it in a
mission script before PlayNcFile for the whole play, or in an NC-embedded script
line to open or close a range – a one- or two-flute section of a mixed-flute training
paired, the three- and four-flute rest on the lead or the seed, one regression over all
of them. On Mx|My alone the lead of a TrainMillingPara(SampleFlag, string, double, ICuttingPara) takes its phase from
the training's one-flute steps, flagged here or not; without any, the three- and
four-flute rest needs the seed of a ReTrainMillingPara(SampleFlag, string, double). A step flagged
here whose cutter has three or more flutes is aligned by the
other path with a warning; the pairing supports one and two flutes. Reading the property
gives the value in effect now: the process-wide default
EnableCwePhasePairing until this session sets it, which old
scripts that set only that default keep using for every step.
public bool EnableCwePhasePairing { get; set; }
Property Value
EnableIndividualStepAdjustmentLog
Gets or sets whether to enable individual step adjustment logging. The setter drives both optimization pipelines: the legacy HardNc Hi.NcOpt.NcOptProc.EnableIndividualStepAdjustmentLog and the SoftNc EnableStepAdjustmentLog statics are assigned together; the getter reads the legacy static (the pair only diverges when a static is assigned directly, bypassing this proxy).
[JsAce]
public static bool EnableIndividualStepAdjustmentLog { get; set; }
Property Value
EnableMapOnSelectionEnd
Gets or sets whether to automatically map selections when they end.
[JsAce]
public bool EnableMapOnSelectionEnd { get; set; }
Property Value
EnableMotionDependentMachiningResolution
Gets or sets whether motion-dependent machining resolution is enabled.
[JsAce]
public bool EnableMotionDependentMachiningResolution { get; set; }
Property Value
EnableMzLeverWeightingOnTraining
Gets or sets whether Mz lever weighting is enabled on training.
[Obsolete]
public bool EnableMzLeverWeightingOnTraining { get; set; }
Property Value
EnableNativeMillingPhysics
Gets or sets whether the physics runs on the native (core.dll) kernels. Default is true, and in shipping builds the native kernel is the only physics implementation — setting this to false throws unless the non-shipping managed reference assembly is registered (dev/test hosts only).
[JsAce(DocContentHtml = "Run the physics on the native kernels (the only implementation in shipping builds).")]
public bool EnableNativeMillingPhysics { get; set; }
Property Value
EnablePauseOnCollision
Gets or sets whether to pause execution when a collision is detected. This property only has an effect if collision detection is enabled.
[Obsolete]
public bool EnablePauseOnCollision { get; set; }
Property Value
EnablePauseOnFailure
Gets or sets whether to pause on failure during execution.
[JsAce(DocContentHtml = "Enable Pause On Failure.")]
public bool EnablePauseOnFailure { get; set; }
Property Value
EnablePhysics
Gets or sets whether milling force evaluation is enabled.
[JsAce(DocContentHtml = "Enable milling force evaluation.")]
public bool EnablePhysics { get; set; }
Property Value
EnableSampleNormalization
[Obsolete]
public bool EnableSampleNormalization { get; set; }
Property Value
Remarks
The input normalization deminish the quantity effect. The R-value decreases from 99% to 70% in an observed moment-training case. Don't apply this option.
EnableSoftNcRunner
Switches between SoftNcRunner and the legacy
HardNcRunner. Default true; set false to
fall back to the legacy runner (e.g. for NC optimization, which still
reads NcLines).
Will be removed when HardNcRunner is fully replaced.
[JsAce(DocContentHtml = "Enable SoftNcRunner (default) instead of legacy HardNcRunner.")]
public bool EnableSoftNcRunner { get; set; }
Property Value
EnableStrokeLimitCheck
Gets or sets whether the stroke limit check is enabled — the project's EnableStrokeLimitCheck, saved with the project. It governs the per-step check, from the next step played, and the warning a session begin gives about linear axes without both limits. The end position of every NC block is compared against any limit the controller's table holds whether this switch is on or off.
[JsAce(DocContentHtml = "Enable the stroke limit check: every played step is checked against the controller's stroke limits, and a session warns as it begins about linear axes without both limits. Saved with the project.")]
public bool EnableStrokeLimitCheck { get; set; }
Property Value
EnableWearEffect
Gets or sets whether tool wear effects are enabled in simulation.
[JsAce]
public bool EnableWearEffect { get; set; }
Property Value
FeedPerCycle
Gets a new feed per cycle machining motion resolution instance.
[JsAce]
public FeedPerCycleMachiningMotionResolution FeedPerCycle { get; }
Property Value
FeedPerTooth
Gets a new feed per tooth machining motion resolution instance.
[JsAce]
public FeedPerToothMachiningMotionResolution FeedPerTooth { get; }
Property Value
Fixture
Gets or sets the fixture.
[JsAce]
public Fixture Fixture { get; set; }
Property Value
Global
[JsAce("Global[$1key]")]
public Dictionary<object, object> Global { get; }
Property Value
InitSpindleTemperature_C
Gets or sets the initial spindle temperature in degrees Celsius.
[JsAce(DocContentHtml = "Spindle Temperature on initialization.")]
public double InitSpindleTemperature_C { get; set; }
Property Value
JsAceCompletionProfileJsonArray
Internal used.
public static JsonArray JsAceCompletionProfileJsonArray { get; }
Property Value
MachiningMotionResolution
Gets or sets the machining motion resolution.
[JsAce]
public IMachiningMotionResolution MachiningMotionResolution { get; set; }
Property Value
MachiningResolution
Gets or sets the machining resolution in millimeters.
[JsAce]
[Obsolete("Use MachiningResolution_mm instead.")]
public double MachiningResolution { get; set; }
Property Value
MachiningResolution_mm
Gets or sets the machining resolution in millimeters.
[JsAce]
public double MachiningResolution_mm { get; set; }
Property Value
MachiningSession
public MachiningSession MachiningSession { get; }
Property Value
MapTask
The mappings issued so far by Map(string, IFileTimeSection, CycleSamplingMode?), as one chain: it completes when
every one of them has ended, in the state of the one issued last –
RanToCompletion when it mapped, Canceled when a stop (Terminate(),
which cancels the token a mapping waits for its steps on) ended it before it
could, Faulted when it threw. TrainMillingPara(SampleFlag, string, double, ICuttingPara), ReTrainMillingPara(SampleFlag, string, double)
and EstimateSetupAngle(SampleFlag, string, bool, double, string) wait on it first and, when it is not
RanToCompletion, skip their work with one message (DataMapping–Stopped,
DataMapping–Failed) instead of throwing; the next mapping that runs to
completion clears that state. A new session starts with a completed chain.
public Task MapTask { get; set; }
Property Value
MappingAnchorDateTime
Project-scoped anchor that converts an absolute-time mapping window / sensor stream into a relative timecode. Delegates to MappingAnchorDateTime; auto-set from the first controller instant on PlayCsvFile(string), or set here.
[JsAce]
public DateTime? MappingAnchorDateTime { get; set; }
Property Value
MillingCycleDivisionNum
Gets or sets the number of angular divisions per spindle revolution for milling force calculation. The default (36) is intended for normal simulation — a finer division does not improve force playback and only slows it down. Only TrainMillingPara(SampleFlag, string, double, ICuttingPara) benefits from a finer division (e.g. 180): set it in the training script before the simulation run the training consumes. The value is process-wide (backed by RotationDivisionNum): it is not saved into the project and survives ResetRuntime() and project switches, so set it back (or restart the instance) after training to keep normal simulation fast.
[JsAce]
public static int MillingCycleDivisionNum { get; set; }
Property Value
MillingForceCycleDivisionNum
Gets or sets the number of divisions per cycle for milling force calculation. This property should be set before milling force evaluation if TrainMillingPara(SampleFlag, string, double, ICuttingPara) is intended to be used.
[JsAce(DocContentHtml = "Obsoleted. Use MillingCycleDivisionNum instead.")]
[Obsolete("Use MillingCycleDivisionNum instead.")]
public static int MillingForceCycleDivisionNum { get; set; }
Property Value
NcOptOption
Gets or sets the NC optimization options.
[JsAce]
public NcOptOption NcOptOption { get; set; }
Property Value
OptEnableDepthCompensation
Enables or disables depth compensation during optimization.
[JsAce]
public bool OptEnableDepthCompensation { get; set; }
Property Value
OptEnableFeedrate
Gets or sets whether to enable feed rate optimization in NC optimization.
[JsAce]
public bool OptEnableFeedrate { get; set; }
Property Value
OptEnableForwardCompensation
Enables or disables forward compensation during optimization.
[JsAce]
public bool OptEnableForwardCompensation { get; set; }
Property Value
OptEnableInterpolation
Enables or disables reinterpolation for optimization.
[JsAce]
public bool OptEnableInterpolation { get; set; }
Property Value
OptEnableSideCompensation
Enables or disables side compensation during optimization.
[JsAce]
public bool OptEnableSideCompensation { get; set; }
Property Value
OptExtendedPostDistance_mm
Gets or sets the extended post-distance in millimeters for NC optimization. This is the distance after the current segment that will be considered for optimization.
[JsAce]
public double OptExtendedPostDistance_mm { get; set; }
Property Value
OptExtendedPreDistance_mm
Gets or sets the extended pre-distance in millimeters for NC optimization. This is the distance before the current segment that will be considered for optimization.
[JsAce]
public double OptExtendedPreDistance_mm { get; set; }
Property Value
OptFeedrateAssignmentRatio
Gets or sets the feedrate assignment ratio for optimization. If the feedrate change exceeds this ratio, the feedrate in the NC line will be updated.
[JsAce]
public double OptFeedrateAssignmentRatio { get; set; }
Property Value
OptMaxAcceleration_mmds2
Maximum acceleration in mm/s² during optimization. Only takes effect on reinterpolated section.
[JsAce(DocContentHtml = "Only take effect on reinterpolated section.")]
public double OptMaxAcceleration_mmds2 { get; set; }
Property Value
OptMaxFeedPerTooth_mm
Gets or sets the maximum feed per tooth in millimeters for optimization.
[JsAce]
public double OptMaxFeedPerTooth_mm { get; set; }
Property Value
OptMaxFeedrate_mmdmin
Maximum feed rate in mm/min for cutting movements during optimization.
[JsAce]
public double OptMaxFeedrate_mmdmin { get; set; }
Property Value
OptMaxJerk_mmds3
Maximum jerk in mm/s³ during optimization. Only takes effect on reinterpolated section.
[JsAce(DocContentHtml = "Only take effect on reinterpolated section.")]
public double OptMaxJerk_mmds3 { get; set; }
Property Value
OptMinFeedPerTooth_mm
Gets or sets the minimum feed per tooth in millimeters for optimization.
[JsAce]
public double OptMinFeedPerTooth_mm { get; set; }
Property Value
OptMinFeedrate_mmdmin
Minimum feed rate in mm/min for cutting movements during optimization.
[JsAce]
public double OptMinFeedrate_mmdmin { get; set; }
Property Value
OptPreferedForce_N
Preferred force in N for optimization.
[JsAce]
public double OptPreferedForce_N { get; set; }
Property Value
OptRapidFeed_mmdmin
Rapid feed rate in mm/min for non-cutting movements during optimization.
[JsAce]
public double OptRapidFeed_mmdmin { get; set; }
Property Value
OptSpindlePowerSafetyFactor
Safety factor for MAX spindle power during optimization.
[JsAce]
public double OptSpindlePowerSafetyFactor { get; set; }
Property Value
OptSpindlePowerUtilizationFactor
Utilization factor for MAX spindle power during optimization. It is the reciprocal of the spindle power safety factor.
[JsAce]
public double OptSpindlePowerUtilizationFactor { get; set; }
Property Value
OptSpindleTorqueSafetyFactor
Gets or sets the MAX spindle torque safety factor for NC optimization.
[JsAce]
public double OptSpindleTorqueSafetyFactor { get; set; }
Property Value
OptSpindleTorqueUtilizationFactor
Utilization factor for MAX spindle torque during optimization. It is the reciprocal of the spindle torque safety factor.
[JsAce]
public double OptSpindleTorqueUtilizationFactor { get; set; }
Property Value
OptThermalYieldSafetyFactor
Safety factor for spindle torque during optimization.
[JsAce]
public double OptThermalYieldSafetyFactor { get; set; }
Property Value
OptThermalYieldUtilizationFactor
Utilization factor for thermal yield during optimization. It is the reciprocal of the thermal yield safety factor.
[JsAce]
public double OptThermalYieldUtilizationFactor { get; set; }
Property Value
OptYieldingSafetyFactor
Safety factor for yielding during optimization.
[JsAce]
public double OptYieldingSafetyFactor { get; set; }
Property Value
OptYieldingUtilizationFactor
Utilization factor for yielding during optimization. It is the reciprocal of the yielding safety factor.
[JsAce]
public double OptYieldingUtilizationFactor { get; set; }
Property Value
ScriptOptions
ScriptOptions.
public ScriptOptions ScriptOptions { get; set; }
Property Value
ShellProgress
Session-level routine / lifecycle message sink on the IMessage channel (cache reset, file progress, session start/done). Owned by MachiningSession (truly session-scoped); exposed here for scripts and the session facade.
[JsAce]
public ShellProgress ShellProgress { get; }
Property Value
StepCount
Gets the total number of milling steps.
[JsAce]
public int StepCount { get; }
Property Value
StepDiagnosticProgress
Step-anchored message sink on the IMessage channel (see StepDiagnosticProgress).
[JsAce]
public StepDiagnosticProgress StepDiagnosticProgress { get; }
Property Value
Workpiece
Gets or sets the workpiece.
[JsAce]
public Workpiece Workpiece { get; set; }
Property Value
Methods
AddTimeDataByFile(string, string, double, double)
Adds time-based data from a file to the time mapping dictionary with specified time bounds in seconds.
[JsAce("AddTimeDataByFile($1key, $2relFile, $3beginTime, $4endTime)")]
public bool AddTimeDataByFile(string key, string relFile, double beginTime, double endTime)
Parameters
keystringKey to identify the data
relFilestringRelative path to the data file
beginTimedoubleBeginning time in seconds
endTimedoubleEnding time in seconds
Returns
- bool
True if the data was successfully added, false otherwise
AddTimeDataByFile(string, string, string, string)
Adds time-based data from a file to the time mapping dictionary with specified time bounds.
[JsAce("AddTimeDataByFile($1key, $2relFile, $3beginTime, $4endTime)")]
public bool AddTimeDataByFile(string key, string relFile, string beginTimeText, string endTimeText)
Parameters
keystringKey to identify the data
relFilestringRelative path to the data file
beginTimeTextstringBeginning time as text (seconds or TimeSpan format)
endTimeTextstringEnding time as text (seconds or TimeSpan format)
Returns
- bool
True if the data was successfully added, false otherwise
AdjustedFeedPerCycle(double, double)
Gets a new feed per cycle machining motion resolution instance with adjusted scale and minimum linear resolution.
[JsAce("AdjustedFeedPerCycle($1scale,$2minLinearResolution_mm)")]
public FeedPerCycleMachiningMotionResolution AdjustedFeedPerCycle(double scale, double minLinearResolution_mm = 0)
Parameters
scaledoubleThe scale factor for the resolution.
minLinearResolution_mmdoubleThe minimum linear resolution in millimeters. Default is 0.
Returns
- FeedPerCycleMachiningMotionResolution
A new FeedPerCycleMachiningMotionResolution instance with the specified parameters.
AlignWorkpieceProgramZeroToIso(string)
Places workpiece + fixture so that ProgramZeroAnchor
coincides with the world position the spindle reaches when the machine
coordinate equals isoCoordId's entry (G54/G55/...).
The mount anchors must already be set per the general rule (typically by
the project XML): FixtureMount at the bottom
center of the workpiece geom, WorkpieceMount at the
top center of the fixture geom, ProgramZeroAnchor
at the workpiece-geom top center (or any chosen tip). Only the transformer
of the one branch leading from GeomAnchor straight to
TableMount is mutated — replaced by a
StaticTranslation. The fixture's topology is free: when it
has no such static branch (no direct branch, or one carrying a dynamic
transformer) the util reports why on the session messages and this
returns with AlignWorkpieceProgramZeroToIso–Failed. Delegates
topology math to
TryAlignWorkpieceProgramZeroToIso(IMachiningEquipment, vec3d_t, out vec3d_t, IProgress<IMessage>).
[JsAce]
public void AlignWorkpieceProgramZeroToIso(string isoCoordId)
Parameters
isoCoordIdstringID into the IsoCoordinateTable, e.g.
“G54”.
AppendMessagesToFile(string, params string[])
Appends messages to a file, optionally filtered by tags.
[JsAce("AppendMessagesToFile(\"dstRelFile\",flags)")]
public void AppendMessagesToFile(string dstRelFile, params string[] flags)
Parameters
dstRelFilestringDestination relative file path
flagsstring[]Optional flags to filter messages by tags
ArmSetupAngleEstimation(SetupAngleOnlineRequest)
ArmSetupAngleEstimation(int, double, string, bool, string, double, string, SampleFlag) with every option (cycle sampling, the scatter gate, the parameter as an object) spelled out.
public void ArmSetupAngleEstimation(SetupAngleOnlineRequest request)
Parameters
requestSetupAngleOnlineRequestThe request.
ArmSetupAngleEstimation(int, double, string, bool, string, double, string, SampleFlag)
Arms the online setup-angle estimation: from now on, the first
contactSeconds seconds of contact of the tool — its
touched steps from its first cut after this call until their durations
sum to that — are watched as the play builds them; when the window is
complete the player thread, at its next pace point, maps the recording
onto those steps, estimates the setup angle, and (unless the gate
refuses: contrast below LowContrastThreshold,
scatter above MaxScatterToApply_deg, a
preferred mirror, or a one-channel estimate of a one- or two-flute cutter
with two candidate angles) advances the tool's setup angle by it and recomputes
the steps built so far from their stored engagement
(RecomputeStepPhysics(int?)), so the rest of the play and the
finished strip carry one angle. Call it before the play (mission list) or
during it (an NC-embedded script line, the console); it needs a player
run — a play driven outside the player reports
SetupAngle-Online–NoPlayerRun when the window completes, and the
explicit EstimateSetupAngleByFirstContact(int, double, string, bool, string, double, string, int, SampleFlag) is the way then.
One arm at a time: a second call replaces the first. ResetRuntime()
and the end of the run disarm; a run that ends before the window is
complete reports SetupAngle-Online–NotReached.
The recording: for a CSV play, the played file (or a shot file written
alongside it) is mapped by the controller's wall clock; for an NC play the
file's Time column is read as the play's own timecode — the shot
file of a replay of the same program at the same resolution maps exactly
onto the steps. The file is re-read at the trigger, so a recording still
being written is seen up to date.
[JsAce("ArmSetupAngleEstimation($1toolId, $2contactSeconds, $3\"shotFile\")")]
public void ArmSetupAngleEstimation(int toolId, double contactSeconds, string shotRelFile, bool applyToTool = true, string dstRelFile = null, double outlierRatio = 0.1, string knownParaRelFile = null, SampleFlag sampleFlags = SampleFlag.Virtual)
Parameters
toolIdintTool-house id of the cutter, or -1 for the first tool that touches the workpiece after this call (the mounted tool when armed mid-play).
contactSecondsdoubleContact time to sample (touched steps only).
shotRelFilestringThe recording, relative to the project base directory.
applyToToolboolAdvance the tool's setup angle by the estimate and recompute the finished steps; false only reports.
dstRelFilestringOptional JSON report (relative to the project base directory).
outlierRatiodoubleFraction of the worst-fitting steps trimmed before the final estimate.
knownParaRelFilestringOptional cutting-parameter file (relative to the project base directory) to use instead of the workpiece's; it must not come from this holder at an unknown angle.
sampleFlagsSampleFlagChannels to use: Mx, My or both are the transverse channels the angle is read from (one alone suits a cutter with three or more flutes; on a one- or two-flute cutter one is read with the scale pinned, to 1 or to the ratio Mz measures, and gives two mirrored angles, never applied by the gate while two fit – a unique angle passes to its other checks); Mz, when selected, sharpens the per-step phase and the scale. Left out (Virtual), the tool is estimated on the moment channels it declares its holder has (ObservationChannels); a channel named here that the tool does not declare is refused (
Sample-Channel–NotObserved), never dropped.
BeginNcResultRecording(string)
Begins recording the play's result: every step, every toolpath position and every program block played from here on goes into a result folder, with the finished stock beside it when the recording ends – at the mission's end, at a stop of the player, at EndNcResultRecording(), or at the session's end. A runtime reset inside the recording completes the current folder and begins the next. A recording open already is completed first. The recording never stops the play: what it cannot do is said on the messages.
[JsAce(Snippet = "BeginNcResultRecording(\"Output/results/[NcName]-[timestamp]\");", DocContentHtml = "Begin recording the play's result (steps, toolpath, program blocks) into a result folder; completed at the mission's end or by EndNcResultRecording().")]
public void BeginNcResultRecording(string relDirectoryTemplate = "Output/results/[NcName]-[timestamp]")
Parameters
relDirectoryTemplatestringThe result folder, relative to the project folder (an absolute path is used as it is):
[NcName]is replaced by the first recorded program's file name,[timestamp]by the recording's time (yyyyMMdd-HHmmss); a folder that exists already gets-2,-3, ... appended.
BeginPreserve()
Begin Preserve section in optimzation process.
[JsAce("BeginPreserve()")]
public void BeginPreserve()
BeginSelection(string, AnchorMode, IStepShift)
Begin mark on current line: the bound is the index the line's first step gets, the strip's count on the shell thread (ShellThreadStepIndex) – 0 on a line before any step of the session, where no step bundle exists yet. A begin the run before left open – it stopped between this anchor and the key's end anchor – is dropped when the next outermost run starts, so this run's begin of the key is the one its end pairs with (ClearUnclosed()).
public void BeginSelection(string key, AnchorMode anchorMode = AnchorMode.LineBegin, IStepShift shift = null)
Parameters
keystringIdentifier key for the selection
anchorModeAnchorModeMode for anchoring the beginning of selection
shiftIStepShiftStep shift to apply
BeginSession()
Begins a new machining session. Not for end user.
public bool BeginSession()
Returns
- bool
True when a session was begun or one is alive already; false when the call was refused.
Remarks
Refused, with BeginSession–Busy logged at Error and no session begun, when no session is open and the
call is off the player thread while the player is running or paused – its run still beginning its own session, or a
mission script between its EndSession() and BeginSession(): with no session there is no shell to say it
on (BeginSession(IProgress<IMessage>)). A mission script's own call, on the player
thread, passes; with a session alive the call does nothing.
ClearDefectDisplayee()
Clears the defect displayee from the workpiece.
[JsAce]
public void ClearDefectDisplayee()
ClearTimeMappingData()
Clears all time mapping data.
[JsAce]
public void ClearTimeMappingData()
CloseNcResultReview()
Closes the review begun by OpenNcResultReview(string): the runtime is reset, as ResetRuntime() resets it (the strip, the step cache and the stock go). Without a review open, says so and resets nothing.
[JsAce("CloseNcResultReview();")]
public bool CloseNcResultReview()
Returns
- bool
True when a review was closed.
ConvertClToNcFiles(string)
Converts the CLSF play of the current session into Fanuc NC files
(writeback synthesis): the MSYS frame becomes a G68.2 tilted
working plane, tool posture becomes G43.4 RTCP with rotary
words, motions become G00/G01/G02/G03. Play the CL file on an
XYZABC machine chain first, then convert.
[JsAce(Snippet = "ConvertClToNcFiles(\"Output/[NcName].nc\")", DocContentHtml = "Convert the played CLSF into Fanuc NC files by substitute template keyword \"[NcName]\"")]
public void ConvertClToNcFiles(string relNcFileTemplate = "Output/[NcName].nc")
Parameters
relNcFileTemplatestringOutput path template;
[NcName]is replaced by the source file name.
DeleteNcResult(string)
Deletes one result folder: the files the recording wrote in it (result.db, its side
files, finish.wct), then the folder when nothing else is left in it. A folder that holds
no result.db is refused, and so is one being recorded, here or in another program.
[JsAce("DeleteNcResult($1\"Output/results/resultFolder\");")]
public bool DeleteNcResult(string relResultDirectory)
Parameters
relResultDirectorystringThe result folder, relative to the project folder.
Returns
- bool
True when the folder went too; false when it keeps entries the recording did not write.
DeleteOrphanNcResults(string)
Cleans up the incomplete result folders under relResultsDirectory: a folder
whose recording never ended (crashed or abandoned, no counts written) is deleted – the files
the recording wrote, and the folder when nothing else is left in it; a folder whose completion
was refused (its records and counts in) is completed and kept; a folder that does not read, or
whose file a connection still holds (a recording in progress, here or in another program), is
left alone and said.
[JsAce("DeleteOrphanNcResults(\"Output/results\");")]
public int DeleteOrphanNcResults(string relResultsDirectory = "Output/results")
Parameters
relResultsDirectorystringThe results directory, relative to the project folder.
Returns
- int
How many folders were deleted.
Diff(double)
Performs a difference analysis on the workpiece geometry to detect variations.
[JsAce("Diff($1detectionRadius_mm)")]
public void Diff(double detectionRadius_mm)
Parameters
detectionRadius_mmdoubleRadius for detecting differences
DisarmSetupAngleEstimation()
Cancels a pending ArmSetupAngleEstimation(int, double, string, bool, string, double, string, SampleFlag); a window already complete and queued on the player still runs.
[JsAce("DisarmSetupAngleEstimation()")]
public void DisarmSetupAngleEstimation()
EndNcResultRecording()
Ends the recording begun by BeginNcResultRecording(string): the result folder is completed and the finished stock written beside the file; the player waits for it. Without a recording open, says so.
[JsAce("EndNcResultRecording();")]
public void EndNcResultRecording()
EndPreserve()
End Preserve section in optimzation process.
[JsAce("EndPreserve()")]
public void EndPreserve()
EndSelection(string, AnchorMode, IStepShift)
End mark on current line for selection: at the line's end the bound is the index of the last step
built so far, the strip's count on the shell thread
(ShellThreadStepIndex) less one (-1 before any step). On one session,
a replay of the program without a runtime reset between the runs (the player's Stop, then Start) reports
Line-End–Exception at this line for a key the earlier run closed: the key is closed already and
its section stands, as the steps it selects do. A key the earlier run left open (it stopped between the
two anchors) is dropped at the replay's start, so the replay's own begin and end pair.
public void EndSelection(string key, AnchorMode anchorMode = AnchorMode.LineEnd, IStepShift shift = null)
Parameters
keystringIdentifier key for the selection
anchorModeAnchorModeMode for anchoring the end of selection
shiftIStepShiftStep shift to apply
EndSession()
Ends the current machining session. Not for end user.
public bool EndSession()
Returns
- bool
True when the session was ended or none was open; false when the call was refused.
Remarks
Refused, with EndSession–Busy on ShellProgress and the session kept, when called off
the player thread while the player is running or paused, or with EndSession–BusyAnotherThread while another thread plays NC on this session
(EndSession(IProgress<IMessage>)). A mission script's own call, on the player thread,
passes while no other thread plays; with no session open the call does nothing.
ErrorMessage(string)
Displays an error message in the message host.
[JsAce("ErrorMessage($1message)")]
public void ErrorMessage(string message)
Parameters
messagestringThe error message to display
EstimateSetupAngle(SampleFlag, string, bool, double, string)
Estimates the tool's setup angle (how far the cutter is turned in the
holder, SetupAngle_deg) from the mapped smart-holder data and
the workpiece's cutting parameter (the seed ReTrainMillingPara(SampleFlag, string, double)
uses), one estimate per tool. The estimate is the rotation of the
measured (Mx, My) against the model's, folded into the flute period;
with applyToTool the tool's setup angle is advanced
by it (SetToolSetupAngle_deg(int, double)).
Read the diagnostics before trusting it: a low contrast means the cut
does not constrain the angle, a preferred mirror means the sensor axes
are swapped rather than rotated.
Waits for the mappings issued so far first (MapTask); when the
last of them was stopped or failed, the estimation is skipped with one message
(DataMapping–Stopped / DataMapping–Failed) and no estimate is made.
[JsAce("EstimateSetupAngle(dstRelFile: $1dstFile)")]
public List<SetupAngleEstimate> EstimateSetupAngle(SampleFlag sampleFlag = SampleFlag.Virtual, string dstRelFile = null, bool applyToTool = false, double outlierRatio = 0.1, string knownParaRelFile = null)
Parameters
sampleFlagSampleFlagChannels to use: Mx, My or both (a single transverse channel suits a cutter with three or more flutes; on a one- or two-flute cutter it is read with the scale pinned, to 1 or to the ratio Mz measures, and gives two mirrored angles, ScaleFixed). Mz, when selected, sharpens the per-step phase and the scale. Left out (Virtual), each tool is estimated on the moment channels it declares its holder has (ObservationChannels, the Tool House's holder channels); a channel named here that a tool does not declare is refused (
Sample-Channel–NotObserved), never dropped.dstRelFilestringOptional JSON report (relative to the project base directory): one SetupAngleReport per tool. A report that cannot be written is one
SetupAngle-Report–Fault; the estimates are still returned and, withapplyToTool, applied.applyToToolboolAdvance each estimated tool's setup angle by its estimate. The physics session snapshots the flute angles, so afterwards call RecomputeStepPhysics(int?) to update the finished steps in place, or ResetRuntime() before replaying.
outlierRatiodoubleFraction of the worst-fitting steps trimmed before the final estimate.
knownParaRelFilestringOptional cutting-parameter file (relative to the project base directory) to use instead of the workpiece's.
Returns
- List<SetupAngleEstimate>
The estimates, one per tool; empty when the estimation was skipped because the last data mapping was stopped or failed.
EstimateSetupAngleByFirstContact(SetupAngleOnlineRequest, int)
EstimateSetupAngleByFirstContact(int, double, string, bool, string, double, string, int, SampleFlag) with every option spelled out.
public SetupAngleOnlineResult EstimateSetupAngleByFirstContact(SetupAngleOnlineRequest request, int fromStepIndex = 0)
Parameters
requestSetupAngleOnlineRequestThe request.
fromStepIndexintFirst step index considered.
Returns
- SetupAngleOnlineResult
What was sampled, estimated, applied and recomputed.
EstimateSetupAngleByFirstContact(int, double, string, bool, string, double, string, int, SampleFlag)
The explicit form of ArmSetupAngleEstimation(int, double, string, bool, string, double, string, SampleFlag),
run now on the finished (or paused) strip: selects the tool's first
contactSeconds seconds of contact from
fromStepIndex on, maps the recording onto those steps,
estimates, gates, applies and recomputes — the same pipeline the armed
form runs at its pace point. Place it after the play command in the
mission list, or call it from the console once the play has ended; from a
mission script it runs on the player thread, so Pause and Stop apply to
the recompute as to a play. Reports SetupAngle-Online–WindowShort
and estimates on what there is when the tool's whole contact is shorter
than asked.
[JsAce("EstimateSetupAngleByFirstContact($1toolId, $2contactSeconds, $3\"shotFile\")")]
public SetupAngleOnlineResult EstimateSetupAngleByFirstContact(int toolId, double contactSeconds, string shotRelFile, bool applyToTool = true, string dstRelFile = null, double outlierRatio = 0.1, string knownParaRelFile = null, int fromStepIndex = 0, SampleFlag sampleFlags = SampleFlag.Virtual)
Parameters
toolIdintTool-house id of the cutter, or -1 for the first tool that touches the workpiece at or after
fromStepIndex.contactSecondsdoubleContact time to sample (touched steps only).
shotRelFilestringThe recording, relative to the project base directory.
applyToToolboolAdvance the tool's setup angle by the estimate and recompute the finished steps; false only reports.
dstRelFilestringOptional JSON report (relative to the project base directory).
outlierRatiodoubleFraction of the worst-fitting steps trimmed before the final estimate.
knownParaRelFilestringOptional cutting-parameter file (relative to the project base directory) to use instead of the workpiece's.
fromStepIndexintFirst step index considered; 0 = the tool's first cut of the strip.
sampleFlagsSampleFlagChannels to use: Mx, My or both are the transverse channels the angle is read from (one alone suits a cutter with three or more flutes; on a one- or two-flute cutter one is read with the scale pinned, to 1 or to the ratio Mz measures, and gives two mirrored angles, never applied by the gate while two fit – a unique angle passes to its other checks); Mz, when selected, sharpens the per-step phase and the scale. Left out (Virtual), the tool is estimated on the moment channels it declares its holder has (ObservationChannels); a channel named here that the tool does not declare is refused (
Sample-Channel–NotObserved), never dropped.
Returns
- SetupAngleOnlineResult
What was sampled, estimated, applied and recomputed.
ExportMeshedGeomToObj(string, double)
Exports the current meshed geometry to a Wavefront OBJ file with per-vertex RGB.
[JsAce("ExportMeshedGeomToObj($1\"dstFile\",$2resolution_mm)")]
public void ExportMeshedGeomToObj(string relFile, double resolution_mm = 0)
Parameters
relFilestringRelative path to the output OBJ file
resolution_mmdoubleResolution in millimeters (0 for default)
ExportMeshedGeomToPly(string, double)
Exports the current meshed geometry to a binary PLY file with per-vertex RGB.
[JsAce("ExportMeshedGeomToPly($1\"dstFile\",$2resolution_mm)")]
public void ExportMeshedGeomToPly(string relFile, double resolution_mm = 0)
Parameters
relFilestringRelative path to the output PLY file
resolution_mmdoubleResolution in millimeters (0 for default)
ExportMeshedGeomToStl(string, double)
Exports the current meshed geometry to an STL file.
[JsAce("ExportMeshedGeomToStl($1\"dstFile\",$2resolution_mm)")]
public void ExportMeshedGeomToStl(string relFile, double resolution_mm = 0)
Parameters
relFilestringRelative path to the output STL file
resolution_mmdoubleResolution in millimeters (0 for default)
ExportRuntimeGeomToObj(string, double)
Legacy script alias of ExportMeshedGeomToObj(string, double); kept so old player scripts keep working.
[Obsolete("Legacy alias; use ExportMeshedGeomToObj instead.")]
public void ExportRuntimeGeomToObj(string relFile, double resolution_mm = 0)
Parameters
ExportRuntimeGeomToPly(string, double)
Legacy script alias of ExportMeshedGeomToPly(string, double); kept so old player scripts keep working.
[Obsolete("Legacy alias; use ExportMeshedGeomToPly instead.")]
public void ExportRuntimeGeomToPly(string relFile, double resolution_mm = 0)
Parameters
ExportRuntimeGeomToStl(string, double)
Legacy script alias of ExportMeshedGeomToStl(string, double); kept so old player scripts keep working.
[Obsolete("Legacy alias; use ExportMeshedGeomToStl instead.")]
public void ExportRuntimeGeomToStl(string relFile, double resolution_mm = 0)
Parameters
FixedPace(double, double)
Creates a fixed machining motion resolution with specified parameters.
[JsAce("FixedPace($1linearResolution_mm, $2rotaryResolution_deg)")]
public FixedMachiningMotionResolution FixedPace(double linearResolution_mm, double rotaryResolution_deg)
Parameters
linearResolution_mmdoubleLinear resolution in millimeters
rotaryResolution_degdoubleRotary resolution in degrees
Returns
- FixedMachiningMotionResolution
A new fixed machining motion resolution instance
GetMachiningStep(int)
Retrieves the machining step at the specified index; null for an index the strip does not hold or a step not built yet.
[JsAce(Snippet = "GetMachiningStep($1\"stepIndex\")")]
public MachiningStep GetMachiningStep(int stepIndex)
Parameters
stepIndexintIndex of the machining step to retrieve
Returns
- MachiningStep
The machining step at the specified index
GetMillingStep(int)
The former name of GetMachiningStep(int), kept so the scripts that call it (project-embedded session scripts, scripts kept outside the projects) keep compiling; the method returns a MachiningStep, which the new name says.
[Obsolete("Renamed GetMachiningStep: the method returns a MachiningStep.")]
public MachiningStep GetMillingStep(int stepIndex)
Parameters
stepIndexintIndex of the machining step to retrieve
Returns
- MachiningStep
The machining step at the specified index
GetStickMachiningToolObservationHeight_mm(int)
Gets the observation height in millimeters for the specified stick machining tool.
[JsAce("GetStickMachiningToolObservationHeight_mm($1toolId)")]
public double GetStickMachiningToolObservationHeight_mm(int toolId)
Parameters
toolIdintThe ID of the tool
Returns
- double
The observation height in millimeters
GetToolSetupAngle_deg(int)
Gets the setup angle in degrees of the specified tool: how far the cutter is turned in the holder about the tool axis (SetupAngle_deg).
[JsAce("GetToolSetupAngle_deg($1toolId)")]
public double GetToolSetupAngle_deg(int toolId)
Parameters
toolIdintThe ID of the tool
Returns
- double
The setup angle in degrees
GetUniformFlutingOffsetAngle_deg(int)
Gets the flute offset angle in degrees of the uniform fluting of the specified tool, that is, for a cutter whose flutes all share one baseline flute contour: the angular position of the first flute on the cutter body (BaselineFluteOffsetAngle_deg). How the cutter is turned in the holder is GetToolSetupAngle_deg(int).
[JsAce("GetUniformFlutingOffsetAngle_deg($1toolId)")]
public double GetUniformFlutingOffsetAngle_deg(int toolId)
Parameters
toolIdintThe ID of the tool
Returns
- double
The flute offset angle in degrees
LineSelection(string, AnchorMode, IStepShift, AnchorMode, IStepShift)
Create a line selection from begin to end mark.
public void LineSelection(string key, AnchorMode beginAnchorMode = AnchorMode.LineBegin, IStepShift beginShift = null, AnchorMode endAnchorMode = AnchorMode.LineEnd, IStepShift endShift = null)
Parameters
keystringIdentifier key for the selection
beginAnchorModeAnchorModeMode for anchoring the beginning of selection
beginShiftIStepShiftStep shift to apply at beginning
endAnchorModeAnchorModeMode for anchoring the end of selection
endShiftIStepShiftStep shift to apply at end
ListNcResults(string)
Lists the result folders under relResultsDirectory, the newest first: each
with what its result file says (NcResultEntry: the program's name, when it was
recorded, whether it is complete, whether the play ran to its end, the counts).
[JsAce("ListNcResults(\"Output/results\");")]
public IReadOnlyList<NcResultEntry> ListNcResults(string relResultsDirectory = "Output/results")
Parameters
relResultsDirectorystringThe results directory, relative to the project folder.
Returns
- IReadOnlyList<NcResultEntry>
The entries, newest first.
LoadCuttingParaByFile(string)
Loads cutting parameters from a file.
[JsAce("LoadCuttingParaByFile($1\"relFile\")")]
public void LoadCuttingParaByFile(string relFile)
Parameters
relFilestringFile path relative to BaseDirectory.
Map(string, IFileTimeSection, CycleSamplingMode?)
Maps selection data to time section.
public Task Map(string key, IFileTimeSection fileTimeSection = null, StepTimeShotUtil.CycleSamplingMode? cycleSamplingMode = CycleSamplingMode.SpindleCycle)
Parameters
keystringIdentifier key for the selection
fileTimeSectionIFileTimeSectionFile time section, or null to use the one associated with the key
cycleSamplingModeStepTimeShotUtil.CycleSamplingMode?Cycle sampling mode
Returns
- Task
Task representing the asynchronous mapping operation
Remarks
A Stop of the player's run ahead of the mapping leaves its task Canceled before its body runs, and the await of this method throws a TaskCanceledException; a Stop while the mapping waits for its steps throws the run's OperationCanceledException; in a mission's script either is the stop, which Run(SessionShell, string) lets through to the player.
MapByActualTime(string, CycleSamplingMode)
Maps machining steps by actual time from a time shot file.
[Obsolete]
public void MapByActualTime(string timeShotRelFile, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode = CycleSamplingMode.SpindleCycle)
Parameters
timeShotRelFilestringRelative path to the time shot file.
cycleSamplingModeStepTimeShotUtil.CycleSamplingModeThe cycle sampling mode.
MapSeriesByCsvFile(string, MapSeriesCsvConfig)
MapSeriesByCsvFile(string, CycleSamplingMode) on a file whose column titles differ from the built-in ones.
public void MapSeriesByCsvFile(string timeShotRelFile, MapSeriesCsvConfig csvConfig)
Parameters
timeShotRelFilestringRelative path to the time shot file.
csvConfigMapSeriesCsvConfigColumn titles of the file; null reads the built-in titles.
MapSeriesByCsvFile(string, CycleSamplingMode)
Maps machining steps by actual time from a time shot csv file.
[JsAce("MapSeriesByCsvFile($1timeShotRelFile)")]
public void MapSeriesByCsvFile(string timeShotRelFile, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode = CycleSamplingMode.SpindleCycle)
Parameters
timeShotRelFilestringRelative path to the time shot file.
cycleSamplingModeStepTimeShotUtil.CycleSamplingModeThe cycle sampling mode.
Remarks
cycleSamplingMode sets how much sensor data each step is paired
with. The window is anchored at the step's end time and runs forward for one cycle
period, so a step is always regressed against samples its neighbours
produced. While the cut is steady that costs nothing: a neighbour cutting the same
arc at the same chip load produces, at a given rotation angle, the force this step
would have produced, so the borrowed rows are extra samples rather than extra
error. The pairing turns into a systematic bias only where the cutter-workpiece
engagement changes across the window — cutter entry, pass exit, corners, depth
changes. Restricting training to the steady part of the cut is therefore the
largest single accuracy lever, and once the transient is out the window choice
stops mattering: on the D8 2-flute Al6061-T6 case the two modes differ by 2.2
percentage points over the whole path (Fc error at feed-per-tooth 0.2:
−9.3 % for SpindleCycle versus −7.1 % for
FluteCycle) but by 0.06 over the steady part alone,
where both reach −3.3 % / −3.2 % at R 98.5 %. Keep the default and its larger
sample count; on a single-flute cutter the two modes coincide anyway.
Gaps in the data (an acquisition dropout, or rows carved out to keep the
steady section only) are handled: a step whose window contains no measured
row is excluded from the mapping, and one Map-ShotGap--StepsSkipped
warning carries the count. A window-edge row is only interpolated when its
bracketing rows span at most two spindle revolutions — farther rows sit
across a gap and no edge row is fabricated from them.
MapSeriesByCsvFile(string, CycleSamplingMode, MapSeriesCsvConfig)
MapSeriesByCsvFile(string, MapSeriesCsvConfig) with an explicit cycle sampling mode.
public void MapSeriesByCsvFile(string timeShotRelFile, StepTimeShotUtil.CycleSamplingMode cycleSamplingMode, MapSeriesCsvConfig csvConfig)
Parameters
timeShotRelFilestringRelative path to the time shot file.
cycleSamplingModeStepTimeShotUtil.CycleSamplingModeThe cycle sampling mode.
csvConfigMapSeriesCsvConfigColumn titles of the file; null reads the built-in titles.
MapSingleByCsvFile(string)
Reads a CSV file and performs time-based interpolation to map data to milling steps. It is one (step) - one (embedded-data) mapping. Every data column becomes a step variable the charts and the 3D view can pick (unless its key is registered already, which keeps its name, unit and format); a column named like a built-in step property is not mapped, and a message names those columns.
[JsAce(Snippet = "MapSingleByCsvFile($1\"csvFile\")")]
public void MapSingleByCsvFile(string csvFile)
Parameters
csvFilestringPath to the CSV file relative to the base directory
MapSingleByCsvFile(string, MapSingleCsvConfig)
MapSingleByCsvFile(string) on a file whose column titles differ from the default ones.
public void MapSingleByCsvFile(string csvFile, MapSingleCsvConfig csvConfig)
Parameters
csvFilestringPath to the CSV file relative to the base directory
csvConfigMapSingleCsvConfigColumn titles of the file; null reads the default titles
Message(string)
Displays a message in the message host.
[JsAce("Message($1message)")]
public void Message(string message)
Parameters
messagestringThe message to display
OpenNcResultReview(string)
Reviews a recorded play result: the strip, the steps and the physics charts show the result
file's play and the finished stock, when the result holds one, is loaded as the workpiece –
without a play. A recording open is ended first and the runtime is reset (the strip, the step
cache and the stock of the live play go). The review stays until the next reset – the player's
Reset, CloseNcResultReview(), ResetRuntime(), a project switch – and until
then a play, an act, a step-physics recompute, a recording and a setup-angle estimate are refused.
Refused, with nothing changed, from inside the NC run being played (an NC-embedded call:
NcResult-Review–Refused), while the player is running or paused on another thread
(NcResult-Review–Busy; NcResult-Review–BusyAnotherThread while another thread plays NC on the session),
and for the folder being recorded into (NcResult-Review–Recording).
[JsAce(Snippet = "OpenNcResultReview($1\"Output/results/resultFolder\");", DocContentHtml = "Review a recorded play result: the strip, the steps and the charts are rebuilt from its result file, without a play; an empty folder names the newest completed result.")]
public bool OpenNcResultReview(string relResultDirectory = "")
Parameters
relResultDirectorystringThe result folder, relative to the project folder (an absolute path is used as it is); empty for the newest completed result – the one a recording open at the call completes, else the newest under
Output/results.
Returns
- bool
True when the result is under review; false when the call was refused or the player stopped it (said on the messages).
OptCallPreferFuncIndexDictionary()
Gets the dictionary of preferred function index for NC optimization.
[JsAce("OptCallPreferFuncIndexDictionary()")]
public Dictionary<Func<MillingForceBrief, double>, double> OptCallPreferFuncIndexDictionary()
Returns
- Dictionary<Func<MillingForceBrief, double>, double>
Dictionary mapping functions to their preference indexes.
OptimizeToFiles(string)
Optimizes NC files and saves results using the specified file template.
Routing rule: when EnableSoftNcRunner is on and the session holds played SoftNc
SyntaxPieceLayers (non-empty), or the strip's steps were built under more than one
NC pipeline (a PowerReset(), a brand or preset switch, or a session ended between two plays, the strip
kept: NcPipelineResetStepIndex), the SoftNc pipeline
(OptimizeNcFiles(string, string, ICuttingPara, IProgress<IMessage>, CancellationToken, ReadBulkDelegate<StepLuggage>, ReadBulkDelegate<StepBrief>) / Hi.NcOpt.SoftNcOptProc) is used, its solver reading the
stored step luggage and the stored briefs from the step cache one segment at a time through
LocalProjectService.ReadStepLuggages and LocalProjectService.ReadStepBriefs (no reader, no cache to
clear); the second case it refuses with OptimizeNc–StripSpansPipelineReset and writes nothing, the mission
going on, where the HardNc path, given the strip's SoftNc steps and no HardNc lines, stopped the run on an error.
Otherwise the legacy HardNc OptimizeToFiles(ICuttingPara, MachiningSession, LinkedList<HardNcLine>, HardNcEnv, MachiningToolHouse, ClStrip, string, IProgress<IMessage>, CancellationToken, string) path runs, reading the stored briefs one step
at a time through TryGetMillingForceBrief(out MillingForceBrief) and
TryGetSeqPhysicsState(out SeqPhysicsState). Both paths first clear every cutter's
MillingCutterOptLimit cache.
Without the OptNcNoLimit login
neither path runs: OptimizeNc–NotLicensed is reported and the
call returns (Hi.NcOpt.SoftNcOptProc.ReportIfNotLicensed), as on
a session with nothing played, so a mission goes on to its next step.
A Stop of the player during the SoftNc pipeline ends the optimization on its canceled rows
(OptimizeToFiles–Canceled, then the closing OptimizeToFiles–Done) and then the
run itself: the call throws the player's OperationCanceledException, so nothing
after it in the mission or the script runs.
[JsAce(Snippet = "OptimizeToFiles(\"Output/Opt-[NcName]\")", DocContentHtml = "Optimize To Files by substitude template keywoard \"[NcName]\"")]
public void OptimizeToFiles(string relFileTemplate = "Output/Opt-[NcName]")
Parameters
relFileTemplatestringTemplate for output file path, can include [NcName] placeholder
Pace()
A pausable mark for the playing process. The function enables Pause() to take effect.
[JsAce("Pace();")]
public void Pace()
Remarks
Waits for the player to signal the next pace — a pace point, not a query. While no run (or one-shot) is live the pass is open and the call returns at once; while one is paused, a call off the player thread (a REST request's, a script's on a thread of its own) parks until Resume or Stop.
Pause()
Pause Player
[JsAce(DocContentHtml = "Pause Player")]
public void Pause()
PlayAct(IAct, ISentenceCarrier, CancellationToken?)
Plays an act with pacing control.
[JsAce]
public void PlayAct(IAct act, ISentenceCarrier sourceCommand = null, CancellationToken? cancellationToken = null)
Parameters
actIActThe act to play.
sourceCommandISentenceCarrierThe source command.
cancellationTokenCancellationToken?Cancellation token; null for the cancellation of the player's run in progress – an act a script plays inside the run is stopped with the run, its steps in flight dropped as the run's own, and the run after the stop starts at the last step that executed – or none while the player is idle.
Remarks
Refused, with Play–BusyAct on ShellProgress and nothing played, while the player is running or
paused – a mission's run, or a job such as the step-physics recompute – and this call is not on the player thread, or
with Play–BusyActAnotherThread while another thread plays NC on this session; a mission script's own call on the player thread and an NC-embedded
script's pass (ProcAct(IAct, ISentenceCarrier, CancellationToken?)). A SessionStepBuilt handler's
call is not refused this way: it throws (the exception below).
Exceptions
- ErrorTermRoleException
A role branch of the runtime machining chain is marked as an error term; an admitted act is not played (ProcAct(IAct, ISentenceCarrier, CancellationToken?); a refused one says
Play–BusyActorPlay–BusyActAnotherThreadand throws nothing).- InvalidOperationException
Called from a SessionStepBuilt handler, which runs on the step pipeline's thread: the act runner refuses it, and the exception is reported on that step as
Step–Exception.
PlayBrandNcFile(string)
Plays a famous-brand NC code file with the specified relative path (no kind dispatch — always the brand runner).
[JsAce("PlayBrandNcFile($1\"ncFile\");")]
public void PlayBrandNcFile(string relNcFilePath)
Parameters
relNcFilePathstringRelative path to the NC file
PlayClFile(string)
Plays an NX-CL (CLSF) file with the specified relative path.
[JsAce("PlayClFile($1\"clFile\");")]
public void PlayClFile(string relFilePath)
Parameters
relFilePathstringRelative path to the CLSF file
PlayClTeleport(double, double, double, double, double, double)
Plays a CL (cutter location) teleport operation.
[JsAce]
public void PlayClTeleport(double x, double y, double z, double i, double j, double k)
Parameters
xdoubleX coordinate.
ydoubleY coordinate.
zdoubleZ coordinate.
idoubleI vector component.
jdoubleJ vector component.
kdoubleK vector component.
Remarks
Refused with Play–BusyAct or Play–BusyActAnotherThread under the conditions PlayAct(IAct, ISentenceCarrier, CancellationToken?) names, and throws from a
SessionStepBuilt handler as it does.
Exceptions
- ErrorTermRoleException
A role branch of the runtime machining chain is marked as an error term; an admitted act is not played (ProcAct(IAct, ISentenceCarrier, CancellationToken?); a refused one says
Play–BusyActorPlay–BusyActAnotherThreadand throws nothing).- InvalidOperationException
Called from a SessionStepBuilt handler, as for PlayAct(IAct, ISentenceCarrier, CancellationToken?).
PlayCsvFile(string)
Plays an Csv file with the specified relative path.
[JsAce("PlayCsvFile($1\"csvFile\");")]
public void PlayCsvFile(string relFilePath)
Parameters
relFilePathstringRelative path to the CSV file
PlayNc(string, string)
Plays NC code directly from a string, executing each action and pacing between them.
[JsAce(Snippet = "PlayNc($1\"ncCommand\",$2\"\"(Direct Command)\"\");", DocContentHtml = "Play NC. second parameter is the file name alternative shows in the log.")]
public void PlayNc(string ncText, string fileNameAlternative = "--")
Parameters
PlayNcFile(string, NcKind)
Plays an NC program file with the specified relative path, the runner
picked by kind (Auto = by file extension:
.cl/.cls/.clsf play as CL, .csv as CSV,
anything else as brand NC — so existing scripts keep their behavior).
A play that follows a stop in this session starts in the program-end reset state, at the pose the machine stopped at (see RunNcLines(INcRunner, string, IEnumerable<string>, CancellationToken)).
[JsAce("PlayNcFile($1\"ncFile\");")]
public void PlayNcFile(string relNcFilePath, NcKind kind = NcKind.Auto)
Parameters
relNcFilePathstringRelative path to the NC program file
kindNcKindWhich runner plays the file; Auto detects by extension.
PlayToolingTeleport(int)
Plays a tooling teleport operation. Its mission-list form is ManualToolingCommand.
[JsAce]
public void PlayToolingTeleport(int toolId)
Parameters
toolIdintThe tool ID to teleport.
Remarks
Refused with Play–BusyAct or Play–BusyActAnotherThread under the conditions PlayAct(IAct, ISentenceCarrier, CancellationToken?) names, and throws from a
SessionStepBuilt handler as it does.
Exceptions
- ErrorTermRoleException
A role branch of the runtime machining chain is marked as an error term; an admitted act is not played (ProcAct(IAct, ISentenceCarrier, CancellationToken?); a refused one says
Play–BusyActorPlay–BusyActAnotherThreadand throws nothing).- InvalidOperationException
Called from a SessionStepBuilt handler, as for PlayAct(IAct, ISentenceCarrier, CancellationToken?).
PowerReset()
Performs a controller power reset: every IPowerResettable dependency in the active
NcDependencyList clears its volatile subset (e.g. Fanuc common volatile macro variables #100-#499); persistent
state is left intact. The strip keeps its steps: with steps on it, an OptimizeToFiles(string) after the reset is refused, so optimize before it.
[JsAce("PowerReset();")]
public void PowerReset()
Remarks
Refused, with PowerReset–Refused on ShellProgress and nothing reset, from inside a
run being played on this thread – an NC-embedded @@PowerReset();, or a script that enumerates
RunNcFile(string, NcKind) itself and calls this inside its loop (PowerReset()).
Preserve()
Preserve one line NC code in optimzation process.
[JsAce("Preserve()")]
public void Preserve()
ProgressMessage(string)
Displays a progress message in the message host.
[JsAce("ProgressMessage($1message)")]
public void ProgressMessage(string message)
Parameters
messagestringThe progress message to display
ReTrainMillingPara(SampleFlag, string, double)
Re-trains milling parameters using the specified sample flag. Waits for the
mappings issued so far first (MapTask); when the last of them was
stopped or failed, the re-training is skipped with one message
(DataMapping–Stopped / DataMapping–Failed) and nothing is written.
[JsAce("ReTrainMillingPara(Fx|Fy|Fz, $1dstFile)")]
public void ReTrainMillingPara(SampleFlag sampleFlag, string dstRelFile, double outlierRatio = 0.1)
Parameters
sampleFlagSampleFlagSample flag indicating which components to train
dstRelFilestringDestination relative file path
outlierRatiodoubleOutlier ratio for data filtering
ReadCsvByTimeInterpolation(string)
Reads a CSV file and performs time-based interpolation to map data to milling steps. It is one (step) - one (embedded-data) mapping.
[Obsolete]
public void ReadCsvByTimeInterpolation(string csvFile)
Parameters
csvFilestringPath to the CSV file relative to the base directory
ReadMeshedGeom(string)
Reads meshed geometry from a file. The file is read whatever its resolution (the owner, 2026-10-09): the licence's resolution cap limits the machining on the stock, not the file – a stock finer than the cap allows runs its cuts at its own width, which no cut refines.
[JsAce("ReadMeshedGeom($1\"srcFile\")")]
public void ReadMeshedGeom(string relFile)
Parameters
relFilestringRelative path to the input file
ReadRuntimeGeom(string)
Legacy script alias of ReadMeshedGeom(string); kept so old player scripts keep working.
[Obsolete("Legacy alias; use ReadMeshedGeom instead.")]
public void ReadRuntimeGeom(string relFile)
Parameters
relFilestring
ReadStepVariables(string, int, int)
Reads the values written under key on the steps of
[beginStepIndex, endStepIndex), one range read of the step cache: the steps a
value was written on, by step index (a double or a string each). For a script that
reads many steps; one step reads through its indexer (step[“key”]).
[JsAce(Snippet = "ReadStepVariables(\"$1key\",$2beginStepIndex,$3endStepIndex)")]
public IReadOnlyDictionary<int, object> ReadStepVariables(string key, int beginStepIndex, int endStepIndex)
Parameters
keystringThe step variable's key.
beginStepIndexintThe first step index (inclusive).
endStepIndexintThe step index the range ends before (exclusive).
Returns
- IReadOnlyDictionary<int, object>
The values by step index; empty for a key no value was written under.
RecomputeStepPhysics(int?)
Recomputes the step physics of the finished steps in place, from the
stored cutter-workpiece engagement and the inputs as they are now — no
replay, no reset. Use it after editing a cutting parameter, a cutter's
flute or shank material, a coating layer, a flute offset angle, the
tool's setup angle (e.g. after EstimateSetupAngle(SampleFlag, string, bool, double, string) with
applyToTool), the workpiece
material or the environment (ambient temperature, coolant, spindle
capability, initial spindle temperature, wear switch). The scope is detected automatically by comparing the current
inputs with the ones the steps were last computed with, by the play or by a recompute since: a cutting
parameter, flute geometry, flute offset angle or setup angle change reruns the force kernel
on the touched steps (this consumes milling-force licence steps and
rewrites the stored forces); a tool or workpiece material change
rebuilds the briefs from the stored forces without the kernel; an
environment change reruns only the sequential chain, from the first
step (this is where the spindle temperature and the accumulated spindle
energies take up an edited spindle capability). Changing
a material therefore does not move the force and moment charts — look at
the temperature, wear, yield ratio and friction power quantities in the
Color Index Time Chart instead.
Read the messages: StepPhysics-Recompute--NoChange means nothing
differs from what the steps were last computed with, by the play or by
a recompute since (with a tool id it is --NoChangeForTool: this
tool has no step to recompute and the environment and the workpiece
material are as recorded — the other tools' steps are not looked at);
--NeedsReplay means the change cannot be
applied in place (a shaper profile changed; a tool has no recorded
play-time inputs, has steps played before this session began (a
BeginSession() after EndSession() without
ResetRuntime() keeps the strip, and what the session records
as it plays speaks for its own steps alone), or is no longer the tool
object its steps were played with; the deflection transform is on and
the cutting parameter, a flute geometry or angle, or a cutter input the
results are rebuilt from — a
material, a coating, the observation height, the integral mode, an
insert, beam or shank-mass input — changed, or a tool id was given; or a
step to recompute has no stored engagement or forces, as one played
without physics) and the program must be
replayed after ResetRuntime(); --Refused names a
failed precondition (physics disabled, no steps, licence, no cutting
parameter). From a mission script this runs on the player thread: a
Pause holds it at a chunk boundary as it holds a play, and a Stop ends it
as canceled and the call returns -- the script goes on with its next
line, and the mission begins no row after it. A fault in the step store or
the message sink — or of the player's pace point under a mission —
propagates to the script after the recompute's exit: the steps it had
written keep the new values (StepPhysicsRecomputed
reports them, no message does), the inputs stay on record; run it again
to finish.
[JsAce("RecomputeStepPhysics()")]
public void RecomputeStepPhysics(int? toolId = null)
Parameters
toolIdint?Optional: restrict the force kernel and the brief rebuild to this tool's steps and rerun the force kernel on them whatever changed (an explicit request). The sequential chain is not restricted: it starts at the first step with that tool mounted and passes every step after it, whatever its tool — at least through that tool's last cutting step, then on until its values meet the stored ones — and it runs from the first step to the end when the environment or the workpiece material changed (both count as changed while the strip holds steps played before this session began). A tool id no step carries, in the tool house or not, has no step to recompute: it answers
–NoChangeForTool, or runs the sequential chain alone when the environment or the workpiece material changed — with the deflection transform on it answers–NeedsReplay, as every tool id given does. Null lets the change detection pick the scope.
RegisterStepColorTree(StepColorTree)
Registers a color tree for this session: a step property whose value is the id of the leaf
a step falls into, with a color per leaf (StepColorTree), which the charts,
the 3D view and the step CSV can pick until the session ends; a tree the project keeps goes
in StepColorTreeList instead. The tree is copied and compiled
here: a change to tree afterwards changes nothing until it is registered
again, and registering the key again in the session replaces its definition. A node without
an id is numbered from the tree's NextId — 1, 2, 3… in tree
order when none is given — the same numbers every time the script runs. The key must not be
a built-in step property's, under MC., or one the project defines a step variable or
a color tree under; a tree without a key, with a term without a key, a comparison without a
threshold, an id repeated or out of range, or an operation or a join this version does not
know (a value it writes but does not read back) is not registered; each is reported once
per session. The conditions read the step properties they name through the registry, a step
variable the script registers included; a key that matches none reads as no value and is
reported after the play.
[JsAce(Snippet = "RegisterStepColorTree($1tree)", DocContentHtml = "<p>Register a color tree for this session: a step property whose value is the id of the leaf a step falls into, colored one color per leaf.</p> <p>Build the tree with object initializers: new StepColorTree { Key = \"Load\", Nodes = [ new StepColorLeaf { Name = \"Rapid\", When = StepColorCondition.All(new StepColorTerm(\"IsRapid\", StepColorOp.Eq, 1)) }, new StepColorLeaf { Name = \"Cutting\", ValueKey = \"Mrr_mm3ds\" } ] }. A leaf without When takes every step that reaches it; a leaf without Hue_deg gets a hue of its own.</p>")]
public void RegisterStepColorTree(StepColorTree tree)
Parameters
treeStepColorTreeThe tree; null registers nothing.
RegisterStepVariable(string, string, string, string, Func<MachiningStep, object>)
Registers a step variable for tracking during execution: the charts, the 3D view and
the step CSV can pick it until the session ends. The value is computed when asked for
and never stored on the step — a value a script writes onto the step under the key
(step[“key”] = …) wins; any number reads as a double (a bool as 1 / 0), a
function that throws reads as no value on that step and is reported once. Registering
the key again in the session replaces its definition; a key named like a built-in step
property, or one the project defines a step variable or a color tree under
(StepVariableList, StepColorTreeList),
is not registered and is reported once.
[JsAce(Snippet = "RegisterStepVariable(\"$1key\",\"$2name\",\"$3unit\",\"$4formatString\",\"$5variableFunc\")", DocContentHtml = "<p>Register Step Variable.</p> <p>\"unit\" is nullable</p> <p>\"formatString\" is nullable</p>")]
public void RegisterStepVariable(string key, string name, string unit, string formatString, Func<MachiningStep, object> variableFunc = null)
Parameters
keystringUnique key to identify the variable
namestringHuman-readable name of the variable
unitstringPhysical unit of the variable (can be null); a name that is not a unit reads as none and is reported once
formatStringstringFormat string for displaying the variable (can be null)
variableFuncFunc<MachiningStep, object>Function to compute the variable value from a milling step (can be null)
RegisterWriteSyntaxPieces(string)
Registers a text writer so each executed SyntaxPiece is appended to
relOutputFile under the machining project base directory for debugging.
[JsAce(Snippet = "RegisterWriteSyntaxPieces($1\"Cache/syntax-pieces-output.txt\")")]
public void RegisterWriteSyntaxPieces(string relOutputFile)
Parameters
relOutputFilestringRelative path for the output log file.
RegisterWriteSyntaxPiecesWithActs(string)
Registers a writer that outputs each SyntaxPiece once, followed by its associated IAct entries (one-to-many).
[JsAce(Snippet = "RegisterWriteSyntaxPiecesWithActs($1\"Cache/syntax-pieces-acts-output.txt\")")]
public void RegisterWriteSyntaxPiecesWithActs(string relOutputFile)
Parameters
relOutputFilestringOutput file path relative to BaseDirectory.
RemoveFlyPiece()
Removes any disconnected or “flying” pieces from the workpiece geometry.
[JsAce]
public void RemoveFlyPiece()
Reset()
Reset Player: stops the run, waits for it, resets the runtime and ends the session
(ResetPlayer(IProgress<IMessage>)). Refused, with Reset–Refused on ShellProgress
and nothing reset, from the mission script itself – it runs on the player thread, and the reset would end the
session under the script's own run; reset the runtime between two programs with ResetRuntime() – and,
with Reset–Busy, while
an NC program is being played on this session on a thread of its own. Throws from a
SessionStepBuilt handler (the step pipeline's pump thread).
[JsAce(DocContentHtml = "Reset Player")]
public void Reset()
Exceptions
- InvalidOperationException
Called from a SessionStepBuilt handler, on the step pipeline's pump thread.
ResetRuntime()
Clears internal buffers.
[JsAce]
public bool ResetRuntime()
Returns
- bool
True when the runtime was reset; false when the call was refused and nothing was reset.
Remarks
Refused, with ResetRuntime–Refused on ShellProgress and nothing reset, from inside
a run being played on this thread – an NC-embedded script of the program (@@ResetRuntime();), or a script
that enumerates RunNcFile(string, NcKind) / RunNc(string, string) itself and calls this inside its loop: the reset
would empty the strip under the block in play and leave the rest of the program unplayed. Call it between two
programs (ResetRuntime(IProgress<IMessage>)). Refused the same way, with
ResetRuntime–Busy, when called off the player thread while the player is running or paused, or with
ResetRuntime–BusyAnotherThread while another thread plays NC on this session: the reset would clear the strip under the steps being built. A mission script's own
call between two programs, on the player thread, passes while no other thread plays. With no session open the
refusal is logged at Error instead.
RunBrandNcFile(string)
Runs a famous-brand NC code file with the specified relative path (no kind dispatch — always the brand runner). Not for end user with no programing skill.
[JsAce("RunBrandNcFile($1\"ncFile\");")]
public IEnumerable<Action> RunBrandNcFile(string relNcFilePath)
Parameters
relNcFilePathstringRelative path to the NC file
Returns
- IEnumerable<Action>
Enumerable sequence of actions to be executed
Remarks
Refused, with Play–Busy on ShellProgress and an empty sequence, while the player is
running or paused and this is not the player thread, or with Play–BusyAnotherThread while another thread plays this session, or with Play–BusyReset while the player is being reset (the reset ends the session)
(RunNcLines(INcRunner, string, IEnumerable<string>, CancellationToken)); decided at the first MoveNext, the thread
registered as playing for the enumeration – dispose it (foreach does).
RunNc(string, string)
Runs NC code directly from a string. Not for end user with no programing skill.
[JsAce(Snippet = "RunNc($1\"ncCommand\",$2\"\"(Direct Command)\"\");", DocContentHtml = "Run NC. second parameter is the file name alternative shows in the log.")]
public IEnumerable<Action> RunNc(string ncText, string fileNameAlternative = "--")
Parameters
Returns
- IEnumerable<Action>
Enumerable sequence of actions to be executed
Remarks
Refused, with Play–Busy on ShellProgress and an empty sequence, while the player is
running or paused and this is not the player thread, or with Play–BusyAnotherThread while another thread plays this session, or with Play–BusyReset while the player is being reset (the reset ends the session)
(RunNcLines(INcRunner, string, IEnumerable<string>, CancellationToken)); decided at the first MoveNext, the thread
registered as playing for the enumeration – dispose it (foreach does).
RunNcFile(string, NcKind)
Runs an NC program file with the specified relative path, the runner
picked by kind (Auto = by file extension:
.cl/.cls/.clsf run as CL, .csv as CSV,
anything else as brand NC — so existing scripts keep their behavior).
Not for end user with no programing skill.
[JsAce("RunNcFile($1\"ncFile\");")]
public IEnumerable<Action> RunNcFile(string relNcFilePath, NcKind kind = NcKind.Auto)
Parameters
relNcFilePathstringRelative path to the NC program file
kindNcKindWhich runner runs the file; Auto detects by extension.
Returns
- IEnumerable<Action>
Enumerable sequence of actions to be executed
Remarks
Refused, with Play–Busy on ShellProgress and an empty sequence, while the player is
running or paused and this is not the player thread, or with Play–BusyAnotherThread while another thread plays this session, or with Play–BusyReset while the player is being reset (the reset ends the session)
(RunNcLines(INcRunner, string, IEnumerable<string>, CancellationToken)); decided at the first MoveNext, the thread
registered as playing for the enumeration – dispose it (foreach does).
ScaledFeedPerCycle(double)
Gets a new feed per cycle machining motion resolution instance with the specified scale.
[JsAce("ScaledFeedPerCycle($1scale)")]
public FeedPerCycleMachiningMotionResolution ScaledFeedPerCycle(double scale)
Parameters
scaledoubleThe scale factor for the resolution.
Returns
- FeedPerCycleMachiningMotionResolution
A new FeedPerCycleMachiningMotionResolution instance with the specified scale.
ScanMeshedGeomInfDefect()
Scans the meshed geometry for defects. After scanning, the scanned defects will render in the workpiece.
[JsAce]
public bool? ScanMeshedGeomInfDefect()
Returns
- bool?
True if defects are found, false otherwise, or null if the operation cannot be performed.
ScanRuntimeGeomInfDefect()
Legacy script alias of ScanMeshedGeomInfDefect(); kept so old player scripts keep working.
[Obsolete("Legacy alias; use ScanMeshedGeomInfDefect instead.")]
public bool? ScanRuntimeGeomInfDefect()
Returns
- bool?
SetAllSnapshotSyntaxEnabled(bool)
Sets IsEnabled on every SnapshotSyntax reachable from the
active SoftNcRunner's NcSyntaxList (top-level slots
and inside BundleSyntax). No-op when SoftNcRunner
is not the active runner.
[JsAce(DocContentHtml = "Enable or disable every SnapshotSyntax in the active SoftNcRunner pipeline at once.")]
public void SetAllSnapshotSyntaxEnabled(bool isEnabled)
Parameters
isEnabledbool
SetNcResolutionFeedPerCycle()
Sets NC resolution to feed per cycle mode.
public void SetNcResolutionFeedPerCycle()
SetNcResolutionFeedPerTooth()
Sets NC resolution to feed per tooth mode.
public void SetNcResolutionFeedPerTooth()
SetNcResolutionFixed(double, double)
Sets NC resolution to fixed mode with specified resolution values.
public void SetNcResolutionFixed(double linearResolution_mm, double rotaryResolution_deg)
Parameters
linearResolution_mmdoubleLinear resolution in millimeters.
rotaryResolution_degdoubleRotary resolution in degrees.
SetStickMachiningToolObservationHeight_mm(int, double)
Sets the observation height in millimeters for the specified stick machining tool.
[JsAce("SetStickMachiningToolObservationHeight_mm($1toolId,$2height_mm)")]
public void SetStickMachiningToolObservationHeight_mm(int toolId, double height)
Parameters
SetToolSetupAngle_deg(int, double)
Sets the setup angle in degrees of the specified tool: how far the cutter is turned in the holder about the tool axis (SetupAngle_deg). The physics session snapshots the flute angles, so afterwards call RecomputeStepPhysics(int?) to update the finished steps in place, or ResetRuntime() before replaying. An optimization run after the play (OptimizeToFiles(string) on the SoftNc pipeline) computes its trial forces with the new angle by itself, as it rebuilds the session's physics packs at its start; the finished steps' stored physics, which it also reads, keep the played angle until the recompute or the replay.
[JsAce("SetToolSetupAngle_deg($1toolId,$2angle_deg)")]
public void SetToolSetupAngle_deg(int toolId, double angle_deg)
Parameters
SetUniformFlutingOffsetAngle_deg(int, double)
Sets the flute offset angle in degrees of the uniform fluting of the specified tool, that is, for a cutter whose flutes all share one baseline flute contour (BaselineFluteOffsetAngle_deg). To turn the cutter in the holder use SetToolSetupAngle_deg(int, double).
[JsAce("SetUniformFlutingOffsetAngle_deg($1toolId,$2angle_deg)")]
public void SetUniformFlutingOffsetAngle_deg(int toolId, double angle_deg)
Parameters
ShiftDistance_mm(double)
Creates a distance shift object representing the specified distance in millimeters.
public DistanceShift ShiftDistance_mm(double distanceShift_mm)
Parameters
distanceShift_mmdoubleDistance shift in millimeters
Returns
- DistanceShift
Distance shift object
ShiftTime_s(double)
Creates a time shift object representing the specified time in seconds.
public TimeShift ShiftTime_s(double seconds)
Parameters
secondsdoubleTime in seconds
Returns
- TimeShift
Time shift object
TrainMillingPara(SampleFlag, string, double, ICuttingPara)
Trains milling parameters using the specified sample flag. Waits for the
mappings issued so far first (MapTask); when the last of them was
stopped or failed, the training is skipped with one message
(DataMapping–Stopped / DataMapping–Failed) and nothing is written.
[JsAce("TrainMillingPara(Fx|Fy|Fz, $1dstFile)")]
public void TrainMillingPara(SampleFlag sampleFlag, string dstRelFile, double outlierRatio = 0.1, ICuttingPara paraTemplate = null)
Parameters
sampleFlagSampleFlagSample flag indicating which components to train
dstRelFilestringDestination relative file path
outlierRatiodoubleOutlier ratio for data filtering
paraTemplateICuttingParaOptional parameter template for cutting operations.
WarningMessage(string)
Displays a warning message in the message host.
[JsAce("WarningMessage($1message)")]
public void WarningMessage(string message)
Parameters
messagestringThe warning message to display
WriteMeshedGeom(string)
Writes the current meshed geometry to a file.
[JsAce("WriteMeshedGeom($1\"dstFile\")")]
public void WriteMeshedGeom(string relFile)
Parameters
relFilestringRelative path to the output file
WriteRuntimeGeom(string)
Legacy script alias of WriteMeshedGeom(string); kept so old player scripts keep working.
[Obsolete("Legacy alias; use WriteMeshedGeom instead.")]
public void WriteRuntimeGeom(string relFile)
Parameters
relFilestring
WriteShotFiles(double, string)
Writes time-series data to shot files with the specified resolution period (alternative parameter order).
public void WriteShotFiles(double resolutionPeroid_ms, string relFileTemplate)
Parameters
resolutionPeroid_msdoubleResolution period in milliseconds
relFileTemplatestringTemplate for output file path, can include [NcName] placeholder
WriteShotFiles(string, double)
Writes time-series (shot) data to files at the given sampling period.
[JsAce(Snippet = "WriteShotFiles(\"Output/[NcName].shot.csv\",resolutionPeroid_ms)", DocContentHtml = "Write time series data by resolutionPeroid_ms")]
public void WriteShotFiles(string relFileTemplate = "Output/[NcName].shot.csv", double resolutionPeroid_ms = 1)
Parameters
relFileTemplatestringTemplate for output file path, can include [NcName] placeholder
resolutionPeroid_msdoubleSampling period in milliseconds
Remarks
Each row is interpolated from the per-division force waveform, so the
information carried per spindle revolution is
min(MillingCycleDivisionNum, 60000 / (rpm * resolutionPeroid_ms)).
When the written file is fed back into
TrainMillingPara(SampleFlag, string, double, ICuttingPara),
this period — not MillingCycleDivisionNum and not the
machining resolution — sets the accuracy ceiling: sampling coarser than the
division period throws away waveform detail that a finer angular grid
cannot recover. Choose it at or below
60000 / (rpm * MillingCycleDivisionNum) ms, and when the result is
compared against a physical measurement, match the real DAQ rate so both
sides carry the same information density. Fine periods produce large
files (a 6-cut program: 13 MB at 1 ms, 128 MB at 0.1 ms).
WriteStepFiles(string)
Writes step-series data to files with the specified file template.
[JsAce(Snippet = "WriteStepFiles(\"Output/[NcName].step.csv\")", DocContentHtml = "Write step series data.")]
public void WriteStepFiles(string relFileTemplate = "Output/[NcName].step.csv")
Parameters
relFileTemplatestringTemplate for output file path, can include [NcName] placeholder
WriteStepVariables(IEnumerable<StepVariableWrite>)
Writes values onto steps in bulk, under step-variable keys: a sequence of
StepVariableWrite (the step index, the key, the value — a number, a
string, or null to take the key back), written to the step cache a segment at a time,
one transaction a segment. For a script that writes many steps after the play; a value
a step-built handler writes as the step is built goes through the step's indexer
(curStep[“key”] = …) and needs no call here. The charts and the 3D view of a
written key follow once the batch is written.
[JsAce(Snippet = "WriteStepVariables($1writes)", DocContentHtml = "<p>Write values onto steps in bulk: a sequence of StepVariableWrite(stepIndex, key, value).</p>")]
public void WriteStepVariables(IEnumerable<StepVariableWrite> writes)
Parameters
writesIEnumerable<StepVariableWrite>The writes.
Events
MachiningStepBuilt
Session-scoped event triggered when a machining step is built. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession(). For app-lifetime event, use MachiningStepBuilt instead.
[Obsolete("Use SessionStepBuilt instead.")]
public event MachiningActRunner.MachiningStepBuiltDelegate MachiningStepBuilt
Event Type
MachiningStepSelected
Session-scoped event triggered when a machining step is selected. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession().
[Obsolete("Use SessionStepSelected instead.")]
public event Action<MachiningStep> MachiningStepSelected
Event Type
SessionSourcedActEntry
Session-scoped event triggered for each SourcedActEntry produced during NC/CSV execution. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession().
[JsAce(Snippet = "SessionSourcedActEntry+=($1entry)=>{$2Command};", DocContentHtml = "Session-scoped event triggered for each SourcedActEntry. entry.SentenceSource is the source sentence; entry.Act is the associated act (may be null).")]
public event Action<SourcedActEntry> SessionSourcedActEntry
Event Type
SessionStepBuilt
Session-scoped event triggered when a machining step is built. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession(). For app-lifetime event, use MachiningStepBuilt instead.
[JsAce(Snippet = "SessionStepBuilt+=($1preStep,$2curStep)=>{$3Command};", DocContentHtml = "Session-scoped step built event. preStep is the Previous Milling Step; curStep is the Current Milling Step. preStep is null if no previous step existed.")]
public event MachiningActRunner.MachiningStepBuiltDelegate SessionStepBuilt
Event Type
SessionStepSelected
Session-scoped event triggered when a machining step is selected. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession().
[JsAce(Snippet = "SessionStepSelected+=($1millingStep)=>{$2Command};")]
public event Action<MachiningStep> SessionStepSelected
Event Type
SessionSyntaxPieceRan
Session-scoped event triggered when a syntax piece has been executed. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession().
[JsAce(Snippet = "SessionSyntaxPieceRan+=($1syntaxPiece)=>{$2Command};", DocContentHtml = "Session-scoped event triggered after each SyntaxPiece is executed. syntaxPiece may be null if the source command is not a SyntaxPiece.")]
public event Action<SyntaxPiece> SessionSyntaxPieceRan
Event Type
SyntaxPieceRan
Session-scoped event triggered when a syntax piece has been executed. Lifetime is bound to MachiningSession: created by BeginSession(), released by EndSession().
[Obsolete("Use SessionSyntaxPieceRan instead.")]
public event Action<SyntaxPiece> SyntaxPieceRan