iLogic: Is not equal to

iLogic: Is not equal to

Anonymous
Not applicable
6,265 Views
4 Replies
Message 1 of 5

iLogic: Is not equal to

Anonymous
Not applicable

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?

0 Likes
Accepted solutions (2)
6,266 Views
4 Replies
Replies (4)
Message 2 of 5

Lewis.Young
Collaborator
Collaborator
Accepted solution

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
Consultant
Consultant
Accepted solution

= 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
Not applicable

this worked perfectly! thanks

0 Likes
Message 5 of 5

SER4
Collaborator
Collaborator

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.

P.Eng. Mechanical Engineer
Dell Precision 5680 Laptop; Win11 Pro; 64GB RAM; i9-13900H CPU; Intel Iris Xe Graphics, NVIDIA RTX 3500 Ada Laptop GPU.
Vault Pro 2025.1 (30.1.63.0); Inventor Pro 2025.1.1 (241).