- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a part with an iLogic rule which derives a sketch and scales it from a user parameter. The rule then sets the sketch as a profile and then extrudes it, again by a length specified by a user parameter. Finally, I then apply a circular pattern to the extruded feature.
Within the part file, this rule runs flawlessly and I get the results I want, however. When I add the part to an assembly and run the rule. I get the following error;
I need to have this rule run in the assembly but I can't seem to get this to work without getting this error.
If anyone has any idea on how to get this to work from an assembly, i would be extremely grateful as this error is really slowing my work down.
Here is the iLogic rule too;
Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument ' Create a derived definition for the molded part. Dim oDerivedPartDef As DerivedPartUniformScaleDef oDerivedPartDef = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.CreateUniformScaleDef(ThisDoc.Path + "\" & "innerStrands90.ipt") ' Set the scale to use. oDerivedPartDef.ScaleFactor = scale ' Create the derived part. oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Add(oDerivedPartDef) ' Extrude sketch ' Set sketch to profile Dim oCompDef As PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition Dim oSketches As PlanarSketches oSketches = ThisApplication.ActiveDocument.ComponentDefinition.Sketches Dim oSketch As PlanarSketch oSketch = oSketches.Item("Core") Dim oProfile As Profile oProfile = oSketch.Profiles.AddForSolid ' Extrude Dim oExtrudeDef As ExtrudeDefinition oExtrudeDef = oCompDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kNewBodyOperation) oDistance = length / 10 oDirection = kPositiveExtentDirection oJoinOrCut = kJoinOperation Dim oExtrude As ExtrudeFeature oExtrude = oCompDef.Features.ExtrudeFeatures.AddByDistanceExtent(oProfile, oDistance, oDirection, oJoinOrCut) oExtrude.Name = "extrudedCore" ' Circular pattern Dim objCol As ObjectCollection objCol = ThisApplication.TransientObjects.CreateObjectCollection objCol.Add(oCompDef.Features("extrudedCore")) oDeg = 360 * 0.0174532925 oCompDef.Features.CircularPatternFeatures.Add(objCol, oCompDef.WorkAxes.Item("Z Axis"), False, 4, oDeg, True)
Thank you.
Solved! Go to Solution.