SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
Classes | Functions | Variables
Designable.Proxies Namespace Reference

Classes

class  BoltAddProxy
 No documentation available. More...
class  BreakApartMaterialsProxy
 No documentation available. More...
class  ChangeSeveralMaterialsProxy
 No documentation available. More...
class  CopyMaterialProxy
 No documentation available. More...
class  HoleAddProxy
 No documentation available. More...
class  Layout3D
 No documentation available. More...
class  MaterialAddProxy
 No documentation available. More...
class  MaterialEraseDesignableProxy
 No documentation available. More...
class  MaterialEraseExistingProxy
 No documentation available. More...
class  MaterialSansWkptSlopeAddProxy
 No documentation available. More...
class  MemberBaseAddMaterialProxy
 No documentation available. More...
class  MemberBaseAddMaterialsProxy
 No documentation available. More...
class  MemberViewTupleProxy
 No documentation available. More...
class  MergeMaterialProxy
 No documentation available. More...
class  MirrorMaterialProxy
 No documentation available. More...
class  MirrorMaterialsProxy
 No documentation available. More...
class  MtrlCutProxy
 No documentation available. More...
class  MtrlFitProxy
 No documentation available. More...
class  Proxy
 Base class for all Proxy classes. More...
class  RebarMaterialAddProxy
 No documentation available. More...
class  RebarMaterialBatchAddProxy
 No documentation available. More...
class  RebarMaterialFitToDowelsProxy
 No documentation available. More...
class  WasherProxy
 No documentation available. More...
class  WeldAddProxy
 No documentation available. More...

Functions

def AddBoltOrThrow
def AddMaterialOrThrow
def AddMemberPresetView
def AddMemberView
def AddWeldOrThrow
def BntPlate
def BntPlateLayout
def Bolt
def BreakApartMaterials
def Clevis
def compact_AddMaterial_for_member
def construct_property
def CopyMaterialToMember
def CreateBoltAddInstanceFromProxy
def CreateHoleAddInstanceFromProxy
def CreateHoleOrThrow
def CreateLayoutInstanceFromProxy
def CreateMaterialAddInstanceFromProxy
def CreateMtrlCutInstanceFromProxy
def CreateMtrlFitInstanceFromProxy
def CreateWeldAddInstanceFromProxy
def Deck
def default_member_material_finish
def default_node0_depth
def ExistingHolesMostLikelyCreatedByProxy
def ExistingMaterialMatchesProxyItems
def ExistingMaterialMatchesProxyItemsUsingGenMtrlConstructor
def ExistingMaterialMostLikelyAddedByAddMaterial
def ExistingMaterialMostLikelyCreatedByProxy
def ExplicitlySetProxyItems
def find_implicit_layout_depth
def FlatBar
def Grate
def GrateTrd
def Hole
def is_AddMaterialable
def layout_node0_depth
def make_Layout3D_proxy
def MemberBase_AddMaterialsToProcessable
def MemberBase_AddMaterialToProcessable
def MergeMaterial
def MirrorMaterialCopiesToMember
def MirrorMaterialCopyToMember
def MtrlCut
def MtrlCutOrThrow
def MtrlFit
def MtrlFitOrThrow
def PlateLayout
def RectPlate
def RndBar
def RndPlate
def RolledSection
def RollPl
def set_default_depth_vector_for_layout
def set_default_submaterial_to_global
def ShrStud
def SqrBar
def subm_to_layout
def subm_to_pts_layout
def Turnbuckle
def Weld

Variables

string DEFAULT_BOLT_FINISH = 'Black'
string DEFAULT_GALVANIZED_MEMBER_BOLT_FINISH = 'Hot dipped galvanized'
string DEFAULT_GALVANIZED_MEMBER_MATERIAL_FINISH = 'Galvanized'
string DEFAULT_MATERIAL_COLOR = 'Medium_material'
string DEFAULT_MATERIAL_FINISH = 'Red Oxide'

Detailed Description

This module provides proxy classes and functions that mimic the functionality of the traditional parametric API for adding materials, bolts, welds, and holes to a job. These proxy clases are better suited for custom members and components because they can be pickled (and in general behave more like regular python objects), and are process aware (i.e. they know exactly what material creation phase of process they should be executed in). For example, consider a traditional parametric that adds two plates, a hole, a hole match, and a bolt match.

import rect_plate import hole_add import bolt_add

def add_rect_plate(thickness, width, p1, p2, origin, member_number, subm_to_global): m = rect_plate.RectPlate() m.Thickness = thickness m.Width = width m.Point1 = point.Point(p1) m.Point2 = point.Point(p2) m.MaterialOriginPoint = origin m.WorkpointSlopeDistance = m.Point1.dist(m.Point2) m.Member = member.Member(member_number) m.Add() m.SetTransform(subm_to_global) return m

def AddBoltedPlates(mem1, mem2, p1, p2, width, thickness = .5): xform = Transform3D.MemberTransform(p1, p2) x_dir = xform.GetBasisVectorX() y_dir = xform.GetBasisVectorY() z_dir = xform.GetBasisVectorZ() mid_p1_p2 = Point3D.Interpolate(p1, p2, .5) w2 = width / 2. to_center_width = -w2 * y_dir

rp1 = add_rect_plate(thickness, width, p1, p2, 'FS', mem1, xform)

h = hole_add.Hole() h.Material = [rp1] h.pt1 = point.Point(mid_p1_p2 + to_center_width) h.face = 'FS Face' h.Columns = 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()

rp2 = add_rect_plate(thickness, width+1., p1, p2, 'NS', mem2, xform)

hm = hole_add.Hole() hm.Material = [rp2] hm.Holes = [h] hm.BoltDiameter = h.BoltDiameter hm.BoltType = h.BoltType hm.HoleType = 'Standard Round' hm.Diameter = hm.CalculateHoleSize() hm.SlotLength = hm.CalculateSlotLength() hm.Create()

b = bolt_add.Bolt() b.Material = [rp1] b.Match = [rp2] b.Diameter = h.BoltDiameter b.BoltType = h.BoltType b.Direction = 'Out' b.SuppressWarnings = 'Yes' b.IsFieldBolt = 'Field' if mem1 != mem2 else 'Shop' b.AddMatch()

We can easily convert this code over to the new Proxies module by simply changing the imports

import Proxies rect_plate = Proxies hole_add = Proxies bolt_add = Proxies

When this code is run as a parametric the objects are added at the moment the Add(), Create(), and AddMatch() calls are executed. However, when the code is executed from the Design method of a Processable plugin, the actual creation is delayed until the proper time during process. This is possible because Add, Create, and AddMatch are implemented via RegisterOrExecute which uses the call stack to determine if the proxy should actually add the material at that moment or if the proxy should add the material at another time.

Obviously, Add, Create, and AddMatch are more expensive now, especially when we know beforehand that the material should either be added at that moment xor added later. The good news is they are only provided to provide backward compatibility with the traditional API for adding objects. To be clear, they are not necessary, nor recommended for production code. See Execute() and RegisterDesignProxy() for the recommended alternatives.

Another recommendation when using the Proxies module is to avoid using the getter of the class properties, e.g. Point1, Point2, etc. The getter of these properties is more expensive and used primarily for backward compatibility.

Function Documentation

def Designable.Proxies.AddBoltOrThrow (   args)
 AddBoltOrThrow(args)
def Designable.Proxies.AddMaterialOrThrow (   args)
 AddMaterialOrThrow(args)
def Designable.Proxies.AddMemberPresetView (   args)
 AddMemberPresetView(args)
def Designable.Proxies.AddMemberView (   args)
 AddMemberView(args)
def Designable.Proxies.AddWeldOrThrow (   args)
 AddWeldOrThrow(args)
def Designable.Proxies.BntPlate (   args)
 BntPlate(args)
def Designable.Proxies.BntPlateLayout (   args)
 BntPlateLayout(args)
def Designable.Proxies.Bolt (   args)
 Bolt(args)
def Designable.Proxies.BreakApartMaterials (   args)
 BreakApartMaterials(args)
def Designable.Proxies.Clevis (   args)
 Clevis(args)
def Designable.Proxies.compact_AddMaterial_for_member (   args)
 compact_AddMaterial_for_member(args)
def Designable.Proxies.construct_property (   args)
 construct_property(args)
def Designable.Proxies.CopyMaterialToMember (   args)
 CopyMaterialToMember(args)
def Designable.Proxies.CreateBoltAddInstanceFromProxy (   args)
 CreateBoltAddInstanceFromProxy(args)
def Designable.Proxies.CreateHoleAddInstanceFromProxy (   args)
 CreateHoleAddInstanceFromProxy(args)
def Designable.Proxies.CreateHoleOrThrow (   args)
 CreateHoleOrThrow(args)
def Designable.Proxies.CreateLayoutInstanceFromProxy (   args)
 CreateLayoutInstanceFromProxy(args)
def Designable.Proxies.CreateMaterialAddInstanceFromProxy (   args)
 CreateMaterialAddInstanceFromProxy(args)
def Designable.Proxies.CreateMtrlCutInstanceFromProxy (   args)
 CreateMtrlCutInstanceFromProxy(args)
def Designable.Proxies.CreateMtrlFitInstanceFromProxy (   args)
 CreateMtrlFitInstanceFromProxy(args)
def Designable.Proxies.CreateWeldAddInstanceFromProxy (   args)
 CreateWeldAddInstanceFromProxy(args)
