Jump to content

Recommended Posts

Posted

Good Day,

Please can you help my first post ....not to good in this field..

When changing on of the user inputs (userr*) insted of defaulting back to the input screen i get the argument error.

What im looking for is once the user input is changed it revises the userr* and returns to the default list.. only exit (5) will clear

Lisp

(defun C:isovars ()

(if (= (getvar "USERR1") 0) (setvar "USERR1" 1))

(if (= (getvar "USERR2") 0) (setvar "USERR2" 2))

(if (= (getvar "USERR3") 0) (setvar "USERR3" 3))

(terpri)

(terpri)

(textscr)

(princ)

(prompt "\n SYSTEM VARIABLES FOR THIS DRAWING SESSION ")

(prompt "\n-------------------------------------------")

(terpri)

(terpri)

;

(prompt "\n1. VALVE, ELBOW AND REDUCER SCALE FACTOR")

(terpri)

(setq v1 (getvar "userr1"))

(prompt (strcat " (i.e. Scale Factor of 1 = 20mm Fitting Size Weld to Weld (Valve)) " ": "))

(terpri)

;

(prompt "\n2. INSTRUMENTATION / SYMBOL SIZES")

(terpri)

(setq v2 (getvar "userr2"))

(prompt (strcat " (i.e. Scale Factor of 1 = 15mm Symbol Size) " ": "))

(terpri)

;

(setq v3 (getvar "userr3"))

(prompt (strcat "\n3. CIRCLE RADIUS (Bubbles) " " : "))

(terpri)

;

(terpri)

(setq v4 (getvar "textsize"))

(prompt (strcat "4. TEXT SIZE " ": "))

(terpri)

;

(terpri)

(prompt "5. EXIT - RETURN TO DRAWING ")

(terpri)

(terpri)

;

(initget "1 2 3 4 5")

(setq sel (getkword "\nEnter Selection: "))

(if (= sel "1") (progn

(initget +1 2 4)

(setq valvar (getreal "\nENTER NEW VALVE, ELBOW AND REDUCER SCALE FACTOR: "))

(setvar "userr1" valvar)

(princ)

(isovars)

))

(if (= sel "2") (progn

(initget (+ 1 2 4))

(setq nozvar (getreal "\nENTER NEW INSTRUMENTATION / SYMBOL SCALE FACTOR: "))

(setvar "userr2" nozvar)

(princ)

(isovars)

))

(if (= sel "3") (progn

(initget (+ 1 2 4))

(setq circlevar (getreal "\nENTER NEW CIRCLE RADIUS: "))

(setvar "userr3" circlevar)

(princ)

(isovars)

))

(if (= sel "4") (progn

(initget (+ 1 2 4))

(setq textvar (getreal "\nENTER NEW TEXT SIZE: "))

(setvar "textsize" textvar)

(princ)

(isovars)

))

(if (= sel "5") (progn

(graphscr)

(command nil)

))

)

 

 

Thanks

Posted
Good Day,

Please can you help my first post ....not to good in this field..

When changing on of the user inputs (userr*) insted of defaulting back to the input screen i get the argument error.

What im looking for is once the user input is changed it revises the userr* and returns to the default list.. only exit (5) will clear

Lisp

(defun C:isovars ()

(if (= (getvar "USERR1") 0) (setvar "USERR1" 1))

(if (= (getvar "USERR2") 0) (setvar "USERR2" 2))

(if (= (getvar "USERR3") 0) (setvar "USERR3" 3))

(terpri)

(terpri)

(textscr)

(princ)

(prompt "\n SYSTEM VARIABLES FOR THIS DRAWING SESSION ")

(prompt "\n-------------------------------------------")

(terpri)

(terpri)

;

(prompt "\n1. VALVE, ELBOW AND REDUCER SCALE FACTOR")

(terpri)

(setq v1 (getvar "userr1"))

(prompt (strcat " (i.e. Scale Factor of 1 = 20mm Fitting Size Weld to Weld (Valve)) " ": "))

(terpri)

;

(prompt "\n2. INSTRUMENTATION / SYMBOL SIZES")

(terpri)

(setq v2 (getvar "userr2"))

(prompt (strcat " (i.e. Scale Factor of 1 = 15mm Symbol Size) " ": "))

(terpri)

;

(setq v3 (getvar "userr3"))

(prompt (strcat "\n3. CIRCLE RADIUS (Bubbles) " " : "))

(terpri)

;

(terpri)

(setq v4 (getvar "textsize"))

(prompt (strcat "4. TEXT SIZE " ": "))

(terpri)

;

(terpri)

(prompt "5. EXIT - RETURN TO DRAWING ")

(terpri)

(terpri)

;

(initget "1 2 3 4 5")

(setq sel (getkword "\nEnter Selection: "))

(if (= sel "1") (progn

(initget +1 2 4)

(setq valvar (getreal "\nENTER NEW VALVE, ELBOW AND REDUCER SCALE FACTOR: "))

(setvar "userr1" valvar)

(princ)

(isovars)

))

(if (= sel "2") (progn

(initget (+ 1 2 4))

(setq nozvar (getreal "\nENTER NEW INSTRUMENTATION / SYMBOL SCALE FACTOR: "))

(setvar "userr2" nozvar)

(princ)

(isovars)

))

(if (= sel "3") (progn

(initget (+ 1 2 4))

(setq circlevar (getreal "\nENTER NEW CIRCLE RADIUS: "))

(setvar "userr3" circlevar)

(princ)

(isovars)

))

(if (= sel "4") (progn

(initget (+ 1 2 4))

(setq textvar (getreal "\nENTER NEW TEXT SIZE: "))

(setvar "textsize" textvar)

(princ)

(isovars)

))

(if (= sel "5") (progn

(graphscr)

(command nil)

))

)

 

 

Thanks

 

(isovars) replaced with (c:isovars) still error

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...