ilogic make path

ilogic make path

sjoerd.van.der.eerden
Contributor Contributor
362 Views
1 Reply
Message 1 of 2

ilogic make path

sjoerd.van.der.eerden
Contributor
Contributor

hi, 

i'm writing some code to auto add balloons to my assambly. 

the balloon snipped needs a entitie to attach to. entities can only be made in parts as far as i know. 

the problem is that this component is present in a subassambly. and using the balloon snipped inventor cant find it. 

 

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim ptCyl = VIEW1.SheetPoint(-0.1, 0.1)
Dim balloon1 = Sheet_1.Balloons.Add("ComponentA:1 balloon", {ptCyl }, VIEW1.GetIntent((MakePath("leidingwerk pp:1", "pijp150 d63 pp:2")), "balloon"))

 and if i use a makepath then I get an error. 

any suggestions? 

0 Likes
Accepted solutions (1)
363 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Hi @sjoerd.van.der.eerden.  Maybe try this version, and see if it works any better for you.

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim ptCyl As DocumentUnitsPoint2d = VIEW1.SheetPoint(-0.1, 0.1)
Dim CompArg As ComponentArgument = New ComponentArgument({"leidingwerk pp:1", "pijp150 d63 pp:2"})
Dim Intent As GeometryIntent = VIEW1.GetIntent(CompArg, "balloon")
Dim balloon1 As IManagedBalloon = Sheet_1.Balloons.Add("ComponentA:1 balloon", {ptCyl}, Intent)

...or maybe like this, as an alternative way of specifying the points collection:

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim ptCyl As DocumentUnitsPoint2d = VIEW1.SheetPoint(-0.1, 0.1)
Dim oPoints As IEnumerable(Of DocumentUnitsPoint2d) = {ptCyl}
Dim CompArg As ComponentArgument = New ComponentArgument({"leidingwerk pp:1", "pijp150 d63 pp:2"})
Dim Intent As GeometryIntent = VIEW1.GetIntent(CompArg, "balloon")
Dim balloon1 As IManagedBalloon = Sheet_1.Balloons.Add("ComponentA:1 balloon", oPoints, Intent)

I am not super familiar with using the iLogic shortcuts way of adding balloons to lower level entities of an assembly in a drawing view, so this has not been tested yet.  I usually try to stick to the much longer, but better documented Inventor API route for doing things like this.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes