Change bend radius with Ilogic...?

Change bend radius with Ilogic...?

j.wolbers-NoTech
Enthusiast Enthusiast
1,611 Views
10 Replies
Message 1 of 11

Change bend radius with Ilogic...?

j.wolbers-NoTech
Enthusiast
Enthusiast

Hi,

 

Is it possible to automatically adjust the bend radius (sheet metal) using an external Ilogic code? I have a different bend radius for each thickness of material than the standard radius that Inventor uses.

 

In the code I would therefore like to indicate for each material thickness which radius we use here. If we draw a thickness that is not in the list, it should just be the default radius.

 

Kinds regards,

Jeffrey

0 Likes
1,612 Views
10 Replies
Replies (10)
Message 2 of 11

marcin_otręba
Advisor
Advisor

For this better approach will be to create each thickness style inside your style library, and set it up to be exactly what you need. There is more than thickness and bend radius to set up.

Then you can have addin to choose correct style.

if you will go with changing radius then:

 

Dim sh As SheetMetalComponentDefinition = ThisDoc.Document.componentdefinition
sh.ActiveSheetMetalStyle.BendRadius=3

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

Message 3 of 11

Darkforce_the_ilogic_guy
Advisor
Advisor

where would you like to have the list of ben radius ?

0 Likes
Message 4 of 11

WCrihfield
Mentor
Mentor

Again, I believe that setting up your Sheet Metal Styles would be the best route for this situation, but if we're going the iLogic rule route, here are a couple thoughts.

Have you considered using an expression (equation) that sets the Bend Radius based on the thickness, like (Thickness * 1.5) or (Thickness / 2), instead of a specific number?

If you went the equation route, then perhaps you would only need to change the equation when changing material type, instead of each thickness variation.

But if you already have an established thickness vs bend radius chart that you go by, try something like this to accomplish your task.

It starts out by checking to make sure the active document's type is Part document, and the document's SubType Name is SheetMetal.  It then defines and sets the value of the SheetMetalComponentDefinition variable.  It then checks the current value of the Thickness parameter, then sets either the Value or Expression of the BendRadius parameter, based on the thickness value.

If you have a fairly long list of thicknesses and bend radius value pairs (in an Excel spreadsheet), and you're set on using that, I would suggest using the value of the thickness parameter to match one of the values in the Thickness column of that Excel file, then capturing that row, then retrieve the corresponding BendRadius value to use locally to set the Parameter's value.

 

 

If ThisApplication.ActiveDocumentType = DocumentTypeEnum.kPartDocumentObject And _
	ThisApplication.ActiveDocument.PropertySets.Item("Design Tracking Properties").Item("Document SubType Name").Value = "Sheet Metal" Then
	Dim oCD As SheetMetalComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
	If oCD.Thickness.Value = .125 Then
		oCD.BendRadius.Value = .1875
		'or
		'oCD.BendRadius.Expression = "Thickness * 1.5"
	ElseIf oCD.Thickness.Value = .25 Then
		oCD.BendRadius.Value = .375
		'or
		'oCD.BendRadius.Expression = "Thickness * 1.5"
	End If
End If

 

 

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
  • Create DocumentSubTypeEnum Click Here
  • Add kRevisionTag or kDrawingRevisionTag to ObjectTypeEnum Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 11

j.wolbers-NoTech
Enthusiast
Enthusiast

Hi @WCrihfield & @marcin_otręba 

 

I agree with you that it is better to solve this in the style library.

However, it is not clear to me how to do this.

Unfortunately, it is not possible to use a formula to calculate the radius from the thickness.

Do I have to add multiple sheet metal rules here (see image below)?

 

1.PNG

 

Then the sheet metal styles can always be updated by means of Ilogic. So that it also works well with files copied from the vault database.

 

Kinds regads,

Jeffrey

0 Likes
Message 6 of 11

marcin_otręba
Advisor
Advisor

hi,

 

it is possible to write formula in radius value for exaple Thickness/2.

I use multiple sheetmetal rules for each sheet thickess (also for different die's)

marcin_otręba_0-1592217412276.png

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 7 of 11

WCrihfield
Mentor
Mentor

Yes. Here is a link to the online Help file for creating new Sheet Metal Rules.

Style and Standard Editor - Sheet Metal Rule Reference 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 8 of 11

if you are using vault you might need to check same files out to make the change or add new stylres...but you might want to thing about if you want to use k factor or ben table  for your styles as well. I have help building a system before there each sheet type have it our ben radiut , material. and an ben table for each type of materiel. 

 

if you want help to make an ilogic code , or  sheel metal styles .. then just let me know what your want ... I will try to help you break it down for you ... but need more info about that the ben radius have to be ... if there is a pattern  or it is very uniq for each thickness

0 Likes
Message 9 of 11

adam_liMNCRV
Advocate
Advocate

i built a big assembly using many bent plates of different wall thickness. The bend radius is 1.5thickness.

Is it possible change the bend radius in the assembly using external ilogic? 

For example,

2mm, radius 4mm

3mm, radius 4mm

6mm, radius 10mm

...

0 Likes
Message 10 of 11

js10000
Explorer
Explorer

This would also be a great help for us. Is that possible?

0 Likes
Message 11 of 11

marcin_otręba
Advisor
Advisor

you can use:

 

On Error Resume Next
Dim ass As AssemblyDocument = ThisApplication.ActiveDocument
Dim sh As SheetMetalComponentDefinition
	For Each doc As Document In ass.AllReferencedDocuments
   		If doc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'sheetmetal
			sh = doc.componentdefinition
			Select Case sh.Thickness.Value
				Case 0.2 ' 2mm
					sh.ActiveSheetMetalStyle.BendRadius = "4 mm"
				Case 0.3 '3mm
					sh.ActiveSheetMetalStyle.BendRadius = "4 mm"
				Case 0.6 ' 6mm
					sh.ActiveSheetMetalStyle.BendRadius = "10 mm"
                End Select
                ' sh.ActiveSheetMetalStyle.BendRadius= "Thickness * 1,5" ' change thickness parameter to your language
		End If
	Next

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes