Inventor General Discussion

Inventor General Discussion

Reply
Contributor
nkeeley
Posts: 17
Registered: ‎10-15-2012
Message 1 of 11 (548 Views)

Show complementary angles on flat patterns??

548 Views, 10 Replies
10-15-2012 03:44 PM

I'm trying to get Inventor 2012 (64 bit) to show the complementary angle to the bend angle in the bend annotation on a flat pattern within a drawing. I.e. the bend annotation shows: "10 UP" for a ten degree bend. I want it to show: "10 (170) up, where 170 degrees would be the complement to that angle, automatically. I know I could type it in, but then it will not update itself if I cange that angle.

 

Thanks for your help!

Employee
Yijiang.Cai
Posts: 358
Registered: ‎05-20-2008
Message 2 of 11 (531 Views)

Re: Show complementary angles on flat patterns??

10-15-2012 08:15 PM in reply to: nkeeley

Currently it does not support to automatically update the bend note result you want. But maybe you could consider iLogic or API for solution. 

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Contributor
nkeeley
Posts: 17
Registered: ‎10-15-2012
Message 3 of 11 (514 Views)

Re: Show complementary angles on flat patterns??

10-16-2012 09:08 AM in reply to: nkeeley

Thanks River, iLogic certainly seems like a promising solution. Unfortunately, I do not have any experience using iLogic. I used to know Visual Basic though and it appears very similar. Could you possibly give me a push in the right direction as far as how/where to start? I assume it would be in the drawing I want it to appear in. But I can't find any syntax referencing the bend angle as a starting point.

 

I'm imagining it would look something like: 'If' there is a bend angle notation, 'then' insert (180-BendAngle). Am I way off?

 

Thanks for your help, I really appreciate it.

 

Nathan

Employee
Yijiang.Cai
Posts: 358
Registered: ‎05-20-2008
Message 4 of 11 (488 Views)

Re: Show complementary angles on flat patterns??

10-17-2012 02:31 AM in reply to: nkeeley

Please refer the solution in the attached IDW. When changing the bend angle in IPT, and change to IDW, the angle will be updated when running the macro. Maybe the tolerance in bend note will display, there is no way to be controlled as the API related to this is not exposed yet. But you could edit the bend note to remove the tolerance display. For the code lines in macro, these are just a sample for reference.

 

Hope it helpful for you!

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Contributor
nkeeley
Posts: 17
Registered: ‎10-15-2012
Message 5 of 11 (462 Views)

Re: Show complementary angles on flat patterns??

10-22-2012 11:36 AM in reply to: nkeeley

River,

That does almost exactly what I'm looking for. It's too bad that it could not update automatically, but this will be functional for me as a substitute. But do you know of a way to apply a user defined dimension style (i.e. "Flat Pattern") to the bend note after adding the complementary angle in the macro?

 

Otherwise, the only solution I can think of that will remove the symmetric tolerance from the bend note is to re-split the bend note string and delete the part between the two angle symbols. Or I have to manually redefine the style for all the bends after running the macro.

 

Thanks, I really appreciate your help on this.

 

Nathan

Contributor
nkeeley
Posts: 17
Registered: ‎10-15-2012
Message 6 of 11 (426 Views)

Re: Show complementary angles on flat patterns??

11-12-2012 04:34 PM in reply to: nkeeley

River,

I've been playing with that code a little and I still can't get it to do what I want, but I feel like it should be able to. Could something like what I added below define the style for the bend note after it is edited or am I just beating a dead horse here?

 

I get error 438 on the "oNote.Style = oNewDimStyle" to say that the object does not support this property or method. Any alternatives??

 

***

 

Sub Test()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oView As DrawingView
    Set oView = oDoc.ActiveSheet.DrawingViews(1)
    
    Dim oNewDimStyle As DimensionStyle
    Set oNewDimStyle = oDoc.StylesManager.DimensionStyles.Item("Architectural (ANSI)")
    
    Dim oNote As BendNote
    Dim sTemp()  As String
    Dim sTemp1() As String
    Dim iAngle As Double
    
    For Each oNote In oDoc.ActiveSheet.DrawingNotes
        If oNote.Type = kBendNoteObject Then
            sTemp = Split(oNote.Text, " ")
            
            For i = 0 To UBound(sTemp)
                If InStr(sTemp(i), "°") > 0 Then
                    iAngle = CDbl(Split(sTemp(i), "°")(0))
                    
                    If InStr(oNote.FormattedBendNote, "(") > 0 Then
                        sTemp1 = Split(oNote.FormattedBendNote, "(")
                        oNote.FormattedBendNote = Replace(oNote.FormattedBendNote, Split(sTemp1(1), ")")(0), CStr(180 - iAngle))
            
                    Else
                        oNote.FormattedBendNote = Replace(oNote.FormattedBendNote, "</BendAngle>", "</BendAngle>" & "(" & CStr(180 - iAngle) & ")")
                        oNote.Style = oNewDimStyle
                    End If
                    Exit For
                End If
            Next
        End If
    Next
End Sub

 

***

Employee
Yijiang.Cai
Posts: 358
Registered: ‎05-20-2008
Message 7 of 11 (418 Views)

Re: Show complementary angles on flat patterns??

11-12-2012 07:46 PM in reply to: nkeeley

The code lines do work fine for me. So could you attach the drawing document for more investigation?

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Contributor
nkeeley
Posts: 17
Registered: ‎10-15-2012
Message 8 of 11 (406 Views)

Re: Show complementary angles on flat patterns??

11-13-2012 09:52 AM in reply to: nkeeley

I'm still testing on the same part you sent me (reattached here). But I cannot get the bend note to format as 'Architectural (ANSI)' to get rid of the tolerance note attached to the bend degree and radius.

Employee
Yijiang.Cai
Posts: 358
Registered: ‎05-20-2008
Message 9 of 11 (389 Views)

Re: Show complementary angles on flat patterns??

11-13-2012 09:46 PM in reply to: nkeeley

I guess there is no "Architectural (ANSI)" dimension style in your environment, and errors throws when running the code line - Set oNewDimStyle = oDoc.StylesManager.DimensionStyles.Item("Architectural (ANSI)")

 

So could you try to replace the code line above to this  -

Set oNewDimStyle = oDoc.StylesManager.DimensionStyles.Item(1)

 

Does this work fine for you?

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Contributor
nkeeley
Posts: 17
Registered: ‎10-15-2012
Message 10 of 11 (371 Views)

Re: Show complementary angles on flat patterns??

11-14-2012 07:58 AM in reply to: nkeeley

Unfortunately, it doesn't. I do not get an error when running that line. I get it when running the line: oNote.Style = oNewDimStyle

 

It returns error 438: Object doesn't support this property or method. Any more ideas?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.