The sds2 package (contains various modules)

SDS2 Python Prompt

>>> import sds2                                    # import the package
>>>
>>> help(sds2)                                      # get help on the package
Help on package sds2:

NAME
sds2

FILE
c:\progra~2\sds2_2~3\2015.17\bin\sds2.zip\sds2\__init__.py

PACKAGE CONTENTS
breakapart                  #new
color
iterators
lists
lockable                       #new
obj
piecemark                   #new
status_display             #new
sub_mtrl
utility (package)           #new

sds2.breakapart

PR 34546 In parametrics, added the ability to break apart arbitrary materials. See help(sds2.breakapart) for more details. (v2016)

PR 46318 During process, plugins can add views to the misc. members that they create via the BreakApartMaterials API. (v2018)

SDS2 Python Prompt

>>> import sds2.breakapart               # import the module
>>>
>>> help(sds2.breakapart)                  # get help on the module
Help on module sds2.breakapart in sds2:

NAME
sds2.breakapart

FILE
c:\progra~1\sds2_2~4\2016.12\bin\sds2.zip\sds2\breakapart.py

FUNCTIONS
BreakApartMaterials(...)
object BreakApartMaterials(*args) :

Create one or more broken apart members from the specified material list
arguments.

Each argument to the function is a list of materials. There is *no*
requirement that each material list be hosted by a single member.
As such, each argument can generate more than one new broken apart
member. There will be one for each unique host in the material list.
Thus, the function returns a list for each material list argument
despite the likelihood of each material list being hosted on one member.

Breaking one member into multiple new members is possible by passing
multiple material list arguments to the function.

The function will throw an exception if it cannot complete the
transaction for any reason. Upon successful return, any remaining
references to materials on members that were broken apart, including the
material arguments, are invalid.

Example: Break two materials off member 1 and one material off member 2
a, b = model.member(1).materials[1:3]
c = model.member(2).materials[1]
((broken1, broken2), (broken3,)) = BreakApartMaterials((a, c), (b,))

DATA
__loader__ = <zipimporter object "C:\PROGRA~1\SDS2_2~4\2016.12\bin\sds...

sds2.iterators

PR 32664 In parametrics, the model module is the recommended way to query the model. The new sds2.obj and sds2.iterators modules provide a cleaner way to use the model module using shorter syntax, generic functions, and iterators.

See help (sds2), help(sds2.obj), and help(sds2.iterators) for more information. (v2015)

PR 45463 sds2.iterators and sds2.lists introduce functions for finding members and materials based on the Intersect3D module. (v2018)

SDS2 Python Prompt

>>> import sds2.iterators                     # import the iterators module
>>>
>>> help(sds2.iterators)                       # get help on the module
Help on package sds2:

Help on module sds2.iterators in sds2:

NAME
sds2.iterators - iterators for job objects

FILE
c:\progra~2\sds2_2~3\2015.17\bin\sds2.zip\sds2\iterators.py

DESCRIPTION
mo_ms([1,2]) -> obj.mo_m(1), obj.mo_m(2)
mo_les([1,2]) -> obj.mo_le(1), obj.mo_le(2)

Notice the naming convention to append an 's' to function that creates
a model.object, e.g. mo_m creates a member while mo_ms creates members

The naming convention for creating model.object iterators from generic types
is to drop the leading 'mo_'.
ms((1,member.Member(2))) -> obj.mo_m(1), obj.mo_m(2)
mts((member.Member(1).Material(0), (1,1))) -> obj.mo_mt(1,0), obj.mo_mt(1,1)

This module defines useful iterators for chaining all the objects on multiple
members.
ends((1,2,3)) -> obj.mo_le(1), obj.mo_re(1), obj.mo_le(2), obj.mo_re(2), obj.mo_le(3), obj.mo_re(3)
materials((1, 2)) -> all the materials on member 1 and member 2
gen_materials((1, 2)) -> all the gen_mtrls on member 1 and member 2
holes(materials([1])) -> all the holes on all the materials on member 1

FUNCTIONS
all_bs()
All bolts in the job

