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: Is not equal to

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
5234 Views, 4 Replies

iLogic: Is not equal to

attempting to run ilogic code if a certain cell value i am pulling from is not equal to something - how would i do this?

 

this is what i tried:

SyntaxEditor Code Snippet

Attach = GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "D3")
If Attach = Not("NONE") Constraint.IsActive("Mate:Attach") = True End If

but it returns with the error:  Conversion from string "NONE" to type 'Long' is not valid.

is not() the wrong code for this?

4 REPLIES 4
Message 2 of 5
Lewis.Young
in reply to: Anonymous

Hello,

 

Try this:

 

SyntaxEditor Code Snippet

Attach = GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "D3")
If Not Attach = ("NONE") 
    Constraint.IsActive("Mate:Attach") = True
End If

 

Lewis Young
Windows 7 x64 - 32GB Ram
Intel Xeon E5-1620 v2 @ 3.70GHz
nVidia Quadro M2000 - 4GB
Inventor Professional 2017.3
Vault Basic 2017

Message 3 of 5
mcgyvr
in reply to: Lewis.Young

= equals

<> not equal to

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/comparison-operato...

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 4 of 5
Anonymous
in reply to: Lewis.Young

this worked perfectly! thanks

Message 5 of 5
SER4
in reply to: Anonymous

If you need a "neither nor" aka a "not or", use this setup:

If Not (ThisApplication.ActiveDocumentType = kPartDocumentObject Or ThisApplication.ActiveDocumentType = kAssemblyDocumentObject) Then

I.e. if you need to check that something is NOT within a set of things; use the Not out front, then in brackets put the various equals expressions.

Dell Precision 5680 Laptop; Win11 Pro; 64GB RAM; i9-13900H CPU; Intel Iris Xe Graphics, NVIDIA RTX 3500 Ada Laptop GPU.
Vault Pro 2025 (30.0.91.0); Inventor Pro 2025.0.1 (162).

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report