Inventor General

Reply
Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 1 of 17 (249 Views)

iLogic code not functioning correctly

249 Views, 16 Replies
02-08-2012 01:35 PM

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"

 

 



Valued Mentor
Ktelang
Posts: 287
Registered: ‎09-23-2010
Message 2 of 17 (242 Views)

Re: iLogic code not functioning correctly

02-08-2012 02:13 PM 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
-----------------------------------------------------------------------------
Distinguished Mentor
swordmaster
Posts: 537
Registered: ‎12-15-2008
Message 3 of 17 (233 Views)

Re: iLogic code not functioning correctly

02-08-2012 02:50 PM 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
Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 4 of 17 (222 Views)

Re: iLogic code not functioning correctly

02-09-2012 04:32 AM 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.

Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 5 of 17 (218 Views)

Re: iLogic code not functioning correctly

02-09-2012 05:23 AM 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

Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 6 of 17 (214 Views)

Re: iLogic code not functioning correctly

02-09-2012 05:49 AM 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

Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 7 of 17 (210 Views)

Re: iLogic code not functioning correctly

02-09-2012 06:03 AM 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

Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 8 of 17 (204 Views)

Re: iLogic code not functioning correctly

02-09-2012 06:31 AM in reply to: Breeze104

Seems my typing skills need some help...

 


Breeze104 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

Distinguished Contributor
Breeze104
Posts: 215
Registered: ‎01-17-2008
Message 9 of 17 (202 Views)

Re: iLogic code not functioning correctly

02-09-2012 06:46 AM 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.

Distinguished Mentor
swordmaster
Posts: 537
Registered: ‎12-15-2008
Message 10 of 17 (197 Views)

Re: iLogic code not functioning correctly

02-09-2012 07:20 AM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube