' ' Author: Paul Shilton ' Organization: Engineering Geometry Systems ' Date: 6/10/03 ' Copyright (c) 2003, Engineering Geometry Systems ' ' General Description ' Create a tapered pocket from a curve at the bottom of the pocket ' The curve name, depth, and taper are all hard coded here but could ' easily be entered by the user from a dialog. ' Option Explicit Sub Main Dim doc As FMDocument Dim offset_curve As FMCurve, bottom_curve As String Dim offset As Double, depth As Double, taper_degree As Double, taper_radian As Double Dim model As FMModel Set doc = ActiveDocument bottom_curve = "curve1" depth = 1.0 taper_degree = 2.0 ' 2 degrees taper_radian = (taper_degree * (2*3.14159))/ 360.0 ' convert to radians offset = Sin(taper_radian) * depth ' offset the bottom curve Set offset_curve = doc.AddCurveOffsetFromCurve( bottom_curve, offset, False) ' select the offset curve and translate it up to the top doc.Select( offset_curve, True, True) doc.XFormTranslate True,True,1,0,0,depth ' both the offset_curve and the top curve are selected after the translate. loop ' thru the selected models and make a pocket from the top one. For Each model In doc.Selected If model <> offset_curve Then doc.AddPocket( model, depth,,,taper_degree) End If Next model End Sub