Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot suppress pattern element using ilogic

33 REPLIES 33
SOLVED
Reply
Message 1 of 34
Olgan
7469 Views, 33 Replies

Cannot suppress pattern element using ilogic

I'm trying to use ilogic to suppress some individual elements of a pattern but i couldnt find any command that can target component pattern elements. When i try to capture its current state with the right click menu it does nothing.

I can of course suppress the part within the element but then it doesn't update the BOM.

 

Any comment or suggestion is appreciated

33 REPLIES 33
Message 21 of 34
Anonymous
in reply to: mrattray

SUCCESS! Smiley Very Happy

 

Thanks very much Mike.

 

Hopefully this all will be useful to others in the future. If only the others at my work knew what went in to switching on and off this freakin' bracket!

 

-Kyle

Message 22 of 34
Anonymous
in reply to: Anonymous

Hi!

 

I'm using this code, and it works like a charm!

 

in some cases i suppress some parts in element 1. Is it possible to make a rule which suppresses the same parts in element 2, 3, etc when the part is suppressed in elemnt 1?

Message 23 of 34
mrattray
in reply to: Anonymous

I have a hot job right now, but try playing around with the attached code (ignore the "do not change" comments, those are for my co-workers) and see what it does for you. I can come back later and write something specifically tailored to your situation if you need it.

 

By the way, you shouldn't post a reply in an old thread posing a new question. It makes it harder for other forum users to find answers through the search function. Instead, you should have created a new thread with a link referencing back to this thread.

Mike (not Matt) Rattray

Message 24 of 34
Anonymous
in reply to: mrattray

To be honest, this code is way beyond my knowledge in programing and iLogic. Is there any books you can recommend, like iLogic for dummies or something? 🙂

Message 25 of 34
mrattray
in reply to: Anonymous

Are you familiar with level of detail reps? I think your problem may be related to your patterned sub-assemblies toggling from your custom LOD to the master LOD, which happens when you work with parts lists. If this is the case, the code I posted in the last reply should help you as is. Try adding it as a rule and see what it does for you. Just edit the LODname = "Custom" line to whatever name you're setting your LODs to (or don't).

I keep this rule in the root of my project's work directory and call it as an external rule in my assembly template.

Mike (not Matt) Rattray

Message 26 of 34
Anonymous
in reply to: mrattray

Yes, I`m familiar with LOD.

 

All the sub assemblies are in a LevelofDetail01, so this is working. I tried your code, and it only sets the lod to custom, which in my case doesn`t change anything.

 

The photos of my problem is attached.

 

My assembly consists of vertical posts which are lined up next to each other with a center distance. There is a total of 20 posts, and I have a parameter which is called No_of_posts. If i set no of post to 16, it will suppress 4 posts etc. The rails are connected to each post. If I have 15 posts, there will be 14 rails. The rails is suppressd automatically depending on the number of posts. So the rails which should be copied into a pattern is ready. I set the post to a maximum of 20 posts, then all the rails which should be copied is active. I make a pattern with a total of 9 rails. By using the code Curtis supplied, I have a parameter called "Number_of_rails". When I enter 3 rails, the other 6 is suppressed.

 

Now, when the number of posts change, the number of rails will also change. If I for instance set no of post to 15, the rails which shouldnt be there is suppressed in element 1, but not in the other elements.

 

Hopefully my explanation was good enough 🙂

 

Edited by
Discussion_Admin

Message 27 of 34
Anonymous
in reply to: Anonymous

I just realised. If No of rails is set to 1, then I make all the changes to the model, ie set number of posts, distances etc, and then set no of rails , the pattern will be correct. so it looks like all that is needed is to update the pattern. Anyone got a code for this? 🙂

Message 28 of 34
mrattray
in reply to: Anonymous

Does simply updating the model using the update button work?

Mike (not Matt) Rattray

Message 29 of 34
Anonymous
in reply to: mrattray

No. My guess is that the pattern does not realise that the pattern has changed, so in the Inventors understanding there is nothing that needs to be updated.

Message 30 of 34
mrattray
in reply to: Anonymous

Can you post the actual model files?

Mike (not Matt) Rattray

Message 31 of 34
Anonymous
in reply to: mrattray

No,sorry, I can`t. This is an unfinished product 😕

Message 32 of 34
mrattray
in reply to: Anonymous

The theory that "the pattern doesn't know it changed" doesn't make any sense. I've used iLogic to control patterned sub assemblies dozens of times and have never had this problem. Something isn't working the way it should, and I don't know how I can help you diagnose it without being able to look at your models. Can you at least post the code you're using?

Mike (not Matt) Rattray

Message 33 of 34
Anonymous
in reply to: mrattray

Im trying to change the level of detail depending on a parameter, is this possible? The code I`ve tried so far (without luck):

 

Dim oAsmCompDef As ComponentDefinition
Dim oLOD As LevelOfDetailRepresentation
Dim LODname As String
doc = ThisDoc.Document

LODname = "2 Posts"

If Antall_poster = 2 Then
Try
oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item(LODname)
oLOD.Activate(True)
Catch
End Try
End If

I dont understand why this does not work?

Message 34 of 34
Anonymous
in reply to: Curtis_Waguespack

 

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

Post to forums  

Autodesk Design & Make Report