iLogic 2025 - LeaderNotes.Add(Point ObjectCollection, String) Error - No Such Interface supported

iLogic 2025 - LeaderNotes.Add(Point ObjectCollection, String) Error - No Such Interface supported

micahstearns
Participant Participant
335 Views
4 Replies
Message 1 of 5

iLogic 2025 - LeaderNotes.Add(Point ObjectCollection, String) Error - No Such Interface supported

micahstearns
Participant
Participant

I am running into an issue with a piece of iLogic code (external rule) I wrote to automate the creation of assemblies and drawings, where the leader notes that I had previously been able to place are now no longer placing and throwing an error message as follows:

Error on line 1389 in rule: Mongoose Configurator Code, in document: WO-S-11546 DIXON STOCK 184-HD.iam

No such interface supported

 

More info tab as follows:

System.ArgumentException: No such interface supported

 

at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Object[] aArgs, Boolean[] aArgsIsByRef, Int32[] aArgsWrapperTypes, Type[] aArgsTypes, Type retType)
at Inventor.LeaderNotes.Add(ObjectCollection LeaderPoints, String FormattedText, Object DimensionStyle)
at ThisRule.Main() in external rule: Mongoose Configurator Code:line 1389
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at Autodesk.iLogic.Exec.AppDomExec.ExecCodeHere()
at Autodesk.iLogic.Exec.AppDomExec.ExecCodeInOtherDomain(AppDomain otherDomain, String assemName)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

This code starts from running an an assembly document, places various parts according to a spec number from user input, and then will save the assembly, create a drawing document with 2 named sheets, place views, places rev tables, text blocks, and leader notes, places text blocks, dimensions on second sheet, saves drawing, prints each page to separate pdf, and checks in.

 

This code worked without issue before updating to inventor 2025. Post update it will create the assembly, save, create new drawing document, creates second sheet, names both sheets, place borders, title blocks, rev tables, first text block on sheet 1, and views on both sheets. It then throws the above error when it attempts to use the following snippet to add the first leader note to the drawing: error on line 20 from below.

 

I have included the full iLogic file for reference.

 

Dim invApp As Inventor.Application
Dim DrawDoc As DrawingDocument
Dim Production, Sales As Sheet
Dim frmOcc As ComponentOccurrence
Dim frmAsmComp As AssemblyComponentDefinition
Dim frmWP As WorkPoint
Dim frmCO As String
Dim frmWPProxy As WorkPointProxy
Dim frmMK As Centermark
Dim frmPT As ObjectCollection
Dim frmNote As LeaderNote

frmWP = frmAsmComp.WorkPoints.Item("FRM")
frmWPProxy = Nothing
frmOcc.CreateGeometryProxy(frmWP, frmWPProxy)
frmMK = Production.Centermarks.AddByWorkFeature(frmWPProxy, Right)
frmPT = invApp.TransientObjects.CreateObjectCollection
frmPT.Add(invApp.TransientGeometry.CreatePoint2d(frmMK.Position.X - 0.75, frmMK.Position.Y - 1.25))
frmPT.Add(Production.CreateGeometryIntent(frmMK))
frmNote = Production.DrawingNotes.LeaderNotes.Add(frmPT, frmCO)

 

0 Likes
Accepted solutions (1)
336 Views
4 Replies
Replies (4)
Message 2 of 5

Stakin
Collaborator
Collaborator
Try:
frmPT.Add(Production.CreateGeometryIntent(frmMK,frmMK.Position))
0 Likes
Message 3 of 5

micahstearns
Participant
Participant

the adjustment did not produce any meaningful change. I am still getting the same error

0 Likes
Message 4 of 5

micahstearns
Participant
Participant

I have established through a test output that the object collection frmPT does have 2 sets of coordinates , so the issue lies with the method used to place the leader. I am struggling to find any reason why it would have stopped working after the update to 2025

0 Likes
Message 5 of 5

micahstearns
Participant
Participant
Accepted solution

I have found the solution to the issue. It has to do with the .Net change that was made from 2024 to 2025. the invApp variable needed to be replaced with the following

'Dim invApp As Inventor.Application (Replaced variable)
Dim TransGeo As TransientGeometry '(new code)
Dim TransObj As TransientObjects '(new Code)
TransGeo = ThisApplication.TransientGeometry '(new code)
TransObj = ThisApplication.TransientObjects '(new code)

'invApp = GetObject("","Inventor.Application") (removed line of code)

'frmPT = invApp.TransientObjects.CreateObjectCollection (Replaced line of code)
'frmPT.Add(invApp.TransientGeometry.CreatePoint2d(frmMK.Position.X - 0.75, frmMK.Position.Y - 1.25)) (Replaced line of code)

frmPT = TransObj.CreateObjectCollection '(new code)
frmPT.Add(TransGeo.CreatePoint2d(frmMK.Position.X - 0.75, frmMK.Position.Y - 1.25)) '(new code)

 

0 Likes