SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages

Table of Contents

SDS/2 API Introduction

This document provides a high level overview of the SDS/2 API with references to example source code. It is assumed readers understand SDS/2 terminology and how to program in Python.


Language and Libraries


Applications (i.e. where SDS/2 is able to run Python)


History


Well Supported Use Cases


Mixed Support


No support (as of 2015.08)


API Pitfalls


Python API to Read the Job


Python API to Add to the Job


<a href="add_material_examples.py">Add Material</a>

Rectanglular Plate Example

7.3 rect_plate.RectPlate

(thickness, width, p1, p2, member_number, subm_to_global) = ...
m = rect_plate.RectPlate()
m.Thickness = thickness
m.Width = width
m.Point1 = point.Point(p1)  # must be specified and point.Point or tuple
m.Point2 = point.Point(p2)  # must be specified and point.Point or tuple
m.MaterialOriginPoint = 'NS'
m.WorkpointSlopeDistance = m.Point1.dist(m.Point2)
m.Member = member.Member(member_number)  # must be member.Member
if model.member(member_number).galvanizing:
    m.SurfaceFinish = fab.Fabricator().galv_surface_finish
m.MaterialColor3d = 'Medium_material'
m.Add()
m.SetTransform(subm_to_global)

2015 Designable.Proxies.RectPlate

(thickness, width, wkpt_slope, member_number, subm_to_global) = ...
notice, wkpt_slope instead of p1 and p2
uses reasonable SurfaceFinish automatically
uses reasonable MaterialColor3d automatically
RectPlate(
    Thickness=thickness,
    Width=width,
    MaterialOriginPoint='NS',
    WorkpointSlopeDistance=wkpt_slope,
    Member=member_number,
    _submaterial_to_global=subm_to_global
    ).Execute()

Add Hole Example

7.3 hole_add.Hole

mtrl, pt1 = ...
h = hole_add.Hole()
h.Material = [mtrl]
h.pt1 = point.Point(pt1)
h.face = 'FS Face'
h.Columns = 1
h.Rows = 1
h.Locate = 'Center'
h.BoltDiameter = 1.
h.BoltType = 'AUTO'
h.HoleType = 'Standard Round'
h.Diameter = h.CalculateHoleSize()
h.SlotLength = h.CalculateSlotLength()
h.Create()

2015 Designable.Proxies.Hole

mtrl, pt1 = ...
h = Hole(
    Material=[mtrl],  # works for generic materials
    pt1=pt1,  # works for generic points
    face='FS Face',
    Columns=1,
    Rows=1,
    Locate='Center',
    BoltDiameter=1.,
    BoltType='AUTO',
    HoleType='Standard Round'
    )
h.Diameter = h.CalculateHoleSize()
h.SlotLength = h.CalculateSlotLength()
h.Execute()

Add Weld Layout Example

7.3 weld_add.Weld

mtrl, p1, p2, depth_vector = ...
w = weld_add.Weld()
w.Material = [mtrl]
w.Type = 'Fillet'
w.Size = 3/16.
w.GrooveAngle = 45.
layout = Layout3D.Layout3D()
layout.add_node(Point3D.Point3D(p1), 0.)
layout.add_node(Point3D.Point3D(p2), 0.)
layout.set_depth_vectors(depth_vector, True)
w.layout = layout
w.create()

2015 Designable.Proxies.Weld/Layout3D

mtrl, p1, p2 = ...
notice no explicit depth vector
Weld(
    Material=[mtrl],
    Type='Fillet',
    Size=3/16.,
    GrooveAngle=45.,
    layout=Layout3D([(p1, 0.), (p2, 1.)])
    ).Execute()

SDS/2 Plugin Introduction

Plugins are python packages and modules placed in specific directories of the filesystem which extend and customize SDS/2's system behavior.


Installation (2015)


Custom behavior 101: Construction, Add, Edit, Copy


Custom behavior 102: Process and material creation


Sane defaults make life better in 2015