2021.1 update has cause iLogic rules issues

2021.1 update has cause iLogic rules issues

Scott.Hallmark
Advocate Advocate
3,407 Views
19 Replies
Message 1 of 20

2021.1 update has cause iLogic rules issues

Scott.Hallmark
Advocate
Advocate

A form I have been using for over a year on 2019, 2020, and now 2021 has worked fine.  It has a lot of info in it but it opens in about 10 seconds.  After loading 2021.1 update today, it takes 60 seconds to open the form.  I am checking my code to see what is happening but nothing so far.  Has anyone else experienced this yet?

 

Also I am getting a new error from a rule that has not shown up before... "Public member 'ComponentDefinition' on type 'DrawingDocument' not found."

 

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
3,408 Views
19 Replies
Replies (19)
Message 2 of 20

Scott.Hallmark
Advocate
Advocate

I have the fix for the 2nd issue I listed but why it changed is beyond me.  I had to change 'ThisApplication.ActiveDocument' to 'ThisDoc.Document' and the error went away.  But I have to do that on every existing assembly I am working on because it is in a local rule.  Not good.

 

But ADSK, what changed that makes a form go from taking less that 10 seconds to open to 60 seconds?

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 3 of 20

ckeveryga
Advocate
Advocate

I cannot say as I do not have Inventor 2021, but from reading this forum it seems that they are changing iLogic to work like other languages (more strict). This is an improvement but it means that certain code that used to work no longer works. If you post your code, someone will likely be able to help. As for the error, component definition is only defined under model documents and component occurrences, that's why it's throwing an error. 

0 Likes
Message 4 of 20

Scott.Hallmark
Advocate
Advocate

I can understand that but why it is throwing the error now but not prior to the update is a mystery.

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
Message 5 of 20

rhasell
Advisor
Advisor

Hi

 

Following, as I have the same problem. It's only on the larger forms that take a long time to load.

 

What used to be a couple of seconds to load is now the same as you, 30 - 60 seconds to load a form.

 

Reg
2026.3
0 Likes
Message 6 of 20

Scott.Hallmark
Advocate
Advocate
yes, they have to address this ASAP. This is a time killer.
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 7 of 20

MjDeck
Autodesk
Autodesk

We know the cause of the slower form loading. We should be able to fix it soon. The issue number for it is INVGEN-43789.
About the ComponentDefinition on a DrawingDocument problem: is this a rule you were using before the 2021.1 update, and were you running it in exactly the same way and on the same documents? 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 8 of 20

Scott.Hallmark
Advocate
Advocate
Correct, no changes to the rule prior to or after the 2021.1 update, yet the error occurs every time now since loading the update.
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 9 of 20

MjDeck
Autodesk
Autodesk

Can you post the rule?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 10 of 20

Scott.Hallmark
Advocate
Advocate
Sub Main	
	Logger.Info ("** 2 - OccurrenceName Rule ** Main")
	'This code cycles thru all components checking to see if the Occurrence is renamed to the PartNumber.
	'If Not, it changes it by looking to see if the Occurrence starts with "-".

	'Defining oAsmCompDef for renaming occurrences
	Dim oAsmCompDef As AssemblyComponentDefinition
	oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

	'Sets the Top Level Assembly browser name to match the part number
	ThisDoc.Document.DisplayName = iProperties.Value("Project", "Part Number")

	'Iterate through all of the occurrences
	'If FilePrefix = "" Then
	Dim oOccurrence As ComponentOccurrence
	For Each oOccurrence In oAsmCompDef.Occurrences
	   	Dim oName As String 
	   	oName = oOccurrence.Name
		oName2 = Left(oName, 1)
		oName3 = Left(oName, 3)
		oName4 = Mid(oName, 4)
		If oName2 = "-" Then 
			oOccurrence.Name = FilePrefix & oName
		Else If oName3 <> FilePrefix And oName2 <> "A" And oName2 <> "M" And oName2 <> "R" And oName2 <> "S" Then
			oOccurrence.Name = FilePrefix & oName4
		End If
	Next

	iLogicForm.Show("UNIT CONFIG")
	'End If
End Sub
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 11 of 20

MjDeck
Autodesk
Autodesk

This is a rule in an assembly document, right? It's not an external rule?
Is it set to run on one or more events (in the Event Triggers dialog)?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 12 of 20

Scott.Hallmark
Advocate
Advocate
Correct - in an assembly. Not external. It renames the occurrences of each part to match the assembly's "unit number" or FilePrefix that is defined in another rule called NameUnit_Rule. The NameUnit_Rule runs this rule at the end.
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 13 of 20

Scott.Hallmark
Advocate
Advocate

Also the NameUnit_Rule is run on an "After Open Document" trigger.

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 14 of 20

MjDeck
Autodesk
Autodesk

When a drawing of an assembly is opened, Inventor can also open the assembly document itself. But it's opened "in the background", not in its own window.

Are you sure you want the rule to run under those conditions? If not, you can add a line at the top:

If ThisDoc.Document IsNot ThisApplication.ActiveEditDocument Then Return

That will make it so the rule will only run if the assembly is being edited in its own window, or as a subassembly  being edited in context.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 15 of 20

Scott.Hallmark
Advocate
Advocate
While I do appreciate the suggestion, which I will definitely incorporate in my template rules, this does not fix the problem with potentially over a few hundred active assemblies being worked on. We do unitized curtain wall so each window unit is its own assembly and dwg (running this local rule) comprised into a master assembly for cutlist purposes. So I would need to add that line to a few hundred assemblies in order to relieve the designer of seeing the error every time the dwg is opened.

What I do not understand is what changed in the update that now makes this error show up.
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 16 of 20

MjDeck
Autodesk
Autodesk

I don't know what changed. It seems to me that the same thing could have happened in 2021 and earlier releases.

Can you post a small sample assembly and drawing that demonstrates the problem?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 17 of 20

Scott.Hallmark
Advocate
Advocate
It did not happen before. In fact, I am the only one in my office that has the update loaded, and that is only because I loaded it first on Friday mid-morning, tested my templates and code and noticed the error. then instructed the others not to install the update yet. The other seats here are functioning fine with no update loaded. Mine, with 2021.1 update is throwing the error consistently now.

I have many proprietary items/rules in this template. I cannot post here publicly. I can send them to you directly to review, or I can make a screencast.
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 18 of 20

rhasell
Advisor
Advisor

Hi

 

Can you elaborate on the "ComponentDefinition" a lot of my rules contain this line.

 

I will check, but most of them have something similar to this one, which comes from the drawing environment.

' Set a reference to the assembly document.
' This assumes an assembly document is active.
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

' Set a reference to the BOM
Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM

 

If I read between the line of your thread, the important line should be present stating the Active document?

oDoc = ThisApplication.ActiveDocument

 

If needed, I can change all my rules, they are all external rules.

Thanks

 

Reg
2026.3
0 Likes
Message 19 of 20

MjDeck
Autodesk
Autodesk

@rhasell , I haven't seen a change of behavior moving from the 2021 release to 2021.1 as far as ThisApplication.ActiveDocument is concerned. I'm still looking at this question.

 

However, I would generally recommend using ThisDoc.Document rather than ThisApplication.ActiveDocument.


Mike Deck
Software Developer
Autodesk, Inc.

Message 20 of 20

rhasell
Advisor
Advisor

Thank you

 

Will do, all rules have been updated. (Thanks to Notepad++)

Reg
2026.3
0 Likes