The sds2 package (contains various modules)
SDS2 Python Prompt |
>>> import sds2 # import the package
NAME
FILE
PACKAGE CONTENTS
|
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.breakapartFILE
c:\progra~1\sds2_2~4\2016.12\bin\sds2.zip\sds2\breakapart.pyFUNCTIONS
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...
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 on module sds2.iterators in sds2:
NAME
FILE
DESCRIPTION
FUNCTIONS
# 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
NAME
FILE
DESCRIPTION
FUNCTIONS
# use the python prompt to see the rest of this documentation |
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)
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_ptrp = 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
NAME
FILE
DESCRIPTION
# use the python prompt to see the rest of this documentation |
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_PiecemarkFILE
c:\progra~1\sds2_2~4\2016.12\bin\sds2.zip\sds2\piecemark.pyDESCRIPTION
See help(_sds2_Piecemark) for more informationFUNCTIONS
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 memberDATA
__loader__ = <zipimporter object "C:\PROGRA~1\SDS2_2~4\2016.12\bin\sds...
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 informationFILE
c:\progra~1\sds2_2~4\2016.12\bin\sds2.zip\sds2\status_display.pyFUNCTIONS
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='']) -> NoneDATA
__loader__ = <zipimporter object "C:\PROGRA~1\SDS2_2~4\2016.12\bin\sds...
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
NAME
FUNCTIONS
# 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)
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)