return bs_on_mo_ms(obj.all_ms())

all_cs()
All components in the job

return cs_on_mns(all_mns())

# use the python prompt to see the rest of this documentation

sds2.lists is a module that gives you useful functions to access information that you might otherwise query using the model module.

PR 45463 sds2.iterators and sds2.lists introduce functions for finding members and materials based on the Intersect3D module. (v2018)

SDS2 Python Prompt

>>> import sds2.lists                             # import the sds2.lists module
>>>
>>> help(sds2.lists)                               # get help on the module
Help on module sds2.lists in sds2:

NAME
sds2.lists

FILE
c:\progra~2\sds2_2~3\2015.17\bin\sds2.zip\sds2\lists.py

DESCRIPTION
list versions of the functions in sds2.iterators, mostly useful for python
prompt visual feedback of the more efficient iterator version.

FUNCTIONS
all_bs()
return list(sds2.iterators.all_bs())

all_cs()
return list(sds2.iterators.all_cs())

all_es()
return list(sds2.iterators.all_es())

all_hs()
return list(sds2.iterators.all_hs())

# use the python prompt to see the rest of this documentation

sds2.lockable

PR 36072 A new lockable module has been implemented for 2016. The following are some of it's key features:

The LockableValue class:
1. Intelligent enough to interpret values as section sizes, dimensions, variable spacings, 'combobox' alternatives or simple numbers and strings.

2. Variable spacings can be input as strings (eg. '3@3,4') or as a list like [3,3,3,4].

3. Serializable (picklable).

When interacting with a connection component:
1. Users are restricted to interacting with only those connection design locks that are visible on the member edit screen.

2. LockableValues obtained from a connection and visible via python will validate against the same rules as those on the member edit screen (such as maximums, minimums, available section sizes, etc.)

3. If a connection's locks affect those on a neighboring component (like the thickness of a butt plate on a column splice connection), the affected locks will be updated, similar to the way member/component edit works.

For more information, see help(sds2.lockable). (v2016)

PR 42421 Updated the lockable module to correctly interpret the top/bottom flange operation type on a connection component. The "groove angle" end preparation field will now be reported as an angle in degrees instead of radians. (v2017)

PR 47091 Fixed a bug in the list variant of the set function for variable spacing lockables in the sds2.lockable module. The bug caused the list variant to be a no op. (v2020)

sds2.obj

PR 32664 In parametrics, the model module is the recommended way to query the model. The new sds2.obj and sds2.iterators modules provide a cleaner way to use the model module using shorter syntax, generic functions, and iterators.

PR 43250 In the Python API sds2.obj.aabb_pt and aabb_m are no longer recursive and as such no longer are prone to maximum recursion errors. (v2017)

PR 41458 All parametric material add features, e.g. rect_plate.RectPlate, rolled_section.RolledSection, etc., can be converted to a MaterialBase.BuiltinMaterial instance via a new method BuiltinMaterialAddFeature(). From there, all the normal MaterialBase and BuiltinMaterial APIs, like polygon generation, apply. For example:

import Polygon
import rect_plate
from sds2.obj import vis_pt

rp = rect_plate.RectPlate()
rp.Width = 6.
rp.Thickness = .25
rp.color = 'Medium_material'
rp.WorkpointSlopeDistance = 12.
builtin = rp.BuiltinMaterialAddFeature()
poly = builtin.CreatePolygons()
with Polygon.Preview(poly) as preview:
vis_pt((0,0,0))
(v2017)

See help (sds2), help(sds2.obj), and help(sds2.iterators) for more information. (v2015)

PR 45463 sds2.obj introduces convenience functions for visualizing bounding boxes. [The Python API Intersect3D is used for fine grained bounding box intersections.] (v2018)

SDS2 Python Prompt

>>> import sds2.obj                            # import the sds2.obj module
>>>
>>> help(sds2.obj)                              # get help on the module
Help on module sds2.obj in sds2:

NAME
sds2.obj

FILE
c:\progra~2\sds2_2~3\2015.17\bin\sds2.zip\sds2\obj.py

