2025-09-24 09:26:04 +08:00

917 lines
30 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Class NcUtil | HiAPI-C# 2025 </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class NcUtil | HiAPI-C# 2025 ">
<meta name="description" content="Utility class for working with NC code.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="Hi.Numerical.NcUtil">
<h1 id="Hi_Numerical_NcUtil" data-uid="Hi.Numerical.NcUtil" class="text-break">
Class NcUtil
</h1>
<div class="facts text-secondary">
<dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.Numerical.html">Numerical</a></dd></dl>
<dl><dt>Assembly</dt><dd>HiUniNc.dll</dd></dl>
</div>
<div class="markdown summary"><p>Utility class for working with NC code.</p>
</div>
<div class="markdown conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class NcUtil</code></pre>
</div>
<dl class="typelist inheritance">
<dt>Inheritance</dt>
<dd>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
<div><span class="xref">NcUtil</span></div>
</dd>
</dl>
<dl class="typelist inheritedMembers">
<dt>Inherited Members</dt>
<dd>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
</div>
<div>
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
</div>
</dd></dl>
<h2 class="section" id="fields">Fields
</h2>
<h3 id="Hi_Numerical_NcUtil_NcNameTemplateReplacingKeyword" data-uid="Hi.Numerical.NcUtil.NcNameTemplateReplacingKeyword">
NcNameTemplateReplacingKeyword
</h3>
<div class="markdown level1 summary"><p>Keyword for replacing NC name in templates.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string NcNameTemplateReplacingKeyword = &quot;[NcName]&quot;</code></pre>
</div>
<h4 class="section">Field Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h3 id="Hi_Numerical_NcUtil_RelNcFileTemplateReplacingKeyword" data-uid="Hi.Numerical.NcUtil.RelNcFileTemplateReplacingKeyword">
RelNcFileTemplateReplacingKeyword
</h3>
<div class="markdown level1 summary"><p>Keyword for replacing NC file path in templates.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public const string RelNcFileTemplateReplacingKeyword = &quot;[NcFile]&quot;</code></pre>
</div>
<h4 class="section">Field Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="properties">Properties
</h2>
<a id="Hi_Numerical_NcUtil_LineBeginCsScriptRegex_" data-uid="Hi.Numerical.NcUtil.LineBeginCsScriptRegex*"></a>
<h3 id="Hi_Numerical_NcUtil_LineBeginCsScriptRegex" data-uid="Hi.Numerical.NcUtil.LineBeginCsScriptRegex">
LineBeginCsScriptRegex
</h3>
<div class="markdown level1 summary"><p>Gets the regular expression for matching line-beginning C# script markers.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Regex LineBeginCsScriptRegex { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.regularexpressions.regex">Regex</a></dt>
<dd></dd>
</dl>
<a id="Hi_Numerical_NcUtil_LineEndCsScriptRegex_" data-uid="Hi.Numerical.NcUtil.LineEndCsScriptRegex*"></a>
<h3 id="Hi_Numerical_NcUtil_LineEndCsScriptRegex" data-uid="Hi.Numerical.NcUtil.LineEndCsScriptRegex">
LineEndCsScriptRegex
</h3>
<div class="markdown level1 summary"><p>Gets the regular expression for matching line-ending C# script markers.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Regex LineEndCsScriptRegex { get; }</code></pre>
</div>
<h4 class="section">Property Value</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.text.regularexpressions.regex">Regex</a></dt>
<dd></dd>
</dl>
<h2 class="section" id="methods">Methods
</h2>
<a id="Hi_Numerical_NcUtil_ApproachFloor_" data-uid="Hi.Numerical.NcUtil.ApproachFloor*"></a>
<h3 id="Hi_Numerical_NcUtil_ApproachFloor__1_Hi_Common_FileLines_IFileLineIndex_System_Collections_Generic_List___0__System_Collections_Generic_IEnumerator___0__" data-uid="Hi.Numerical.NcUtil.ApproachFloor``1(Hi.Common.FileLines.IFileLineIndex,System.Collections.Generic.List{``0},System.Collections.Generic.IEnumerator{``0})">
ApproachFloor&lt;T&gt;(IFileLineIndex, List&lt;T&gt;, IEnumerator&lt;T&gt;)
</h3>
<div class="markdown level1 summary"><p>Get the value which is at the floor index (<code class="paramref">fileLineIndex</code>) from <code class="paramref">src</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static T ApproachFloor&lt;T&gt;(IFileLineIndex fileLineIndex, List&lt;T&gt; buffer, IEnumerator&lt;T&gt; src) where T : IFileLineIndex</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>fileLineIndex</code> <a class="xref" href="Hi.Common.FileLines.IFileLineIndex.html">IFileLineIndex</a></dt>
<dd><p>file line index</p>
</dd>
<dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1">List</a>&lt;T&gt;</dt>
<dd><p>buffer. Only required capacity of 2.</p>
</dd>
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1">IEnumerator</a>&lt;T&gt;</dt>
<dd><p>src</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><span class="xref">T</span></dt>
<dd><p>value at the floor index</p>
</dd>
</dl>
<h4 class="section">Type Parameters</h4>
<dl class="parameters">
<dt><code>T</code></dt>
<dd><p>value type</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_GetSimCsScript_" data-uid="Hi.Numerical.NcUtil.GetSimCsScript*"></a>
<h3 id="Hi_Numerical_NcUtil_GetSimCsScript_System_String_Hi_Numerical_CncBrand_System_String__System_String__" data-uid="Hi.Numerical.NcUtil.GetSimCsScript(System.String,Hi.Numerical.CncBrand,System.String@,System.String@)">
GetSimCsScript(string, CncBrand, out string, out string)
</h3>
<div class="markdown level1 summary"><p>Extracts C# scripts from the specified NC line text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void GetSimCsScript(string ncLineText, CncBrand cncBrand, out string lineBeginCsScript, out string lineEndCsScript)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncLineText</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text to process.</p>
</dd>
<dt><code>cncBrand</code> <a class="xref" href="Hi.Numerical.CncBrand.html">CncBrand</a></dt>
<dd><p>The CNC brand to determine the comment style.</p>
</dd>
<dt><code>lineBeginCsScript</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>When this method returns, contains the line-beginning C# script if found; otherwise, null.</p>
</dd>
<dt><code>lineEndCsScript</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>When this method returns, contains the line-ending C# script if found; otherwise, null.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_GrabComment_" data-uid="Hi.Numerical.NcUtil.GrabComment*"></a>
<h3 id="Hi_Numerical_NcUtil_GrabComment_System_String_Hi_Numerical_CncBrand_Hi_Numerical_NcComment__" data-uid="Hi.Numerical.NcUtil.GrabComment(System.String,Hi.Numerical.CncBrand,Hi.Numerical.NcComment@)">
GrabComment(string, CncBrand, out NcComment)
</h3>
<div class="markdown level1 summary"><p>Extracts and removes a comment from the given NC line text based on the CNC brand.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GrabComment(string srcNcLineText, CncBrand brand, out NcComment ncComment)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>srcNcLineText</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text to process.</p>
</dd>
<dt><code>brand</code> <a class="xref" href="Hi.Numerical.CncBrand.html">CncBrand</a></dt>
<dd><p>The CNC brand to determine the comment style.</p>
</dd>
<dt><code>ncComment</code> <a class="xref" href="Hi.Numerical.NcComment.html">NcComment</a></dt>
<dd><p>When this method returns, contains the extracted comment, or null if no comment was found.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text with the comment removed if found; otherwise, the original text.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_GrabDoubleABC_" data-uid="Hi.Numerical.NcUtil.GrabDoubleABC*"></a>
<h3 id="Hi_Numerical_NcUtil_GrabDoubleABC_System_String__System_Boolean_" data-uid="Hi.Numerical.NcUtil.GrabDoubleABC(System.String@,System.Boolean)">
GrabDoubleABC(ref string, bool)
</h3>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Vec3d GrabDoubleABC(ref string text, bool enableIntegerShrink)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>text</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>enableIntegerShrink</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd></dd>
</dl>
<a id="Hi_Numerical_NcUtil_GrabDoubleXYZ_" data-uid="Hi.Numerical.NcUtil.GrabDoubleXYZ*"></a>
<h3 id="Hi_Numerical_NcUtil_GrabDoubleXYZ_System_String__System_Boolean_" data-uid="Hi.Numerical.NcUtil.GrabDoubleXYZ(System.String@,System.Boolean)">
GrabDoubleXYZ(ref string, bool)
</h3>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Vec3d GrabDoubleXYZ(ref string text, bool enableIntegerShrink)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>text</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>enableIntegerShrink</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
<dd></dd>
</dl>
<a id="Hi_Numerical_NcUtil_GrabFlag_" data-uid="Hi.Numerical.NcUtil.GrabFlag*"></a>
<h3 id="Hi_Numerical_NcUtil_GrabFlag_System_String__System_String_" data-uid="Hi.Numerical.NcUtil.GrabFlag(System.String@,System.String)">
GrabFlag(ref string, string)
</h3>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool GrabFlag(ref string text, string tag)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>text</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd></dd>
</dl>
<a id="Hi_Numerical_NcUtil_GrabHeadPercentComment_" data-uid="Hi.Numerical.NcUtil.GrabHeadPercentComment*"></a>
<h3 id="Hi_Numerical_NcUtil_GrabHeadPercentComment_System_String_Hi_Numerical_NcComment__" data-uid="Hi.Numerical.NcUtil.GrabHeadPercentComment(System.String,Hi.Numerical.NcComment@)">
GrabHeadPercentComment(string, out NcComment)
</h3>
<div class="markdown level1 summary"><p>Extracts and removes a head percent comment from the given NC line text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string GrabHeadPercentComment(string ncLineText, out NcComment ncComment)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncLineText</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text to process.</p>
</dd>
<dt><code>ncComment</code> <a class="xref" href="Hi.Numerical.NcComment.html">NcComment</a></dt>
<dd><p>When this method returns, contains the extracted comment, or null if no comment was found.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text with the comment removed if found; otherwise, the original text.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_IsFlagChanging_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging*"></a>
<h3 id="Hi_Numerical_NcUtil_IsFlagChanging_Hi_Numerical_NcLine_Hi_Numerical_NcLine_Hi_Numerical_NcFlag_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging(Hi.Numerical.NcLine,Hi.Numerical.NcLine,Hi.Numerical.NcFlag)">
IsFlagChanging(NcLine, NcLine, NcFlag)
</h3>
<div class="markdown level1 summary"><p>Determines if a flag is changing between two NcLines</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsFlagChanging(this NcLine curNcLine, NcLine preNcLine, NcFlag ncFlag)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>curNcLine</code> <a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a></dt>
<dd><p>The current NcLine</p>
</dd>
<dt><code>preNcLine</code> <a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a></dt>
<dd><p>The previous NcLine</p>
</dd>
<dt><code>ncFlag</code> <a class="xref" href="Hi.Numerical.NcFlag.html">NcFlag</a></dt>
<dd><p>The flag to check</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the flag is changing, false otherwise</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_IsFlagChanging_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging*"></a>
<h3 id="Hi_Numerical_NcUtil_IsFlagChanging_Hi_Numerical_NcLine_Hi_Numerical_NcLine_Hi_Numerical_NcFlag_System_Boolean_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging(Hi.Numerical.NcLine,Hi.Numerical.NcLine,Hi.Numerical.NcFlag,System.Boolean)">
IsFlagChanging(NcLine, NcLine, NcFlag, bool)
</h3>
<div class="markdown level1 summary"><p>Checks if the flag is changing with a specific direction (on or off) between two NC lines.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsFlagChanging(this NcLine curNcLine, NcLine preNcLine, NcFlag ncFlag, bool changingOn)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>curNcLine</code> <a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a></dt>
<dd><p>The current NC line.</p>
</dd>
<dt><code>preNcLine</code> <a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a></dt>
<dd><p>The previous NC line.</p>
</dd>
<dt><code>ncFlag</code> <a class="xref" href="Hi.Numerical.NcFlag.html">NcFlag</a></dt>
<dd><p>The flag to check.</p>
</dd>
<dt><code>changingOn</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if flag set to on; otherwise, the flag set to off</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the flag is changing in the specified direction; otherwise, false.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_IsFlagChanging_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging*"></a>
<h3 id="Hi_Numerical_NcUtil_IsFlagChanging_System_Collections_Generic_LinkedListNode_Hi_Numerical_NcLine__Hi_Numerical_NcFlag_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging(System.Collections.Generic.LinkedListNode{Hi.Numerical.NcLine},Hi.Numerical.NcFlag)">
IsFlagChanging(LinkedListNode&lt;NcLine&gt;, NcFlag)
</h3>
<div class="markdown level1 summary"><p>Determines if a flag is changing in the current NcLine node compared to the previous node</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsFlagChanging(this LinkedListNode&lt;NcLine&gt; curNcLineNode, NcFlag ncFlag)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>curNcLineNode</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.linkedlistnode-1">LinkedListNode</a>&lt;<a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a>&gt;</dt>
<dd><p>The current NcLine node</p>
</dd>
<dt><code>ncFlag</code> <a class="xref" href="Hi.Numerical.NcFlag.html">NcFlag</a></dt>
<dd><p>The flag to check</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the flag is changing, false otherwise</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_IsFlagChanging_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging*"></a>
<h3 id="Hi_Numerical_NcUtil_IsFlagChanging_System_Collections_Generic_LinkedListNode_Hi_Numerical_NcLine__Hi_Numerical_NcFlag_System_Boolean_" data-uid="Hi.Numerical.NcUtil.IsFlagChanging(System.Collections.Generic.LinkedListNode{Hi.Numerical.NcLine},Hi.Numerical.NcFlag,System.Boolean)">
IsFlagChanging(LinkedListNode&lt;NcLine&gt;, NcFlag, bool)
</h3>
<div class="markdown level1 summary"><p>Checks if the flag is changing with a specific direction (on or off).</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsFlagChanging(this LinkedListNode&lt;NcLine&gt; curNcLineNode, NcFlag ncFlag, bool changingOn)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>curNcLineNode</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.linkedlistnode-1">LinkedListNode</a>&lt;<a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a>&gt;</dt>
<dd><p>The current NC line node.</p>
</dd>
<dt><code>ncFlag</code> <a class="xref" href="Hi.Numerical.NcFlag.html">NcFlag</a></dt>
<dd><p>The flag to check.</p>
</dd>
<dt><code>changingOn</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if flag set to on; otherwise, the flag set to off</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the flag is changing in the specified direction; otherwise, false.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_IsFlagKeeping_" data-uid="Hi.Numerical.NcUtil.IsFlagKeeping*"></a>
<h3 id="Hi_Numerical_NcUtil_IsFlagKeeping_Hi_Numerical_NcLine_Hi_Numerical_NcLine_Hi_Numerical_NcFlag_System_Boolean_" data-uid="Hi.Numerical.NcUtil.IsFlagKeeping(Hi.Numerical.NcLine,Hi.Numerical.NcLine,Hi.Numerical.NcFlag,System.Boolean)">
IsFlagKeeping(NcLine, NcLine, NcFlag, bool)
</h3>
<div class="markdown level1 summary"><p>Checks if the flag is keeping the same state between two NC lines.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool IsFlagKeeping(this NcLine curNcLine, NcLine preNcLine, NcFlag ncFlag, bool keepingOn)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>curNcLine</code> <a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a></dt>
<dd><p>The current NC line.</p>
</dd>
<dt><code>preNcLine</code> <a class="xref" href="Hi.Numerical.NcLine.html">NcLine</a></dt>
<dd><p>The previous NC line.</p>
</dd>
<dt><code>ncFlag</code> <a class="xref" href="Hi.Numerical.NcFlag.html">NcFlag</a></dt>
<dd><p>The flag to check.</p>
</dd>
<dt><code>keepingOn</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>true if checking for kept on state; otherwise, checking for kept off state</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
<dd><p>True if the flag is keeping the specified state; otherwise, false.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_RemoveAllCsScript_" data-uid="Hi.Numerical.NcUtil.RemoveAllCsScript*"></a>
<h3 id="Hi_Numerical_NcUtil_RemoveAllCsScript_System_String_Hi_Numerical_CncBrand_" data-uid="Hi.Numerical.NcUtil.RemoveAllCsScript(System.String,Hi.Numerical.CncBrand)">
RemoveAllCsScript(string, CncBrand)
</h3>
<div class="markdown level1 summary"><p>Removes all C# script markers and their contents from the specified NC line text.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static string RemoveAllCsScript(string ncLineText, CncBrand cncBrand)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncLineText</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text to process.</p>
</dd>
<dt><code>cncBrand</code> <a class="xref" href="Hi.Numerical.CncBrand.html">CncBrand</a></dt>
<dd><p>The CNC brand to determine the comment style.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The NC line text with all C# scripts removed.</p>
</dd>
</dl>
<a id="Hi_Numerical_NcUtil_SetTagNumber_" data-uid="Hi.Numerical.NcUtil.SetTagNumber*"></a>
<h3 id="Hi_Numerical_NcUtil_SetTagNumber_System_String__System_String_System_Double_System_String_" data-uid="Hi.Numerical.NcUtil.SetTagNumber(System.String@,System.String,System.Double,System.String)">
SetTagNumber(ref string, string, double, string)
</h3>
<div class="markdown level1 summary"><p>SetTagNumberWithoutDecimalTailZero.</p>
</div>
<div class="markdown level1 conceptual"></div>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static void SetTagNumber(ref string ncLineTextWithoutComment, string tag, double tagNumber, string tagNumberFormat)</code></pre>
</div>
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>ncLineTextWithoutComment</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
<dt><code>tagNumber</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
<dd></dd>
<dt><code>tagNumberFormat</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd></dd>
</dl>
</article>
<div class="contribution d-print-none">
</div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
</div>
</div>
</footer>
</body>
</html>