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: 

ilogic to count features

22 REPLIES 22
SOLVED
Reply
Message 1 of 23
jletcher
3436 Views, 22 Replies

ilogic to count features

I have 8 holes each a single feature is there a way for ilogic to count the active ones even if they change to inactive without a ten mile long code?

 

 

Hole 1  true

Hole 2 true

Hole 3 true

Hole 4 False

Hole 5 False

Hole 6 False

Hole 7 true

Hole 8 true

 

Count should be 5

 

If I change to

 

Hole 1  true

Hole 2 true

Hole 3 true

Hole 4 False

Hole 5 true

Hole 6 False

Hole 7 true

Hole 8 true

 

Count should be 6

 

 

Hole 1  False

Hole 2 False

Hole 3 False

Hole 4 False

Hole 5 true

Hole 6 False

Hole 7 true

Hole 8 true

 

Count should be 3

 

Can this be done with short code?

 

Many Thanks

 

22 REPLIES 22
Message 21 of 23
thomaskennedy
in reply to: kmiller

Hmm.. The error was on line 64, which was the 'For Each' line (I actually recopied the exact same code in and it worked fine, which is why I think something went wrong when doing the initial copy / paste)

 

You don't need an End If when using the IF statement on one line - I like to do my simpler IF statements like this because it makes for much cleaner code.

 

Cheers,

Tom

Message 22 of 23
kmiller
in reply to: thomaskennedy

Sounds good,

Probably my mistake then.

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
Message 23 of 23
kmiller
in reply to: thomaskennedy

Sounds good, Probably my mistake then. KATIE MILLER | CAD Coordinator ARCHITECTURAL DIVISION | COLD SPRING GRANITE 17482 Granite West Road | Cold Spring, MN 56320-4578 P: 320.685.3621 | 😧 320.685.4730 | F: 320.685.5052 http://www.coldspringgranite.com | kmiller@coldspringgranite.com Follow us on Twitter | Facebook This communication is intended only for the recipient(s) named above, may be confidential and/or legally privileged, and must be treated as such in accordance with state and federal laws. If you are not the intended recipient, you are hereby notified that any use of this communication, or any of its contents, is prohibited. If you have received this communication in error, please return it to the sender and delete the message from your computer system.
-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".

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

Post to forums  

Autodesk Design & Make Report