03-09-2015
02:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-09-2015
02:36 PM
Sheet Metal aktiv unfold rule
How can I find the aktiv unfold rule.
Now I use the 'InUse' code, but then I get 2 rules. 1 is the rule of the shet metal rule and 1 is the aktiv unfold rule.
I hope someone knows how to do this.
Wim
Get control of your sheet metal files.
Download the app from matprop.com
Download the app from matprop.com
03-10-2015
01:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-10-2015
01:31 AM
I think this is what you might be looking for.
Private Sub FlatStyle()
Dim oDoc As Inventor.PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oCompDef As SheetMetalComponentDefinition
Set oCompDef = oDoc.ComponentDefinition
Dim oName As String
oName = oCompDef.ActiveSheetMetalStyle.Name
End Sub
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
03-11-2015
11:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-11-2015
11:15 PM
That is not what I am looking for. If there are 2 or more rules then I can't find a way to find thar rule with a straight code. If the aktive rule is different from the selected unfold rule in the aktiv sheet metal style then it is not sure wich one you get.
With this code I get the aktiv unfold rule but I hope there is a better way.
Function kFactor(ByVal oSheetMetalCompDef As SheetMetalComponentDefinition) Dim strFindK As String = String.Empty Dim oUnfoldMethod As UnfoldMethod = Nothing Dim countUnfolds As Integer = 0 For Each oUnfoldMethod In oSheetMetalCompDef.UnfoldMethods If oUnfoldMethod.InUse Then countUnfolds = countUnfolds + 1 Next For Each oUnfoldMethod In oSheetMetalCompDef.UnfoldMethods If oUnfoldMethod.InUse Then If countUnfolds > 1 Then If Not oUnfoldMethod.Name.ToString = oSheetMetalCompDef.ActiveSheetMetalStyle.UnfoldMethod.Name.ToString Then Select Case oUnfoldMethod.UnfoldMethodType Case UnfoldMethodTypeEnum.kBendTableUnfoldMethod strFindK = oUnfoldMethod.Name.ToString Case UnfoldMethodTypeEnum.kLinearUnfoldMethod If oUnfoldMethod.kFactor.ToString.EndsWith("ul") Then strFindK = oUnfoldMethod.kFactor.Remove(oUnfoldMethod.kFactor.Length - 3, 3) Else strFindK = oUnfoldMethod.kFactor.ToString End If Case UnfoldMethodTypeEnum.kCustomEquationUnfoldMethod strFindK = "Equation" End Select End If Else Select Case oUnfoldMethod.UnfoldMethodType Case UnfoldMethodTypeEnum.kBendTableUnfoldMethod strFindK = oUnfoldMethod.Name.ToString Case UnfoldMethodTypeEnum.kLinearUnfoldMethod If oUnfoldMethod.kFactor.ToString.EndsWith("ul") Then strFindK = oUnfoldMethod.kFactor.Remove(oUnfoldMethod.kFactor.Length - 3, 3) Else strFindK = oUnfoldMethod.kFactor.ToString End If Case UnfoldMethodTypeEnum.kCustomEquationUnfoldMethod strFindK = "Equation" End Select End If End If Next Return strFindK End Function
Get control of your sheet metal files.
Download the app from matprop.com
Download the app from matprop.com
03-12-2015
01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-12-2015
01:03 AM
Im really not sure what you are trying to achieve. Are you trying to see if the user has locally edited the sheet metal style so its now different from the library?
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro