Skip to content

ixmilia/step

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6161a2c · Aug 30, 2024

History

87 Commits
Aug 30, 2024
Aug 30, 2024
Aug 30, 2024
Dec 11, 2018
Nov 8, 2019
Sep 13, 2018
Apr 17, 2020
Apr 17, 2020
Oct 15, 2019
Apr 17, 2020
Apr 17, 2020
Aug 30, 2024
Dec 11, 2018

Repository files navigation

IxMilia.Step

A portable .NET library for reading and writing STEP CAD files.

Usage

Open a STEP file:

using System.IO;
using IxMilia.Step;
using IxMilia.Step.Items;
// ...

//------------------------------------------------------------ read from a file
StepFile stepFile;
using (FileStream fs = new FileStream(@"C:\Path\To\File.stp", FileMode.Open))
{
    stepFile = StepFile.Load(fs);
}

// if on >= NETStandard1.3 you can use:
// StepFile stepFile = StepFile.Load(@"C:\Path\To\File.stp");

//---------------------------------------------- or read directly from a string
StepFile stepFile = StepFile.Parse(@"ISO-10303-21;
HEADER;
...
END-ISO-103030-21;");
//-----------------------------------------------------------------------------

foreach (StepRepresentationItem item in stepFile.Items)
{
    switch (item.ItemType)
    {
        case StepItemType.Line:
            StepLine line = (StepLine)item;
            // ...
            break;
        // ...
    }
}

Save a STEP file:

using System.IO;
using IxMilia.Step;
using IxMilia.Step.Items;
// ...

StepFile stepFile = new StepFile();
stepFile.Items.Add(new StepDirection("direction-label", 1.0, 0.0, 0.0));
// ...

//------------------------------------------------------------- write to a file
using (FileStream fs = new FileStream(@"C:\Path\To\File.stp", FileMode.Create))
{
    stepFile.Save(fs);
}

// if on >= NETStandard1.3 you can use
// stepFile.Save(@"C:\Path\To\File.stp");

//------------------------------------------------------- or output as a string
string contents = stepFile.GetContentsAsString();

Building locally

To build locally, install the latest .NET Core 3.0 SDK.

Specification

Using spec from steptools.com here.

STEP Application Protocols here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages