示例#1
0
def match_elevation(e1,e2):
    """Match Elevation of Elements"""
    element1location = e1.Location.Curve.GetEndPoint(1)
    element2location = e2.Location.Curve.GetEndPoint(1)
    vector_z = element1location[2] - element2location[2] 
    vector = XYZ(0,0,vector_z) 
    return ElementTransformUtils.MoveElement(doc, e2.Id, vector)
示例#2
0
def create_dimension(element, point1, point2, reference_names_list, view, direction_to_move=XYZ(0, 0, 0)):
    line = Line.CreateBound(point1, point2)
    refArray = ReferenceArray()
    for ref in reference_names_list:
        refArray.Append(element.GetReferenceByName(ref))
    dim = doc.Create.NewDimension(view, line, refArray)
    ElementTransformUtils.MoveElement(doc, dim.Id, direction_to_move)
    return dim
示例#3
0
def move_element_schedule(scheduleview_port, view, value_x, value_y):
    bb_vp = scheduleview_port.get_BoundingBox(view)
    if bb_vp:
        x = UnitUtils.ConvertToInternalUnits(value_x, DisplayUnitType.DUT_MILLIMETERS)
        y = UnitUtils.ConvertToInternalUnits(value_y, DisplayUnitType.DUT_MILLIMETERS)
        new_x = x - bb_vp.Max.X - bb_vp.Min.X
        pt3 = XYZ(new_x, y, 0)
        point = ElementTransformUtils.MoveElement(doc, scheduleview_port.Id, pt3)
        return point
示例#4
0
                                   AssemblyDetailViewOrientation.ElevationBack,
                                   assembly_sheet,
                                   pt_right_view,
                                   'ARH_БезЗаголовка',
                                   'ARH_Section')

# Создание вида сверху
pt_top_view = XYZ(0.491049476255798, 0.243470403613338, 0)
top_view = create_detail_section(assembly,
                                 AssemblyDetailViewOrientation.ElevationTop,
                                 assembly_sheet,
                                 pt_top_view,
                                 'ARH_БезЗаголовка',
                                 'ARH_Section')
center = top_view[1].GetBoxCenter()
ElementTransformUtils.MoveElement(doc, top_view[1].Id, pt_top_view - center)
TransactionManager.Instance.ForceCloseTransaction()

TransactionManager.Instance.EnsureInTransaction(doc)
assembly.AssemblyTypeName = elem_name
# Размеры-------------------------------------------------------------------------------------
create_dimension_on_view(elem, 'horizontal', right_view[0])
create_dimension_on_view(elem, 'vertical', right_view[0])
create_dimension_on_view(elem, 'horizontal', right_view[0])
create_dimension_on_view(elem, 'vertical', right_view[0])
create_dimension_on_view(elem, 'horizontal', section_view[0])
create_dimension_on_view(elem, 'vertical', section_view[0])
create_dimension_on_view(elem, 'horizontal', top_view[0])
create_dimension_on_view(elem, 'vertical', top_view[0])
TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()