Skip to content

steptools/OpenCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

==
== STEP-NC Machine CLI Plugin
==

This project builds a simple plugin for STEP-NC Machine that exports
some selected PBF process as a CLI file.  The plugin is a small DLL 
that the STEP-NC Explorer loads from a "plugins-x64" directory where
the executable is located.

When you build and run the project, it makes a local copy of the 
Explorer in your build directory and runs the plugin there.  When 
distributing a finished plugin, install it under Program Files in the
"STEP Tools\STEP-NC Machine\plugins-x64" folder.

The project has two classes: "CLI Writer" which does all of the work,
and "PlugOpenCLIExport" which is a small class that defines an entry 
in the STEP-NC Explorer menus.  The DLL can define more such classes 
to add other menu entries.


= How It Works

The CLI Writer makes two passes over the process.  The CLI format
needs the total number of layers at the start of the file, so the
ScanLayers() function examines the Z-coordinates of moves and groups 
the workingsteps into layers.   It also looks at the dimensions of 
the product to find the offset needed to set the bottom at zero.

The WriteHeader() function prints the number of layers, current date, 
unit scaling, and any other startup information you would like.

The WriteBody() function makes a second pass over the process and 
prints the hatches.   We use the Adaptive process cursor class to 
loop over the process, and we request that it stops at each move, 
workplan start, workingstep start/end, and tool change event.

At each move, we examine the feedrate ($$SPEED) and spindle ($$POWER),
and if either has changed we print the moves we've seen so far as a 
$$HATCH and then change those settings.  Otherwise we keep building 
a list of moves.   Tool changes may change the diameter ($$FOCUS)

At a workingstep start, we consult the information we built with 
ScanLayers() issue a $$LAYER if it is on a new layer.  At the end 
we issue any remaining $$HATCH moves for that layer.


= Make Your Machine Happy

If you would like to enhance this output, you could change the print
strings to other formats required by you machine, or perhaps delay 
hatch printing so it spans workingsteps if speed/power does not change, 
or perhaps include other contextual information from the workingsteps.

You have access to the Finder (Data.oFind), Apt (Data.oApt), Tolerance 
(Data.oTol), and other STEP-NC DLL objects that are used by the STEP-NC
Explorer, so you can work in an interactive session rather than just a
standalone program.

    https://www.steptools.com/docs/stepnc_api/


= Other Notes

In order to run a local version of STEP-NC Explorer that loads the
plugin, the C# project needs Debug | Start action | Start external
program set to one of the following:

    bin\x64\Debug\STEPNCExplorer.exe	debug config
    bin\x64\Release\STEPNCExplorer.exe	release config

Unfortunately, Visual Studio will only save those settings in the
csproj.user preferences file, not the main project file.   We have
provided a simple .user file with these settings.

About

A CLI export plugin for STEP-NC Machine that others can adapt to their needs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages