Updating Drawing Properties before Publishing

Updating Drawing Properties before Publishing

tcoley95E9Z
Enthusiast Enthusiast
227 Views
3 Replies
Message 1 of 4

Updating Drawing Properties before Publishing

tcoley95E9Z
Enthusiast
Enthusiast

I am working on a program that will give me prompts (day, month, year) to update my drawing properties and then publish right after. The part I'm struggling on is verifying the user input is in the correct format (MM.DD.YYYY) and then publishing once it has been verified. This is what I have so far:

 

 

(defun c:dProps (/ mmIn ddIn yyIn dateVal const)
  
  (setq mmIn (getstring "\n Enter Month: ")) ;Input Month
  (setq ddIn (getstring "\n Enter Day: ")) ;Input Day
  (setq yyIn (getstring "\n Enter Year: ")) ;Input Year

  (setq dateVal (strcat mmIn "." ddIn "." yyin))
  
  (prompt dateVal)
  
  (setq const 0)
  
  (cond 
    
      (( /= (setq mmLen (strlen mmIn)) 2 )  (prompt "\n Incorrect Month. ") )
      (( /= (setq ddLen (strlen ddIn)) 2 )  (prompt "\n Incorrect Day. ") )
      (( /= (setq ddLen (strlen yyIn)) 4 )  (prompt "\n Incorrect Year. ") )
    
      (T setq const 1)     
  ) d
  
  (while 
  ;; THE PART IM STRUGGLING WITH. I WANT A FOR/WHILE LOOP WHERE 'const' IS SET  ;;TO '1'.
  )
0 Likes
228 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor

You can create a dialog box that shows drop-down lists for selection then you know for sure you’re getting the results you want 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 4

hak_vz
Advisor
Advisor

@tcoley95E9Z wrote:

 

 The part I'm struggling on is verifying the user input is in the correct format (MM.DD.YYYY) and then publishing once it has been verified. This is what I have so far:

If in your code you don't need to have an option to use some antedate than use systems date variable conversion.

 

(defun getCurrentDate ( / today year month day)
	(setq 
		today (rtos (getvar 'CDATE) 2 6)
		year (substr today 1 4)
		month (substr today 5 2)
		day   (substr today 7 2)
		mydate (strcat month "." day "." year)
	)
)
(defun c:getCurrentDate nil (princ (strcat "\nCurrent date is: " (getCurrentDate))) (princ))

 

 

 

Miljenko Hatlak

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.
0 Likes
Message 4 of 4

Sea-Haven
Mentor
Mentor

We had a "plot stamp" in the title block that was current date in small print so could check versions published. 

0 Likes