
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to use VBA to create a cut feature with the extent value equal to the thickness of the sheet (function works for sheetmetal parts only). This is the (cropped to required) code I use:
Dim oSMDef as sheetmetalcomponentdefinition Dim oProf as Profile Dim oCutDef as CutDefinition Dim oCutFeat as CutFeature 'some non-important code here that defines oProf and oSMDef etc Set oCutDef = oSMDef.Features.CutFeatures.CreateCutDefinition(oProf) 'Call oCutDef.SetToNextExtent(kNegativeExtentDirection) 'this works, but it just uses the thickness as it is now, if it changes, it doesnt update. Call oCutDef.SetCutAcrossBendsExtent(oSMDef.Parameters.ModelParameters.Item("Thickness").Expression) Set oCutFeat = oSMDef.Features.CutFeatures.Add(oCutDef)
For now, I have tried 3 things:
1. do nothing, just create the cutdefinition without setting the extent value nor direction. this works fine as the feature automatically uses the thickness as reference. However, it uses the thickness as blind value. if the sheet thickness is increased afterwards, the cut feature will not adjust (thus becoming a blind cut).
2. SetToNextExtent, this worked fine. but, it occured (this makes 1. also invalid) that it is required to use CutAcrossBends incase it cuts over a bending.
3. SetCutAcrossBendsExtent, this is the function that must be used. as parameter I tried at first the simple method: "oSMDef.Thickness.Value". This yielded the same issue as with 1. Looking into Cutfeatures created manually, I noticed the extent distance is directly coupled to the modelparameter (the thickness). but if I try to link this using the method seen in the code above, it still uses the thickness as a blind value it is at this moment.
Is it possible to set the cut extent value to the thickness model property? and if so, how?
Thanks in advance,
Peter Verheijen
Solved! Go to Solution.