Skip to content

Latest commit

 

History

History
197 lines (126 loc) · 5.72 KB

engineering-data.md

File metadata and controls

197 lines (126 loc) · 5.72 KB

Engineering Data Tools

Read and edit the data drawings, BOMs and analyses are built from: every model dimension by name, measurements between faces, edges and vertices, materials, custom properties, and sheet-metal flat patterns.

Prerequisite: An active Part (or Assembly, for dimensions and measuring) document.

Total tools in this category: 8


list_model_dimensions

List every dimension in the active part or assembly with its full name and value.

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
feature_name str? — null Only list this feature's dimensions, e.g. 'Boss-Extrude1'. Omit to list every dimension in the model.

Sample call:

{}

measure_entities

Measure faces, edges or vertices of the active model with SolidWorks' Measure tool.

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
entities List[str] ✅ `` One or two entities to measure. Each is 'face:x,y,z' (a point inside the face), 'edge:x,y,z', 'vertex:x,y,z', a bare 'x,y,z' (nearest edge) or a topology name like 'Edge<1>'. Coordinates are in metres. One face gives area/perimeter; one edge gives length/radius; two entities give distance and angle.

Sample call:

{"entities": ["face:0,10,0", "face:0,0,0"]}

get_material

Report the active part's material with its strength and stiffness, or any library material's.

Each property comes from the material's entry in its SolidWorks library, in SI units: elastic_modulus, poissons_ratio, shear_modulus, tensile_strength, yield_strength, compressive_strength, density, thermal_expansion, thermal_conductivity and specific_heat, each with value, unit and label. Strengths and moduli are in Pa: divide by 1e6 for MPa. A property the library doesn't hold for that material (ABS has no yield strength) is left out. Give material to read a library material without assigning it, for example to compare two before set_material; that needs no open document.

Prerequisite: An active part, unless material is given

Parameters:

Parameter Type Required Default Description
configuration str? — None Configuration; the active one when omitted
material str? — None A library material to read without assigning it, e.g. '6061-T6 (SS)'; omit for the active part's material
database str? — None The library to look in first for material; all of them when omitted

Sample call:

{
  "material": "6061-T6 (SS)"
}

Returns (abridged):

{
  "message": "Material: 6061-T6 (SS), E = 69 GPa",
  "data": {
    "material": "6061-T6 (SS)",
    "source": "library",
    "properties": {
      "elastic_modulus": {"value": 69000000666.1, "unit": "Pa", "label": "Elastic modulus"},
      "yield_strength": {"value": 275000000.9, "unit": "Pa", "label": "Yield strength"}
    }
  }
}

set_material

Assign a library material to the active part, e.g. "AISI 1020" or "6061-T6 (SS)".

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
material_name str ✅ `` Exact library name, e.g. 'AISI 1020', '6061-T6 (SS)', 'ABS'. Use list_available_materials to find it.
database str? — None Library; 'SOLIDWORKS Materials' when omitted
configuration str? — None Configuration; all configurations when omitted

Sample call:

{
  "material_name": "MCP_Demo_Part"
}

list_available_materials

List the materials in the installed SolidWorks material libraries.

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
search str? — null Case-insensitive filter on material name or classification, e.g. 'steel' or '6061'

Sample call:

{}

get_custom_properties

Read the active document's custom properties, such as PartNo, Description or Revision.

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
configuration str? — null Configuration-specific properties; file-level (what title blocks usually read) when omitted

Sample call:

{}

set_custom_property

Create or overwrite one text custom property on the active document, e.g. PartNo or DrawnBy.

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
name str ✅ `` Property name, e.g. 'PartNo', 'Description', 'DrawnBy'
value str ✅ `` Text value; may be a $PRP:"SW-Mass" style link
configuration str? — None Configuration; file-level when omitted

Sample call:

{"name": "PartNo", "value": "BR-001"}

export_flat_pattern

Export the active sheet-metal part's flat pattern to DXF or DWG, for laser or waterjet cutting.

Prerequisite: SolidWorks running

Parameters:

Parameter Type Required Default Description
file_path str ✅ `` Output path ending in .dxf or .dwg

Sample call:

{"file_path": "C:\\Temp\\mcp_demo\\bracket.dxf"}