Message 1 of 2
Function overloading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a function to draw a plan of a steel member as follows -
Public Function DrawPlan(pLocation As Point3d, pAngle As Double) As Boolean
Dim mPi As Double = 4 * Atan(1)
Dim mResult As Boolean
Dim mLineType As String
mLineType = "HIDDEN"
mResult = Rectangle(pLocation, pAngle, MyBase.Length, MyBase.MemberWidth)
mResult = DrawParallelLines(pLocation, pAngle, MyBase.Length, MyBase.WebThickness, mLineType)
Return mResult
End Function
The rectangle function draws outline of steel member and DrawParallelLines function draws web with linetype HIDDEN.
Now I realize that I may need another variation of the same function as follows -
Public Function DrawPlan(pPoint1 As Point3d, pPoint2 As Point3d) As Boolean
Dim mPi As Double = 4 * Atan(1)
Dim mResult As Boolean
Dim mLineType As String
mLineType = "HIDDEN"
'Replace first three parameters in following two functions as follows
'Calculate pLocation as mid point of pPoint1 and pPoint2
'Calculate pAngle as AngleFromXAxis for pPoint1 and pPoint2
'Calculate MyBase.Length as distance between pPoint1 and pPoint2
mResult = Rectangle(pLocation, pAngle, MyBase.Length, MyBase.MemberWidth)
mResult = DrawParallelLines(pLocation, pAngle, MyBase.Length, MyBase.WebThickness, mLineType)
Return mResult
End Function
My question is how do I summon the first function in the second variation.
Nimish