iLogic to control LoD in sub-assemblies

iLogic to control LoD in sub-assemblies

Anonymous
Not applicable
4,396 Views
25 Replies
Message 1 of 26

iLogic to control LoD in sub-assemblies

Anonymous
Not applicable

good morning All!

 

I've searched through the forum for an answer to this problem and found nothing I could use. I started "driving" my top level assembly (made up of sub assemblies) to control the length, height, width and style of my model.(in this case, the model is an alum. dump trailer. Everything was working fine until I began to place different model sides and another Tailgate model into the top level assembly to cover all the options. Now the problem occurs when I use the form to alter the models configuration for other options. What is happening is my sub assemblies (some, not all) revert to "Master" LoD which prevents the model from updating to the new configuration until I select the offending sub assembly and reset it to "Custom" LoD. So is there a way in my top level assembly iLogic rule to make sure all the sub assemblies including the ones I haven't placed ( I have 2 more side configurations for a total of 4 files yet to place) either stay at or reset to "Custom" LoD as I use the form to alter the models configuration?

   I have a couple of videos posted here as "screen casts" that show what I trying to do. I even recorded a peak at some of the iLogic code that drives the models.

   Thanks again for your time and assistance. Hope you all have a great day.

 

Frank

Inventor 2016

0 Likes
Accepted solutions (1)
4,397 Views
25 Replies
Replies (25)
Message 21 of 26

NSBowser
Advocate
Advocate

I'm not really sure where you were getting an issue with AssemblyDocument being declared (apart from a spelling error).

I have no problem running the following code. which lacks any reference to Sub Main... assuming the current doc IS an assembly

 

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisDoc.Document
MessageBox.Show(oAssyDoc.DisplayName)

Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Message 22 of 26

waynehelley
Collaborator
Collaborator

I get an error if I run the declaration in a script on its own, e.g... 

 

DocumentError.JPG

but then it runs fine once you include the next line pointing it towards 'ThisDoc.Document', e.g...

 

Dim test As Document
test = ThisDoc.Document

 

Very strange... My only explanation is that I think the keywords 'ThisDoc' and 'ThisApplication' act as a trigger for the Inventor API dll to be imported.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 23 of 26

Jef_E
Collaborator
Collaborator

@waynehelley wrote:

I get an error if I run the declaration in a script on its own, e.g... 

 

DocumentError.JPG

but then it runs fine once you include the next line pointing it towards 'ThisDoc.Document', e.g...

 

Dim test As Document
test = ThisDoc.Document

 

Very strange... My only explanation is that I think the keywords 'ThisDoc' and 'ThisApplication' act as a trigger for the Inventor API dll to be imported.


It's pointless to do a declaration and not using it. So there is no error when implementing this correctly like the second version. If you do this in Visual studio you also get a warning.



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
Message 24 of 26

waynehelley
Collaborator
Collaborator

I know its pointless but it shouldn't thrown an exception.  I was just trying to get to the bottom of why RobertLee was getting that error message.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 25 of 26

Anonymous
Not applicable

Thanks Wayne and Jeff.

 

The error makes perfect sense now.

0 Likes
Message 26 of 26

Anonymous
Not applicable

Awesome! It works for me.

 

Thank you!

0 Likes