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
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:
Wesley Crihfield
(Not an Autodesk Employee)
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.
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.