forked fromixmilia/step
- Notifications
You must be signed in to change notification settings - Fork0
License
NotificationsYou must be signed in to change notification settings
alexatstariongroup/step
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A portable .NET library for reading and writing STEP CAD files.
Open a STEP file:
usingSystem.IO;usingIxMilia.Step;usingIxMilia.Step.Items;// ...//------------------------------------------------------------ read from a fileStepFilestepFile;using(FileStreamfs=newFileStream(@"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 stringStepFilestepFile=StepFile.Parse(@"ISO-10303-21;HEADER;...END-ISO-103030-21;");//-----------------------------------------------------------------------------foreach(StepRepresentationItemiteminstepFile.Items){switch(item.ItemType){caseStepItemType.Line:StepLineline=(StepLine)item;// ...break;// ...}}
Save a STEP file:
usingSystem.IO;usingIxMilia.Step;usingIxMilia.Step.Items;// ...StepFilestepFile=newStepFile();stepFile.Items.Add(newStepDirection("direction-label",1.0,0.0,0.0));// ...//------------------------------------------------------------- write to a fileusing(FileStreamfs=newFileStream(@"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 stringstringcontents=stepFile.GetContentsAsString();
Requirements to build locally are:
- Latest .NET Core SDK As of this writing the following was also required on Ubuntu 14.04:
sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.3
Using spec from steptools.comhere.
STEP Application Protocolshere.