Potential Bug w/ ThreadNotes.Add method in Inv 2012

Potential Bug w/ ThreadNotes.Add method in Inv 2012

Anonymous
Not applicable
508 Views
3 Replies
Message 1 of 4

Potential Bug w/ ThreadNotes.Add method in Inv 2012

Anonymous
Not applicable

In the picture below, the "*" represents a Point2D location on the sheet where the hole note text belongs. That same Point2D object was supplied to the ThreadNotes.Add method. It's not working out very well. I'm getting sparatic results trying out different locations. If I supply the routine with static numbers, it does ok. I'm trying to put the text relative to the center point of the hole. All 45° angles seem to reproduce this problem. The "*" is 0.625cm away from the centerpoint of the hole on a 45° angle. I've tried 1cm through 10cm, all producing the same results as the picture. It appears to be putting the hole note at the center point of the hole. Other angles puts the text in the wrong location but, not in the center of the hole.

 

Public Overloads Sub AddThreadNote(ByVal _curve As DrawingCurve, ByVal _textLocation As Point2d)

                ' Create the hole/thread note.
                Dim _threadNote As HoleThreadNote
                _threadNote = Drawing.ActiveSheet.DrawingNotes.HoleThreadNotes.Add(_textLocation, _curve)
            End Sub

 

 

 

0 Likes
509 Views
3 Replies
Replies (3)
Message 2 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

Could you provide a complete code demo to help to reproduce the issue? It is a bit hard to give a comment with the description.

0 Likes
Message 3 of 4

Anonymous
Not applicable

Sure, If you need any more information, let me know. I have a video on the Autodesk cloud that shows some of the things in the following code working if you care to view it. Let me know and I'll share it with you.

 

            '--------------------------------------------------------------------
            ' Annotate Detail B. {View 4}
            '--------------------------------------------------------------------
' GeoIntent is a generic collection that allows me to store information
' about a curve that has a proxy attribute behind it. Either on a face or edge.
' It's properties are: 1. Attribute Name, 2. Attribute Value, 3. GeometryIntent,
' 4. PointIntentEnum, 5. DrawingCurve, 6. X, 7. Y
Dim _detailViewIntent As New List(Of GeoIntent) iDrawing.GetGeoIntentFromCurves(_detailViewIntent, 4)

' Here I collect the geometry intent from each hole in a view Dim _detailViewHoleIntent As New List(Of GeometryIntent) _detailViewHoleIntent = iDrawing.GetHoleGeoIntent(4) ' Get the outside face. Sort those points along the X-Axis. In the view provided,
' this is the long horizontal line on the bottom. _filter1 = _detailViewIntent.FindAll(Function(G1 As GeoIntent) G1.Name.Contains("12-1") _ And G1.Value.Contains("12-02-OutsideFace-2")) _filter1.Sort(Function(G1 As GeoIntent, G2 As GeoIntent) G1.X.CompareTo(G2.X)) ' Create the center mark for each hole found. iDrawing.CreateCenterMark(_detailViewHoleIntent, CentermarkTypeEnum.kRegularCentermarkType) ' Set a reference to two geometry intent objects for a general dimension _geoIntent(0) = _filter1.First.Intent ' GeometryIntent representing the left most point _geoIntent(1) = _detailViewHoleIntent.First ' Center point GeometryIntent for 1st hole. ' Add the general dimension iDrawing.Dimension.AddGeneralDim(4, _geoIntent, DimOrigin_Enum.Left, _ DimensionTypeEnum.kVerticalDimensionType) ' Set a text location reference from the first hole geometry intent object ' on the view @ a 45° down & to the right _point2D = iAutomation.InvApplication.TransientGeometry.CreatePoint2d( _ _detailViewHoleIntent.First.PointOnSheet.X + 0.625, _ _detailViewHoleIntent.First.PointOnSheet.Y - 0.625)
' Get the DrawingCurve objects from a view that are circles. Dim _drawCurves As New List(Of Inventor.DrawingCurve) _drawCurves.AddRange(iDrawing.GetCurvesFromDrawing(4, CurveTypeEnum.kCircleCurve)) ' Add the hole note. iDrawing.Dimension.AddThreadNote(_drawCurves(0), _point2D)

 

0 Likes
Message 4 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

Sorry, I meant a complete (buildable) code project.  Code snippets will not help us, because they don't allow us to reproduce the context in which the code runs.

 

Probably I could knowing better on the problem after viewing your video. Could you share the link? 

 

0 Likes