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!
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, 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.
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!
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.
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??
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("Architect
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))
oNote.FormattedBendNote = Replace(oNote.FormattedBendNote, "</BendAngle>", "</BendAngle>" & "(" & CStr(180 - iAngle) & ")")
oNote.Style = oNewDimStyle
The code lines do work fine for me. So could you attach the drawing document for more investigation?
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("Architect
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?
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?
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register