Skip to main content

Module cadformat

Module cadformat 

Source
Expand description

File formats of the common CAD programs.

TeamCraft stores files of any type. On top of that it knows the native formats of the common CAD, BIM and 3D programs – SolidWorks, Siemens NX / Solid Edge, Autodesk Inventor / Fusion / AutoCAD / Revit, PTC Creo, CATIA V5, Rhino, Blender, Maya, … – the neutral exchange formats (STEP, IGES, Parasolid, JT, ACIS, IFC, STL, glTF, …) and point clouds (E57, LAS):

  • every file is classified when it is uploaded; the id is stored in files.format ('' = unknown) and the file list shows what the file is,
  • downloads carry the registered content type where one exists,
  • the item search filters by CAD program and finds “SolidWorks”, “NX”, …,
  • Creo iteration suffixes are dropped (bracket.prt.7 → bracket.prt), so every save in Creo becomes a new version of the same file,
  • extensions used by two programs are told apart by the file content: .prt is Creo (text header #UGC:) or NX, .asm Creo or Solid Edge (OLE compound document), .sch KiCad 5 (EESchema) or Eagle, .sc a SolidCraft design (ZIP container or JSON) or a script, .pdf with an embedded U3D/PRC model is a 3D PDF.
  • simulation models and results (FEA/CFD) are recognised the same way. .sim, .fem and .afm are NX when they start with the SPLMSSTR container; a .sim that names STAR-CCM+ near its start is STAR-CCM+, any other .sim stays NX; a text .fem is an OptiStruct deck. Generic extensions only count with matching content: .dat only with Fluent’s (0 …) sections or Nastran bulk-data markers, .msh with Fluent sections or Gmsh’s $MeshFormat, .java only naming STAR-CCM+, .out only as a Fluent report file, .cas.h5/.dat.h5/.msh.h5 only with the HDF5 signature and .cas.gz/… with the gzip magic, .e only as netCDF/HDF5 (Exodus II), .db not for SQLite/OLE/text files, .rst not for text (reStructuredText), .msg and .sta only as text (not Outlook mails), .odb not as ZIP (OpenDocument database), .bdf not for bitmap fonts. OpenFOAM cases are recognised by controlDict (or a .foam marker), LS-DYNA results by d3plot, d3plot01, …

Native formats are proprietary; TeamCraft identifies and versions them, scans the ones with readable references (see cadrefs) and previews the open formats in 3D (see preview). Onshape keeps its documents in the cloud – store their STEP/Parasolid exports.

Extensions are matched case-insensitively (.CATPart, .SLDPRT).

Structs§

CadFormat
A file format.
CadSystem
A CAD program (or a group of neutral formats).
FamilyGrouping
How a file list is shown for a preferred CAD program.
FormatInfo
What the UI and the API show about a stored format id.

Enums§

FormatKind
What a file of the format contains.

Constants§

AMBIGUOUS
Extensions shared by two formats; detect (and for 3D PDFs detect_stored) decides by content.
FORMATS
Every known format. Extensions are unique except the ones in AMBIGUOUS, which detect resolves from the file content.
HEAD_LEN
Bytes of the file content detect looks at.
SYSTEMS
The CAD programs, in the order of the help page and the search filter.

Functions§

by_id
catalogue
Systems with their formats, for the help page and GET /api/v1/formats.
content_type
Content type to store for an upload: the registered type of the format, otherwise the (cleaned) type the client sent.
creo_iteration
bracket.prt.12 → ("bracket.prt", 12): the Creo iteration suffix.
detect
Classifies a file by its name and the first HEAD_LEN bytes of its content (pass &[] if the content is not at hand).
detect_stored
Classifies a stored file: reads the first HEAD_LEN bytes of path (a missing or unreadable file is classified by its name only).
extension
Lower-case extension of a (normalised) file name; None for names without one or hidden files such as .stl.
families
The families a user can prefer, in the order of SYSTEMS: every program that owns at least one native format.
family
The native format family of a stored format id: the CadSystem of the authoring program (nx for NX parts, assemblies, drawings and simulation files, solidworks, inventor, …). None for neutral and exchange formats (STEP, JT, STL, PDF, images, …) and unknown ids – those are never collapsed by a preferred CAD program.
group_by_family
Splits the files of a revision (their stored format ids) for a preferred family ("" or an unknown id = show all). Only when at least one file belongs to the preferred family are the native files of other families collapsed; neutral files and files of the preferred family stay visible. Without a file of the preferred family nothing is collapsed. Display only: nothing is removed from the data.
ids_named_by
Format ids a free-text search names exactly: a CAD program (“SolidWorks”, “NX”, “Pro/E”), a format (“CATIA product”, “Parasolid”) or a format id (“jt”, “step”). Case, spaces and punctuation do not matter.
ids_of_system
Format ids of a CAD program, for the search filter.
info
Info for a stored format id ('' or unknown ids give None).
is_family
Whether id names a family a user can prefer.
normalize_name
The name a file is stored under: Creo iteration suffixes are dropped.
system