iLogic, make extrusion on Flat Pattern

iLogic, make extrusion on Flat Pattern

Rob67ert
Collaborator Collaborator
874 Views
3 Replies
Message 1 of 4

iLogic, make extrusion on Flat Pattern

Rob67ert
Collaborator
Collaborator

I like to make an extrusion of a sketch that is placed on the flat pattern.

What i now have is:

SyntaxEditor Code Snippet

Dim oDoc As PartDocument = ThisDoc.Document
Dim oDef As SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim oSK As Sketch = oDef.FlatPattern.Sketches(1)
Dim oProfile As Profile = oSK.Profiles.AddForSolid
Dim oExtrudeDef As ExtrudeDefinition = oDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kJoinOperation)
Call oExtrudeDef.SetDistanceExtent(0.25, kPositiveExtentDirection)
oExtrude = oDef.Features.ExtrudeFeatures.Add(oExtrudeDef)

But this makes the extrusion on the Sheetmetal and not on the Flat pattern...

 

Does anyone have an idea how i can make this work correct?

Robert

If you find this reply helpful ? It would be nice if you use the Accept as Solution or Kudos button below.
0 Likes
Accepted solutions (1)
875 Views
3 Replies
Replies (3)
Message 2 of 4

MechMachineMan
Advisor
Advisor

Your oDef is the folder part model. You tell it to put the features on the folded part model according to your rule.

 

You need to use oDef.Flatpattern as that is also a sheetmetalcomponentdefinition, but is the one responsible for the flat pattern.

 

If that still doesn't work, you may actually have to activate the part for edit in flat pattern mode.

 

Good luck.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 4

bshbsh
Collaborator
Collaborator
Accepted solution

You have to create the ExtrusionDefinition and the Extrusion feature on the Flatpattern, not on oDef (which is the folded sheetmetal definition.)

so basically replace all oDef.Features with oDef.FlatPattern.Features:

Dim oDoc As PartDocument = ThisDoc.Document
Dim oDef As SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim oSK As Sketch = oDef.FlatPattern.Sketches(1)
Dim oProfile As Profile = oSK.Profiles.AddForSolid
Dim oExtrudeDef As ExtrudeDefinition = oDef.FlatPattern.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kJoinOperation)
Call oExtrudeDef.SetDistanceExtent(0.25, kPositiveExtentDirection)
oExtrude = oDef.FlatPattern.Features.ExtrudeFeatures.Add(oExtrudeDef)
0 Likes
Message 4 of 4

Rob67ert
Collaborator
Collaborator
I know that is had to be something like that.

Thanks.
Robert

If you find this reply helpful ? It would be nice if you use the Accept as Solution or Kudos button below.
0 Likes