Showing a Form based upon Null or empty string property

Showing a Form based upon Null or empty string property

jeremiah_boe
Contributor Contributor
1,484 Views
3 Replies
Message 1 of 4

Showing a Form based upon Null or empty string property

jeremiah_boe
Contributor
Contributor

I am attempting to show a form only when the property fields are in an empty string or null state. I am stumbling on the "Date" fields accepting null state. I have attached the code that I have assembled thus far, my error comes from the "creation Date" line.

If ThisDoc.Document Is ThisApplication.ActiveDocument  AndAlso 
	iProperties.Value("Summary", "Title") = "" Or
	iProperties.Value("Summary", "Author") = "" Or
	iProperties.Value("Project", "Designer") = "" Or
	iProperties.Value("Project", "Creation Date") = Null Or
	iProperties.Value("Custom", "Drawing Number") = "" Then
	
		iLogicForm.Show("Model iProperties")
End If
0 Likes
Accepted solutions (2)
1,485 Views
3 Replies
Replies (3)
Message 2 of 4

mcgyvr
Consultant
Consultant
Accepted solution

On my system null is not possible and instead the value when the check box is unchecked is..

So check for this as your trigger

iProperties.Value("Project", "Creation Date") = "1/1/1601"


-------------------------------------------------------------------------------------------
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 3 of 4

Curtis_Waguespack
Consultant
Consultant

Hi @jeremiah_boe,

 

see this related thread from the past:

https://forums.autodesk.com/t5/inventor-customization/how-to-null-all-iproperties-with-ilogic/td-p/6...

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

Message 4 of 4

NachoShaw
Advisor
Advisor
Accepted solution
I would also trim the values to remove any rogue spaces.

TRIM(Value)

For strings, I prefer String.Empty over ""

N ACHO

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.