Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

modify feature with ilogic

2 REPLIES 2
Reply
Message 1 of 3
Geertvdheide92
574 Views, 2 Replies

modify feature with ilogic

Hi all, 

 

I have a question about modifying an existing feature with ilogic. 

The most topics i can find have some ilogic code creating a feature but not modifying an existing one. 

what i want i to have a sketch with a pattern in it. with ilogic i can modify the number of the pattern, but when this is a sketch pattern new profiles added in the sketch are not in the cut feature. 

i think it should be something like this

Dim oProfile As Profile
Dim oDef As ExtrudeDefinition
On Error GoTo NoProfile
'oProfile = oSketch.Profiles.AddForSolid
For Each oProfile In  oSketch.Profiles
oDef.Profile.Item.AddsMaterial = True
Next

Dim oCut As ExtrudeDefinition
oCut = oCompDef.Features.ExtrudeFeatures.Item("Extrusion2").Definition(oDef)

but this doesnt seem to work.

 

there is a good reason i want to use a sketch pattern in stead of a feautre pattern. it is possible that the cut is not entirly on the sheet metal part. when i make a cut and pattern that feature i think the model will have errors because possibly the cut isn't in the sheet, so the pattern doesnt work.

 

also i want to run the code from an higher level assembly, so i don't know if its possible to exclude ActiveDocument.

 

kind regards, 

 

Geert

Labels (1)
2 REPLIES 2
Message 2 of 3
WCrihfield
in reply to: Geertvdheide92

Unfortunately, the sketch method is going to cause more problems than the feature method, because of the change and update process.  Generally, it's just as easy to delete the feature and recreate it after modifications to the sketch which will change the number of closed profiles used for extruded cuts or protrusions.

What I usually do for those situations is:

  • Create parameters which can be used to determine the available size/area for the pattern based on some aspect of the design.
  • Create parameters to use as your spacing & quantity values within the feature pattern.
    • Use mathematical equations within those quantity & spacing parameters, which reference the names of the parameters (the parameters defining available area), to control what quantity and spacing combinations will fit within the available area.
  • Create the Feature Pattern using those parameter names in place of numbers for its values.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3
Geertvdheide92
in reply to: WCrihfield

I know the feature pattern will casue less problems, this was also the intital way to go. 

The only problem now is that i have to pattern a cut in a rounded sheet metal part. 

The problem here is that when i maken the first cut and than pattern this one the patterned cuts don't got through the plate.

Geertvdheide92_0-1593616308412.png

so this is also a reason i want to adjust a sketch, to make the cut in one feature, select trough all, and all the holes will be in the plate. 

I cannot use the emboss feature beacuse the result from the top view wont be a perfect cirkel. 

I also cannot use the unfold/refold option because when the rounded part is flattened its not a cirkel nor an ellips. so i cannot create a sketch dat will be close enough to the end product. 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report