Feature Rectangular Pattern creation in assembly using iLogic

Feature Rectangular Pattern creation in assembly using iLogic

jakub_piaseczny
Explorer Explorer
115 Views
3 Replies
Message 1 of 4

Feature Rectangular Pattern creation in assembly using iLogic

jakub_piaseczny
Explorer
Explorer

Hi guys,

 

I tried to look everywhere (even used AI to help me but it failed totally), but found no information on how to create pattern of a feature in assembly using iLogic.

 

Best to show it on example: I created assembly and in 3D Model tab using Extrude feature I removed some material from fin (part between the tubes) creating a slot. I used rectangular operation from the same 3D model tab to create more cuts. Manually everything works, parts are not cut in their files but I have slots in assembly.

 

My question is, if this is possible to be done using iLogic? I have Extrude feature defined, but found no information how to define its creation.

 

jakub_piaseczny_0-1754488874241.png

 

To be clear: I don't want to create the pattern manually and then use iLogic to modify parameters, I need to create the Rectangular feature from 0 using iLogic, just having the Extrusion operation in deature tree.

 

I would really appreciate any help

 

0 Likes
Accepted solutions (1)
116 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @jakub_piaseczny.  It is difficult to determine from your initial post how much you may already know about iLogic, or how well you can navigate Inventor's API object model, so I am just going to start out by posting a series of Links to some of the objects your code will need find and access, as well as maybe some of their properties or methods that will likely be involved in that overall process.  But there simply is not enough information here to start writing an actual code example that would immediately work for you...too many unknown details involved.

AssemblyDocument (object)

AssemblyDocument.ComponentDefinition (property)

AssemblyComponentDefinition (object)

AssemblyComponentDefinition.Features (property)

Features (object)

Features.RectangularPatternFeatures (property)

Features.ExtrudeFeatures (property)

RectangularPatternFeatures (object)

ExtrudeFeatures (object)

RectangularPatternFeatures.CreateDefinition (method)

RectangularPatternFeatureDefinition (object)

RectangularPatternFeatures.AddByDefinition (method)

RectangularPatternFeature (object)

ExtrudeFeature (object)

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

jakub_piaseczny
Explorer
Explorer

Hi @WCrihfield,

 

I do am using a lot of iLogic to build smart templates or parts/assemblies, but I couldn't find any information on how to create the type of pattern in assembly (3D model feature pattern).

Bellow sample of a code if I were to build regular pattern with components / occurrences:

jakub_piaseczny_0-1754550143648.png


Does anyone know what a script for creation of feature pattern can look like based on this example?

0 Likes
Message 4 of 4

jakub_piaseczny
Explorer
Explorer
Accepted solution
Dim oAsm As AssemblyDocument = ThisApplication.ActiveDocument
Dim oDef As AssemblyComponentDefinition = oAsm.ComponentDefinition

Dim oExtFeat As ExtrudeFeature = oDef.Features.Item("slot_top_cut")

Dim patt As RectangularPatternFeature

Dim oColl As ObjectCollection
oColl = ThisApplication.TransientObjects.CreateObjectCollection()
oColl.Add(oExtFeat)

Dim oAxis As WorkAxis
oAxis = oDef.WorkAxes.Item("X Axis")

Dim rectDef As RectangularPatternFeatureDefinition
rectDef = oDef.Features.RectangularPatternFeatures.CreateDefinition(oColl, oAxis, True, tube_qty_tube - 1, pitch / 10)

patt = oDef.Features.RectangularPatternFeatures.AddByDefinition(rectDef)

patt.Name = "slot_top_pattern"


OK, I managed to solve it 😉

0 Likes