Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

controlling which component level of detail is used in an assembly

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
252 Views, 2 Replies

controlling which component level of detail is used in an assembly

Hi,

I have an assembly that has been working well for several years but recently has been acting strangely

 

I have a top level assembly which has a custom level of detail. 

This has several sub assemblies all of which have their own custom level of detail.

Now for some, but not all (and only occassionally) of these sub assemblies i am seeing this.

 

I have this ilogic code to toggle the sub-assembly status

 

if x1_ct_location = 0 then
Component.IsActive("x1_cts_mount_on_cover_underside") = False
elseif x1_ct_location = 1 then
Component.IsActive("x1_cts_mount_on_cover_underside") = True

end if

 

Most of the time when set to True the sub-assembly is in the custom level of detail

However on rare occasions it is in the master level of detail.

 

I know i can change my  code to use 

Component.IsActive("x1_cts_mount_on_cover_underside<custom level of detail>")

but that does not explain why this happens only sometimes and only certain subassemblies

2 REPLIES 2
Message 2 of 3
JaneFan
in reply to: Anonymous

Hello There,

 

It is hard to tell the exact reason on what is happening there without a model. I want to know:

 

1. Is the issue gone after you changing your code to the line you mentioned:

Component.IsActive("x1_cts_mount_on_cover_underside<custom level of detail>")

 

2. Is x1_ct_location defined with default value and it always has a value assigned, either 0 or 1? How about changing the third line to simple 'Else'?

if x1_ct_location = 0 then
Component.IsActive("x1_cts_mount_on_cover_underside") = False
else
Component.IsActive("x1_cts_mount_on_cover_underside") = True

end if




Jane Fan
Inventor QA Engineer
Message 3 of 3
Anonymous
in reply to: JaneFan

Hi, and thanks for the reply

 

To answer your questions.

It is not really practical to post the model. It is very large and uses library components. I would create a simplified version, however since the behaviour is so unpredictable it is difficult to know if i have captured it.

 

1) Not really sure, again since this problem only occurs now and then its difficult to say that this fixed the problem.

2) No x1_ct_location can be one of three values hence the reason for ElseIf

I had simplified the code a little for posting here.

 

I think the real question is 

If the top level and sub assembly has a custom level of detail how does inventor "know" which LOD to use for the sub assembly?

I always thought if it was initially assembled using the custom LOD then inventor would "remember" that.

It seems that Inventor "forgets" which LOD to use sometimes.

I have other sub assemblies which are always active (never suppressed). Sometimes these come in with the wrong LOD also.

 

As i stated before this all worked flawlessly before

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report