def Designable.Proxies.Deck (   args)
 Deck(args)
def Designable.Proxies.default_member_material_finish (   args)
 default_member_material_finish(args)
def Designable.Proxies.default_node0_depth (   args)
 default_node0_depth(args)
def Designable.Proxies.ExistingHolesMostLikelyCreatedByProxy (   args)
 ExistingHolesMostLikelyCreatedByProxy(args)
def Designable.Proxies.ExistingMaterialMatchesProxyItems (   args)
 ExistingMaterialMatchesProxyItems(args)
def Designable.Proxies.ExistingMaterialMatchesProxyItemsUsingGenMtrlConstructor (   args)
 ExistingMaterialMatchesProxyItemsUsingGenMtrlConstructor(args)
def Designable.Proxies.ExistingMaterialMostLikelyAddedByAddMaterial (   args)
 ExistingMaterialMostLikelyAddedByAddMaterial(args)
def Designable.Proxies.ExistingMaterialMostLikelyCreatedByProxy (   args)
 ExistingMaterialMostLikelyCreatedByProxy(args)
def Designable.Proxies.ExplicitlySetProxyItems (   args)
 ExplicitlySetProxyItems(args)
def Designable.Proxies.find_implicit_layout_depth (   args)
 find_implicit_layout_depth(args)
def Designable.Proxies.FlatBar (   args)
 FlatBar(args)
def Designable.Proxies.Grate (   args)
 Grate(args)
def Designable.Proxies.GrateTrd (   args)
 GrateTrd(args)
def Designable.Proxies.Hole (   args)
 Hole(args)
def Designable.Proxies.is_AddMaterialable (   args)
 is_AddMaterialable(args)
def Designable.Proxies.layout_node0_depth (   args)
 layout_node0_depth(args)
def Designable.Proxies.make_Layout3D_proxy (   args)
 make_Layout3D_proxy(args)
def Designable.Proxies.MemberBase_AddMaterialsToProcessable (   args)
 return processable.RegisterDesignProxy(MemberBaseAddMaterialsProxy(member = member, materials = materials))
def Designable.Proxies.MemberBase_AddMaterialToProcessable (   args)
 return processable.RegisterDesignProxy(MemberBaseAddMaterialProxy(arg1 = arg1, arg2 = arg2))
def Designable.Proxies.MergeMaterial (   args)
 MergeMaterial(args)
def Designable.Proxies.MirrorMaterialCopiesToMember (   args)
 MirrorMaterialCopiesToMember(args)
def Designable.Proxies.MirrorMaterialCopyToMember (   args)
 MirrorMaterialCopyToMember(args)
def Designable.Proxies.MtrlCut (   args)
 MtrlCut(args)
def Designable.Proxies.MtrlCutOrThrow (   args)
 MtrlCutOrThrow(args)
def Designable.Proxies.MtrlFit (   args)
 MtrlFit(args)
def Designable.Proxies.MtrlFitOrThrow (   args)
 MtrlFitOrThrow(args)
def Designable.Proxies.PlateLayout (   args)
 PlateLayout(args)
def Designable.Proxies.RectPlate (   args)
 RectPlate(args)
def Designable.Proxies.RndBar (   args)
 RndBar(args)
def Designable.Proxies.RndPlate (   args)
 RndPlate(args)
def Designable.Proxies.RolledSection (   args)
 RolledSection(args)
def Designable.Proxies.RollPl (   args)
 RollPl(args)
def Designable.Proxies.set_default_depth_vector_for_layout (   args)
 set_default_depth_vector_for_layout(args)
def Designable.Proxies.set_default_submaterial_to_global (   args)
 set_default_submaterial_to_global(args)
def Designable.Proxies.ShrStud (   args)
 ShrStud(args)
def Designable.Proxies.SqrBar (   args)
 SqrBar(args)
def Designable.Proxies.subm_to_layout (   args)
 subm_to_layout(args)
def Designable.Proxies.subm_to_pts_layout (   args)
 subm_to_pts_layout(args)
def Designable.Proxies.Turnbuckle (   args)
 Turnbuckle(args)
def Designable.Proxies.Weld (   args)
 Weld(args)

Variable Documentation

string Designable.Proxies.DEFAULT_BOLT_FINISH = 'Black'
string Designable.Proxies.DEFAULT_GALVANIZED_MEMBER_BOLT_FINISH = 'Hot dipped galvanized'
string Designable.Proxies.DEFAULT_GALVANIZED_MEMBER_MATERIAL_FINISH = 'Galvanized'
string Designable.Proxies.DEFAULT_MATERIAL_COLOR = 'Medium_material'
string Designable.Proxies.DEFAULT_MATERIAL_FINISH = 'Red Oxide'