AddBalloons using GeometryIntent providing a centermarkt as argument.

AddBalloons using GeometryIntent providing a centermarkt as argument.

Anonymous
Not applicable
576 Views
2 Replies
Message 1 of 3

AddBalloons using GeometryIntent providing a centermarkt as argument.

Anonymous
Not applicable

Hi all,

 

With VB.Net I am developing an application to autoballoon big assemblies according to the items in the partslist. In order to create the balloons I have to make use of GeometryIntents. That geometryintent will be added to a objectcollection which will used as argument in the Balloons.Add method.

 

If I give a Curve as geometry in the GeometryIntent it creates the balloons just fine, but when giving a centermark as geometry, it kicks me out at the point where it uses the Balloons.Add method, even when centermarks are suppossed to be valid arguments.

 

I don't want to use curves because i'm working with very big assemblies, and it takes too much time to iterate through curves and their segments. So instead i want to use a workpoint which once included in the drawing is represented by a centermark.

 

The referenceddocument of my drawing view if an assemblie which contains subassemblies which also contain subassemblies. Somewhere down the tree is where the workpoint is created.

 

I think that my problem comes from the fact that the centermark is no "direct"  geometry present in the view, but a representing centermark instead.

 

I am able to get the workpoint information in the sheet, so I know that i'm getting the point. but still I can't make it work.

 

Does anyone know if what i'm trying to do is possible and if not any suggestions?

 

Here's the code.

 

Dim oCurve As DrawingCurve = Nothing
For Each oCurve In oCurves
If oCurve.CurveType = CurveTypeEnum.kLineSegmentCurve Then

Dim oSegment As DrawingCurveSegment = Nothing
For i = 0 To oCurve.Segments.Count

Try
'Get the mid point of the selected curve, assuming that the selection curve is linear.
'Dim oMidPoint As Point2d = Nothing
'oMidPoint = oCurve.MidPoint

 

'Set a reference to the TransientGeometry object.
Dim oTG As TransientGeometry = Nothing
oTG = _InventorApplication.TransientGeometry

 

Dim oLeaderPoints As ObjectCollection = Nothing
oLeaderPoints = _InventorApplication.TransientObjects.CreateObjectCollection

 

'Create a leader point.
'oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 1, oMidPoint.Y + 1))
oLeaderPoints.Add(oTG.CreatePoint2d(oCenterMark1.Position,X, oCenterMark1.Position.Y))

 

'Add the GeometryIntent to the leader points collection. 
Dim oGeometryIntent As GeometryIntent = Nothing

'oGeometryIntent = oSheet.CreateGeometryIntent(oCurve, oCurve.MidPoint)
oGeometryIntent = oSheet.CreateGeometryIntent(oCenterMark1)

oLeaderPoints.Add(oGeometryIntent)

 

'Set a reference to the parent drawing view of the selected curve
Dim oDrawingView As DrawingView = Nothing
oDrawingView = oCurve.Parent

 

Dim oBalloon As Balloon = Nothing

'Just create the balloon with the leader points
'oBalloon = oDrawDoc.ActiveSheet.Balloons.Add(oLeaderPoints) 'Here's where it kicks me out.
oBalloon = oSheet.Balloons.Add(oLeaderPoints)
oBalloon.SetBalloonType(BalloonTypeEnum.kHexagonBalloonType)
'bBalloonned = True

Catch ex As Exception
MsgBox(ex.Message)
End Try
End If

Next

 

Thanks in advance for the help.

0 Likes
Accepted solutions (1)
577 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous 

 

Welcome to the Inventor community, note that there is a dedicated place for programming related questions called the Inventor Customization forum :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

You can use the REPORT button in your original post to ask the admin staff to move your topic to that forum. 

 

Another think to be aware of, is that when you are creating or replying to a thread there is a button called Insert Code that allows you to place code in box that will make it a bit easier to read and will not introduce formatting and extra characters issues for others who might copy down your code for testing.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

Message 3 of 3

BrianEkins
Mentor
Mentor
Accepted solution

I don't think Inventor supports attaching a balloon to a centermark.  I'm not able to do it interactively so I don't expect that the API will support it either.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes