Yoooyoyoyoyoyooyoyoyyyyooyoyooyo
friends,
i need help creating a rectangular / linear pattern along a helical curve with a solution in iLogic.
I attached an .ipt file and two pictures for easier understanding
Simply put, i created a hole on a cylinder, and now i want to create a pattern of this hole along a helical curve (which was created via a 3D-Sketch).
im no VBA expert, but i found some code snippets online which work towards the goal.
The following code works in creating patterns, but only along an Axis, not a helical curve
Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oPartComp As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oHole As HoleFeature = oPartComp.Features.HoleFeatures.Item("Bohrung1")
Dim oBjCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Call oBjCol.Add(oHole)
Dim oAxis As WorkAxis = oPartComp.WorkAxes.Item(1)
oRectFeat = oPartComp.Features.RectangularPatternFeatures.Add(oBjCol, oAxis, False, 3, 5, PatternSpacingTypeEnum.kDefault)
this thread had a similar problem:
Help would be very appreciated.
Regards
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
Here you go. That was both interesting and fun.
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kPartDocumentObject Then
MsgBox("A Part Document must be active for this rule (" & iLogicVb.RuleName & ") to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE")
Exit Sub
End If
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oHole As HoleFeature = oPDef.Features.HoleFeatures.Item(1)
Dim oHCurve As HelicalCurve = oPDef.Sketches3D.Item(1).HelicalCurves.Item(1)
Dim oPath As Path = oPDef.Features.CreatePath(oHCurve)
Dim oGeomIntent As GeometryIntent = oPDef.CreateGeometryIntent(oPath)
Dim oFeatsToPattern As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
oFeatsToPattern.Add(oHole)
Dim oRPattDef As RectangularPatternFeatureDefinition = oPDef.Features.RectangularPatternFeatures.CreateDefinition(oFeatsToPattern, oGeomIntent, True, 105, 3)
'oRPattDef.Operation = PartFeatureOperationEnum.kCutOperation
oRPattDef.XDirectionSpacingType = PatternSpacingTypeEnum.kDefault
oRPattDef.ComputeType = PatternComputeTypeEnum.kIdenticalCompute
oRPattDef.OrientationMethod = PatternOrientationEnum.kAdjustToDirection1
Dim oPattern As RectangularPatternFeature = oPDef.Features.RectangularPatternFeatures.AddByDefinition(oRPattDef)
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.