Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok,
I am still learning how to use iLogic, so bear with me. I have been able to find snippets from others that accomplish what I have done so far. This iFeature I have is really causing me some issues. When I run the iLogic, it allows me to pick the initial surface and the the 2 reference work planes. After that it fails. I know the iFeature works, because I can do it manually. Please review the code and let me know where I have gone wrong.
The error says Member not found. I have attached pictures of the error as well as the iFeature.
Any help is really appreciated.
Public Sub Main() Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument Dim oPartDef As PartComponentDefinition oPartDef = oPartDoc.ComponentDefinition ' Get the selected face to use as input for the iFeature. Dim oFace As Face oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select a planar face") 'Get the XY Planes Dim oPlane1 As WorkPlane oPlane1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPlaneFilter, "Select a XZ Plane") Dim oPlane2 As WorkPlane oPlane2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPlaneFilter, "Select a YZ Plane") Dim oFeatures As PartFeatures oFeatures = oPartDef.Features ' Create an iFeatureDefinition object. Dim oiFeatureDef As iFeatureDefinition oiFeatureDef = oFeatures.iFeatures.CreateiFeatureDefinition( "\\Dse-eng\dse-cad\Inventor Files\Templates & Libraries\Catalog\DSE Features\Feature Specific\Button_Pwr_5Prog_UpDown.ide") ' Set the input. Dim oInput As iFeatureInput For Each oInput In oiFeatureDef.iFeatureInputs Dim oParamInput As iFeatureParameterInput Select Case oInput.Name Case "Sketch Plane1" Dim oPlaneInput As iFeatureInput 'Dim oPlaneInput As iFeatureSketchPlaneInput oPlaneInput = oInput oPlaneInput.PlaneInput = oFace Case "XZPlane1" Dim oPlaneInput As iFeatureWorkPlaneInput 'Dim oPlane1Input As iFeatureSketchPlaneInput oPlaneInput = oInput oPlaneInput.PlaneInput = oPlane1 Case "YZPlane2" Dim oPlaneInput As iFeatureWorkPlaneInput 'Dim oPlane1Input As iFeatureSketchPlaneInput oPlaneInput = oInput oPlaneInput.PlaneInput = oPlane2 Case "PlaneOffset" oParamInput = oInput oParamInput.Expression = "-3.0 in" End Select Next ' Create the iFeature. Dim oiFeature As iFeature oiFeature = oFeatures.iFeatures.Add(oiFeatureDef) End Sub
Solved! Go to Solution.