DESCRIPTION
The model module is the recommended API for read access to members, ends, materials, holes, bolts, and welds. Each of those categories are represented by a single type, model.object, and the objects are accessed via indexes. This module provides syntactic sugar for accessing those objects.

Examples:
mo_m(1) #model.object for member 1
mo_e(1,0) #model.object for member 1's left end
mo_le(1) #model.object for member 1's left end
mo_re(1) #model.object for member 1's right end
mo_mt(1,0) #model.object for first material on member 1
mo_h(1,0,0) #model.object for first hole on mo_mt(1,0)
mo_b(1,0) #model.object for first bolt on member 1
mo_w(1,0) #model.object for first weld on member 1

SDS2 has multiple type representations for members, materials, holes, etc. This
module provides functions to convert between them (see to_mo, gen_mt,
hlist, mb) and functions to create model.objects from generic objects.
This module uses a naming convention that drops the 'mo_' prefix for creating
model.objects from generic functions.
Examples:
m(1)
m(mo_m(1))
m(member.Memer(1))
m(MemberBase.GetMemberLink(1,False,False)
mt(1,0)
mt(mt(1,0))
mt(member.Member(1).Material(0))

Creating model.object members can be surprisingly (and maybe alarmingly) easy.
assert m(1) == m(mt(1,0))

This module also provides access to member views and components which are not model.object types.
vs_on_m(1) #vies on member 1
v(1,0) #first view on member 1
cs_on_m(1) #components on member 1
c(1,0) #first component on member 1

# use the python prompt to see the rest of this documentation

sds2.piecemark

PR 17097 Added sds2.piecemark to the Python API as a way to automate the 'Edit Piecemarks' functionality. See help(sds2.piecemark) for more information. (v2016)

SDS2 Python Prompt

>>> import sds2.piecemark             # import the sds2.piecemark module
>>>
>>> help(sds2.piecemark)               # get help on the module
Help on module sds2.piecemark in sds2:

NAME
sds2.piecemark - Add iterator and list functions to _sds2_Piecemark

FILE
c:\progra~1\sds2_2~4\2016.12\bin\sds2.zip\sds2\piecemark.py

DESCRIPTION
See help(_sds2_Piecemark) for more information

FUNCTIONS
ChangeFromSystemToUser(...)
ChangeFromSystemToUser( (object)pcmk_references) -> None :
Set is_system to False for each PiecemarkReference

ChangeFromUserToSystem(...)
ChangeFromUserToSystem( (object)pcmk_references) -> None :
Set is_system to True for each PiecemarkReference

ChangePiecemarkForMembers(...)
ChangePiecemarkForMembers( (str)mark, (object)members) -> list :
Change the piecemark for each member

PiecemarkIndexIterator()
return PiecemarkIndexRange.__iter__()

PiecemarkIndexList()
return list(PiecemarkIndexRange())

PiecemarkReferenceIterator()
import itertools
return itertools.imap(PiecemarkReference, PiecemarkIndexRange())

PiecemarkReferenceList()
return list(PiecemarkReferenceIterator())

RemovePiecemarkForMembers(...)
RemovePiecemarkForMembers( (object)members) -> None :
Remove the piecemark for each member

DATA
__loader__ = <zipimporter object "C:\PROGRA~1\SDS2_2~4\2016.12\bin\sds...

sds2.status_display

PR 35188 Python API for Status Display. See help(sds2.status_display) for more information. (v2016)

SDS2 Python Prompt

>>> import sds2.status_display                       # import the module
>>>
>>> help(sds2.status_display)                          # get help on the module
Help on module sds2.status_display in sds2:

NAME
sds2.status_display - See help(_sds2_StatusDisplay) for more information

FILE
c:\progra~1\sds2_2~4\2016.12\bin\sds2.zip\sds2\status_display.py

FUNCTIONS
ApplyStatusDisplay(...)
ApplyStatusDisplay( (StatusDisplay)status_display) -> None

EditStatusDisplayUsingDefaultFile(...)
EditStatusDisplayUsingDefaultFile( (StatusDisplay)status_display [, (str)filename='']) -> StatusDisplay

EditStatusDisplayWithCurrentFile(...)
EditStatusDisplayWithCurrentFile( (StatusDisplay)status_display) -> StatusDisplay

GetCurrentStatusDisplay(...)
GetCurrentStatusDisplay() -> StatusDisplay

WriteStatusDisplayToFile(...)
WriteStatusDisplayToFile( (StatusDisplay)status_display [, (str)filename='']) -> None

DATA
__loader__ = <zipimporter object "C:\PROGRA~1\SDS2_2~4\2016.12\bin\sds...

sds2.sub_mtrl

PR 33984 Previously in parametrics the only way to read information about a sub material was to find an existing material in the job with a given sub_mtrl_idx via the model module. A new module sds2.sub_mtrl provides random access to any given sub_mtrl_idx and a way to iterate all the sub materials in the job. See help (sds2.sub_mtrl) for more information. (v2015)

PR 40840 In the Python API, sds2.sub_mtrl.SubMaterialReference returns an instance of CustomSubMaterialReference for custom material. (v2017)

SDS2 Python Prompt

>>> import sds2.sub_mtrl                             # import the sub_mtrl module
>>>                                    
>>> help(sds2.sub_mtrl)                               # get help on the module
Help on module sds2.sub_mtrl in sds2:

NAME
sds2.sub_mtrl

FUNCTIONS
MakeDerivedSubMaterialReference(...)
MakeDerivedSubMaterialReference( (object)arg1) -> object :

C++ signature :
boost::python::api::object MakeDerivedSubMaterialReference(boost::python::api::object)

SubMaterialIndexIterator()
return SubMaterialIndexRange().__iter__()

SubMaterialIndexList()
return list(SubMaterialIndexRange())

SubMaterialReference(sub_mtrl_idx)
return MakeDerivedSubMaterialReference(_SubMaterialReference(sub_mtrl_idx))

SubMaterialReferenceIterator()
import itertools
return itertools.imap(SubMaterialReference, SubMaterialIndexRange())

SubMaterialReferenceList()
return list(SubMaterialReferenceIterator())

# use the python prompt for more up-to-date documentation

PR 11170 Any submaterial in the job can now be added parametrically using the sds2.sub_mtrl.SubMaterialReference.BuiltinMaterial conversion and the MemberBase.AddMaterial API. For example (v2016):

from sds2.sub_mtrl import SubMaterialReference
from MemberBase import GetMemberLink
from Transform3D import Transform3D
member_number = 1
sub_mtrl_idx = 1
mem = GetMemberLink(member_number, False, True)
mtrl = SubMaterialReference(sub_mtrl_idx).BuiltinMaterial()
mtrl.SetXform(Transform3D(member_number))
mem.AddMaterial(mtrl)
mem.Write()

PR 42372 In the Python API a material's custom_material_type can be read from the model module and sds2.sub_mtrl modules. (v2017)

sds2.utility (package)

PR 36307 Added two higher level python APIs for creating Gadget screens. See help(sds2.utility.gadget_protocol) and help(sds2.utility.gadget_protocol_member) for more information. (v2016)

PR 41046 The SDS2 Python module sds2.utility.gadget_protocol defines model controllers (SyncSubDialogController and SyncModelCompleteSubdialogController) that can synchronize names from one gadget leaf (or banner) to another. SubDialogController instances can create dialog.pusher.Pusher instances and dialog.sync_pusher.SynchronizingSource instances to help create entries and rules across different gadget_protocol controllers. See methods SubDialogController.SourcedPusher and SubDialogController.SynchronizingSourceForName. (v2017)

PR 44622 In the Python API, Component's can now be edited during GadgetMember multi-edit. GadgetComponents can opt out by overriding MultiCreateUIFoldID() and return None. Otherwise, GadgetMember will group all the components of the same class and MultiCreateUIFoldID() together during multiedit. The default GadgetComponent.MultiCreateFoldID implementation is to return the fully qualified class name of the component. (v2018)

page 1 | contents | modules | top