Scalene triangle

Discussion in 'SolidWorks' started by Butch Cassidy, Nov 25, 2003.

  1. I need to create some solid scalene triangles in Solidworks. My problem is
    making a triangle with all three sides of different sizes. For example the
    sides of one trinagle need to be 7ft, 6ft and 3.5ft. When I try to use the
    polygon feature it does not allow me to dimension all sides individually.
    How do I accomplish this?
     
    Butch Cassidy, Nov 25, 2003
    #1
  2. What am I missing here - put three lines in a sketch and put dimensions on
    them. I'm confused, but it's probably me not understanding the situation.

    WT
     
    Wayne Tiffany, Nov 25, 2003
    #2
  3. Butch Cassidy

    JJ Guest

    That's what I'd do too - much easier unless you want an equilateral. I guess
    he either doesn't know this or prefers to use the polygon tool.

    JJ
     
    JJ, Nov 26, 2003
    #3
  4. Butch Cassidy

    kellnerp Guest

    Sounds like a new user problem.

    Draw three lines connected by their vertices and dimension each line to
    suit. You can even use ft units in the dimension dialog box to get the feet
    in.
     
    kellnerp, Nov 26, 2003
    #4
  5. here is a macro i wrote.
    i used the macro recorder. then i modified it to make a working
    program.

    #note the program does not check if it is a scalene triangle.

    hope this helps you out.
    Sean Phillips


    Option Explicit

    ' ******************************************************************************
    ' C:\DOCUME~1\sldprt\LOCALS~1\Temp\swx1636\Macro1.swb - macro recorded
    on 11/25/03 by sldprt
    ' ******************************************************************************
    Dim swApp As Object
    Dim Part As Object
    Dim boolstatus As Boolean
    Dim longstatus As Long, longwarnings As Long
    Dim FeatureData As Object
    Dim Feature As Object
    Dim Component As Object

    Dim Annotation As Variant
    Dim retval As Variant
    Dim SketchName As String
    Dim PartName As String
    Dim HoldUserInput As Double

    Sub main()

    Set swApp = Application.SldWorks

    Set Part = swApp.ActiveDoc
    boolstatus = Part.Extension.SelectByID("Front Plane", "PLANE", 0, 0,
    0, False, 0, Nothing)
    Part.InsertSketch2 True

    'Syntax (OLE Automation)
    'retval = ModelDoc2.GetActiveSketch2()
    Set retval = Part.GetActiveSketch2

    'Name = Feature.Name (VB Get property)
    SketchName = retval.Name

    'Syntax (OLE Automation)
    'retval = ModelDoc2.GetTitle()
    PartName = Part.GetTitle

    If PartName Like "*.sldprt" Then

    ElseIf PartName Like "*.SLDPRT" Then

    Else

    PartName = PartName & ".sldprt"

    End If

    'userPreferenceValue = swInputDimValOnCreate - To specify that the
    modify spin box
    'is automatically displayed for the input of a new dimension value,
    select this check box

    'Syntax (OLE Automation)
    'void SldWorks.SetUserPreferenceToggle(userPreferenceValue, onFlag)

    swApp.SetUserPreferenceToggle swInputDimValOnCreate, False

    Part.ClearSelection2 True
    Part.ViewZoomTo2 -0.00697167, 0.0811383, 0.025, 0.085409, -0.00697535,
    0.025
    Part.CreateLine2 0.01450654338549, 0.01371166429587, 0,
    0.06259672830725, 0.03159644381223, 0
    Part.CreateLine2 0.06259672830725, 0.03159644381223, 0,
    0.03080156472262, 0.04113499288762, 0
    Part.CreateLine2 0.03080156472262, 0.04113499288762, 0,
    0.01450654338549, 0.01371166429587, 0
    Part.ClearSelection2 True
    boolstatus = Part.Extension.SelectByID("Line1", "SKETCHSEGMENT",
    0.03636571834993, _
    0.02245533428165, 0, False, 0, Nothing)

    Set Annotation = Part.AddDimension2(0.0733276, -0.0244425, 0)
    Part.ClearSelection2 True
    Part.Parameter("D1@" & SketchName).SystemValue = 0.0513082
    boolstatus = Part.Extension.SelectByID("Line2", "SKETCHSEGMENT",
    0.04550682788051, _
    0.03636571834993, 0, False, 0, Nothing)

    Set Annotation = Part.AddDimension2(0.0729302, 0.0701481, 0)
    Part.ClearSelection2 True
    boolstatus = Part.Extension.SelectByID("D1@" & SketchName & PartName,
    _
    "DIMENSION", 0, 0, 0, False, 0, Nothing)

    Part.Parameter("D2@" & SketchName).SystemValue = 0.0331951
    boolstatus = Part.Extension.SelectByID("Line3", "SKETCHSEGMENT",
    0.02404509246088, _
    0.03119900426743, 0, False, 0, Nothing)

    Set Annotation = Part.AddDimension2(-0.0172886, 0.0498787, 0)
    Part.ClearSelection2 True
    boolstatus = Part.Extension.SelectByID("D2@" & SketchName & PartName,
    "DIMENSION", _
    0, 0, 0, False, 0, Nothing)

    Part.Parameter("D3@" & SketchName).SystemValue = 0.0318993
    boolstatus = Part.Extension.SelectByID("D1@" & SketchName & PartName,
    "DIMENSION", _
    0.07451991465149, -0.02086557610242, 0, False, 0, Nothing)

    HoldUserInput = InputBox("Enter 1st Side", "Entering Data")

    Part.Parameter("D1@" & SketchName).SystemValue = HoldUserInput
    boolstatus = Part.Extension.SelectByID("D2@" & SketchName & PartName,
    "DIMENSION", _
    0.0749173541963, 0.07332759601707, 0, False, 0, Nothing)

    HoldUserInput = InputBox("Enter 2nd Side", "Entering Data")

    Part.Parameter("D2@" & SketchName).SystemValue = HoldUserInput
    boolstatus = Part.Extension.SelectByID("D3@" & SketchName & PartName,
    "DIMENSION", _
    -0.01212190611664, 0.05901977240398, 0, False, 0, Nothing)

    HoldUserInput = InputBox("Enter 3rd Side", "Entering Data")

    Part.Parameter("D3@" & SketchName).SystemValue = HoldUserInput
    Part.ShowNamedView2 "*Trimetric", 8
    Part.ClearSelection2 True
    boolstatus = Part.Extension.SelectByID("D3@" & SketchName & PartName,
    "DIMENSION", _
    -0.01212190611664, 0.05901977240398, 0, False, 0, Nothing)

    HoldUserInput = InputBox("Enter depth", "Entering Data")

    Part.FeatureManager.FeatureExtrusion True, False, False, 0, 0,
    HoldUserInput, _
    0.00254, False, False, False, False, 0.01745329251994,
    0.01745329251994, False, _
    False, False, False, 1, 1, 1

    Part.SelectionManager.EnableContourSelection = 0

    'Syntax (OLE Automation)
    'void SldWorks.SetUserPreferenceToggle(userPreferenceValue, onFlag)

    swApp.SetUserPreferenceToggle swInputDimValOnCreate, True

    End Sub
     
    Sean Phillips, Nov 26, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.