iLogic-Insert sheet metal thickness on the drawing view of the flat pattern

iLogic-Insert sheet metal thickness on the drawing view of the flat pattern

Anonymous
Not applicable
1,648 Views
5 Replies
Message 1 of 6

iLogic-Insert sheet metal thickness on the drawing view of the flat pattern

Anonymous
Not applicable

Hello,

Can you please help. I know basically nothing about ilogic. Does anyone can share a ilogic rule that puts into view label of the flat pattern text "FLAT PATTERN" + <thickness> + "PLATE" taken from parameters of the model in mm.

I have few simple ilogic rules that initiate when you pick a view on the drawing page in inventor and run the rule from ilogic browser.  If it would work this way, that would be perfect. Thank you very much for the help.

 

Capture1.JPG

0 Likes
Accepted solutions (1)
1,649 Views
5 Replies
Replies (5)
Message 2 of 6

dgreatice
Collaborator
Collaborator
Accepted solution

Hi,

 

try this, condition:

1. All opened document will be checking

2. All sheet will be checking

3. All view will be checking (Only flat pattern view)

 

 

Sub Main
    Dim oApp As Application
    Dim oDoc As Document
    Dim oDD As DrawingDocument
    Dim oSht As Sheet
    Dim oDV As DrawingView
    Dim oModelDoc As Document
    Dim oPD As PartDocument
    Dim oSMCD As SheetMetalComponentDefinition
    Dim oThick As String
    oApp = ThisApplication
    
    For Each oDoc In oApp.Documents.VisibleDocuments
        If oDoc.DocumentType = kDrawingDocumentObject Then
            oDD = oDoc
            For Each oSht In oDD.Sheets
                For Each oDV In oSht.DrawingViews
                    oModelDoc = oDV.ReferencedDocumentDescriptor.ReferencedDocument
                    If oModelDoc.DocumentType = kPartDocumentObject Then
                        oPD = oModelDoc
                        If oDV.IsFlatPatternView = True Then
                            oSMCD = oPD.ComponentDefinition
                            
                            If oSMCD.UseSheetMetalStyleThickness = False Then
                                oThick = oSMCD.Thickness.Value * 10
                            Else
                                oThick = oSMCD.ActiveSheetMetalStyle.Thickness
                            End If
                            oDV.ShowLabel = True
                            oDV.Label.FormattedText = "Flat Pattern<Br/>" & oThick & "mm Plate"
                        End If
                    End If
                Next
            Next
        End If
    Next
End Sub

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 3 of 6

Anonymous
Not applicable

Thank you dgreatice!!! It works a charm. Even better than I wanted to, it runs the rule through whole drawing file and on all pattern in one go. Thanks again Smiley Happy

0 Likes
Message 4 of 6

cadman777
Advisor
Advisor

I have used Kent Keller's "sheetmetalextents" add-in for years, and it's never failed me yet.

It creates 2 Parameters for OAL & OAW, which I reference in my BOM.

To get it into the view label, you can put them into 2 unused Model iProperties.

This mathod streamlines the process so you don't need iLogic.

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 5 of 6

alexander.hendrix
Contributor
Contributor

I used the code above to add the sheet metal parameter to the flat pattern view, but the issue is that it does it for every flat pattern view. Even when this is a detail view of the 'full' flat pattern view. Is it possible to exclude detail views?

0 Likes
Message 6 of 6

alexander.hendrix
Contributor
Contributor

For those who are interested, I was able to add the following code in bold below to the if statement to make sure it was only changing the name of the standard flat pattern view (and not for detail views, sections, auxiliary and so on of a flat pattern):

If oDV.IsFlatPatternView = True And oDV.ViewType = kStandardDrawingViewType Then