Sheet Metal Flat Pattern Template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi To All,
I am creating this sheet metal template and i was able to incorporate a parametric Kfactor which swops the Kfactor Value And The Sheet Metal Rules Via A switch in my parameter list. As well i created Some Rules Which overwrite the imported Length Width And Thickness To The Sheet Metal Parameters (Flat Pattern Extent) And Thickness.
The first problem i have is:
It does successfully overwrite the parameters in the F(x) Parameter list Once The Flat Pattern Is created.
But I would like to be able to delete the flat pattern which i cant as it ll recreate the flat pattern on safe. So i went in the code and deleted the upper portion of the code which will let me delete the flat pattern:
1. BEFORE (This Rule creates the flat pattern and adds it to the parameters (SheetMetalLength etc.)
'This Rule Adds The Sheet Metal LENGTH To The Parameter & Overwrites The Imported Parameter From Rule 000001' 'Rule Will Only Overwrite Parameter, IF The User Converts The Part To A Sheet Metal Part' 'If User Decides To Convert It Back To A Standard Part, Then This Rule Will Revert It Back To The Imported Parameter' 'This Is Also Applicable, If The User Decides To Delete The Flat Pattern BUT The Sheet Metal Remains' 'Written By Phoenix Ocean - Date 2023-06-17 - Code Tested - Date 2023-06-17 Dim oDoc As Document oDoc = ThisApplication.ActiveDocument Dim oType As String oType = oDoc.DocumentSubType.DocumentSubTypeID If oType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" And MetalComponent = ("NO") Then Parameter("SheetMetalLength") = SheetMetal.FlatExtentsLength Else If oType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" And MetalComponent = ("NO") Then Parameter("SheetMetalLength") = LengthImport End If iLogicVb.UpdateWhenDone = True
The Code Above Succeeds BUT On Delete the Flat Pattern & Safe it recreates the flat Pattern which id like it not to do.
So i went ahead and deleted the first part of the code such as follow:
2. After (This Rule works and also lets me delete the flat pattern BUT It DOESNT ADD Now The Values To The Parameter:
'This Rule Adds The Sheet Metal LENGTH To The Parameter & Overwrites The Imported Parameter From Rule 000001' 'Rule Will Only Overwrite Parameter, IF The User Converts The Part To A Sheet Metal Part' 'If User Decides To Convert It Back To A Standard Part, Then This Rule Will Revert It Back To The Imported Parameter' 'This Is Also Applicable, If The User Decides To Delete The Flat Pattern BUT The Sheet Metal Remains' 'Written By Phoenix Ocean - Date 2023-06-17 - Code Tested - Date 2023-06-17 'First Part Deleted Out Of Code. If oType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" And MetalComponent = ("NO") Then Parameter("SheetMetalLength") = SheetMetal.FlatExtentsLength Else If oType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" And MetalComponent = ("NO") Then Parameter("SheetMetalLength") = LengthImport End If iLogicVb.UpdateWhenDone = True
What am i missing? There isnt any Ilogic refering to creating a sheet metal flat pattern in this code....
See file attached - Drawn & created In Inventor 2024 Professional