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: 

iLogic code not functioning correctly

16 REPLIES 16
Reply
Message 1 of 17
Breeze104
530 Views, 16 Replies

iLogic code not functioning correctly

The problem is that for some reason the bolts constraints are not suppressing.  It is simple on/off code but for some reason I am still getting constraint and component errors.

 

Had to add " " to get code to post...I don't actually have them in my code. 

 

Here is the code:

 

 

"If HopperType = "10TADL" Or HopperType = "12BH" Or HopperType = "12TAD" Then

Component.IsActive("Component Pattern 1:1") = True

Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:1") = True

Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:2") = True

Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True

Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True

 

Constraint.IsActive("Insert:1") = True

Constraint.IsActive("Mate:80") = True

Constraint.IsActive("Mate:78") = True

 

 

ElseIf HopperType <> "10TADL" Or HopperType <> "12BH" Or HopperType <> "12TAD" Then

Component.IsActive("Component Pattern 1:1") = False

Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:1") = False

Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:2") = False

 

Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = False

Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = False

 

Constraint.IsActive("Insert:1") = False

Constraint.IsActive("Mate:80") = False

Constraint.IsActive("Mate:78") = False

 

 

End If"

 

 

16 REPLIES 16
Message 2 of 17
Ktelang
in reply to: Breeze104

As you are getting your bolts and nuts suppressed

I assume you have a custom level of representation

Please find the attached simulated condition the suppression condition is something

different : open model Bolted and unsuppress the connections

I have modeled 1 bolted connection and other place from content center at the same location

And then run the rules  

 

Else please share the sample file

------------------------------------------------------------------------------
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
-----------------------------------------------------------------------------
Message 3 of 17
swordmaster
in reply to: Breeze104

If you are simply trying to suppress your hardware there is no need to suppress the constraints

try "commenting out" those lines and run the rules again

Similarly there is no need to suppress each instance of your pattern

Inventor 2010 Certified Professional
Message 4 of 17
Breeze104
in reply to: swordmaster

That is the problem I originally did just suppress the component pattern, but it still thru constraint errors eventhough they should have been shut off in all hopper types except those three listed.

Message 5 of 17
Breeze104
in reply to: Breeze104

Even coding it like this...the Component Pattern 1:1 is still active and giving error in Design Doctor.

 

 

If HopperType = "10TADL" Then
Component.IsActive("Component Pattern 1:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True

 

ElseIf HopperType = "12BH" Then
Component.IsActive("Component Pattern 1:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True

 

ElseIf HopperType = "12TAD" Then
Component.IsActive("Component Pattern 1:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True


Else
Component.IsActive("Component Pattern 1:1") = False
Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = False
Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = False

 

End If

Message 6 of 17
Breeze104
in reply to: Breeze104

I wanted to give a quick thanks to ya'all for your help so far...

Eventhough it has solved the issue, I was able to go though all the other rules and really thin them down....THANKS

Message 7 of 17
Breeze104
in reply to: Breeze104

After using the form I created and switching hopper types I am finding out that the other hopper types that are suppsed to have the nuts and bolts in them aren't correct either.

 

What is happening is that the nuts and bolts are active but the constraints to put them in place are not activating, so they end up where ever on the end plate of the hopper.

 

See Pic : http://screencast.com/t/c9SHhdJL

Message 8 of 17
Breeze104
in reply to: Breeze104

Seems my typing skills need some help...

 


@Anonymous wrote:

I wanted to give a quick thanks to ya'all for your help so far...

Eventhough it has solved the issue, I was able to go though all the other rules and really thin them down....THANKS


Was suppsed to read "Eventhough it hasn't solved the issue......"

 

Sorry about that

Message 9 of 17
Breeze104
in reply to: Breeze104

One other thing I have noticed looking over things.....is that if I right click on Component  Patteren 1:1 is shows a check mark by "Suppressed", but for some reason it is throwing the "Component Pattern failure" error in Design Doctor.

Message 10 of 17
swordmaster
in reply to: Breeze104

Ok,

I made a small test to show how this pattern suppression works.

This code suppresses  the pattern named "my_pattern" and all of the instances of that pattern.

Based on the value of the parameter "my_configuration"

It does not to "touch" the constraints........these are still needed

 

trigger

= iTrigger0

if

my_configuration = 0 then

Component.IsActive

("my_pattern") = False

else

Component.IsActive

("my_pattern") = True

end if

iLogicVb.UpdateWhenDone

= True

 

 

Inventor 2010 Certified Professional
Message 11 of 17
Breeze104
in reply to: swordmaster

Why did u add the trigger?

 

So you are saying that I need to shut off the constraints as well?

Message 12 of 17
swordmaster
in reply to: Breeze104

The trigger is optional

What i am trying to show you is the code required to suppress a pattern without generating any errors.

If you are using similar code and getting errors then the problem is not with the code

Inventor 2010 Certified Professional
Message 13 of 17
Breeze104
in reply to: swordmaster

This is how the code stands currently... Had to turn constraints on & off cuz they wouldn't turn on/off just by turning Component Pattern on & off.

 

And since I am still getting the issue do you have any ideas as to why?

 

 

iProperties.Value("Project", "Project") = HopperType
InventorVb.DocumentUpdate(True)

 

If HopperType = "10TADL" Or HopperType = "12BH" Or HopperType = "12TAD" Then
Component.IsActive("Component Pattern 1:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True
Constraint.IsActive("Mate:78") = True
Constraint.IsActive("Mate:80") = True
Constraint.IsActive("Insert:1") = True

 

Else
Component.IsActive("Component Pattern 1:1") = False
Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = False
Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = False
Constraint.IsActive("Mate:78") = False
Constraint.IsActive("Mate:80") = False
Constraint.IsActive("Insert:1") = False

 

End If

Parameter.UpdateAfterChange = True

Message 14 of 17
Breeze104
in reply to: Breeze104

I really need to get this figured out because I still have about 40 more nuts and bolts to add to the assembly before it is all over...LOL

 

Message 15 of 17
swordmaster
in reply to: Breeze104

forget your ilogic code for a moment.

If you suppress a pattern manually do you need to suppress the constraints also? (the answer is no)

You should not need to suppress any constraints with your code. If you get error messages when you do not then i think this is a problem with the constraints in the model

Difficult to where exactly without having the model

Inventor 2010 Certified Professional
Message 16 of 17
Breeze104
in reply to: swordmaster

Well I am going to send in a ticket to Autodesk and see what I get back.  I will try to remember to post the answer.

 

Message 17 of 17
Breeze104
in reply to: Breeze104

Here is the answer I got from Autodesk...

 

"You won’t have any issues with mates in design accelerator components like bolted connections because it uses iMates – see attached video. The issue comes when you are suppressing a hole on one of the parts involved in the bolted connection – it will go from using an iMate to a normal (non-design accelerator-induced) constraint and then the constraint would have to be part of the rule too. Once, the hole is gone or the bolted connection has been made from a pre-existing hole and it’s been suppressed similarly in the part, the bolted connection intelligence is taken out of that hole in the assembly and a normal constraint, rather than an iMate is used and this constraint has to be also suppressed in the rule."

 

 

Here is a link to where you can get videos...you will have to download them.

 

 

http://www.screencast.com/t/ceOtjrYsift8

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

Post to forums  

Autodesk Design & Make Report