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?
Solved! Go to Solution.
Solved by mcgyvr. Go to Solution.
Solved by Lewis.Young. Go to 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
= equals
<> not equal to
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.
Can't find what you're looking for? Ask the community or share your knowledge.