Jump to content

Recommended Posts

Posted

Hello folks, I have been lurking this forum for a long time and now i need some help.

 

Im trying to make a dcl where are some basic preset values. User can change them.

Later these values will be used for calculation.

 

This lisp works in AutoCAD2002 and is part of a much bigger lisp. Some of them i cant post.

 

 

This is what i got (part) but i just cant get the values with get_tile.

Gives me errors of type. or nil.

 

DCL:

 

:boxed_column {

label="Safety region 2 parameters";

 

 

:column {

:row {

:edit_box {

label="Korkeus 1 alle:";

key="PAAA1";

edit_width=15;

allow_accept = true;

}

:edit_box {

label="offset 1 on:";

key="PAAA2";

edit_width=15;

allow_accept = true;

}

}

}

 

 

:column {

 

:row {

:edit_box {

label="Korkeus 2 alle:";

key="PAAA3";

edit_width=15;

allow_accept = true;

}

:edit_box {

label="offset 2 on:";

key="PAAA4";

edit_width=15;

allow_accept = true;

}

}

}

 

:column {

 

:row {

:edit_box {

label="Korkeus 3 YLI:";

key="PAAA5";

edit_width=10;

allow_accept = true;

}

:edit_box {

label="offset 3 on:";

key="PAAA6";

edit_width=10;

allow_accept = true;

}

:edit_box {

label="Kerroin:";

key="PAAA7";

edit_width=10;

allow_accept = true;

}

}

}

 

 

 

and the lisp: (part of the lisp its huge) 8setting the dialog parameters)

 

(defun setit (mode / lista page)

(cond

((= mode 1)

(setq lista (list "PROD01" "PROD02" "PROD03"

"PROD04" "PROD041" "PROD05"

"PROD06" "PROD061" "PROD07"

"PROD08" "PROD09"

)

)

)

 

((= mode 2)

(setq lista (list "PROD03" "PROD05" "PROD09"))

)

)

(foreach page pagelist

(set_tile page "0")

)

(foreach page lista

(set_tile page "1")

)

)

 

 

 

;;dialogin alustus

(if series

(set_tile "SERIES" (strcase series))

(set_tile "SERIES" "Finno")

)

(setq p11 10)

(set_tile "PAAA1" (rtos P11 2 2))

(setq p12 0)

(set_tile "PAAA2" (rtos P12 2 2))

(setq p13 1500)

(set_tile "PAAA3" (rtos P13 2 2))

(setq p14 1500)

(set_tile "PAAA4" (rtos P14 2 2))

(setq p15 1500)

(set_tile "PAAA5" (rtos P15 2 2))

(setq p16 2500)

(set_tile "PAAA6" (rtos P16 2 2))

(setq p17 0.6667)

(set_tile "PAAA7" (rtos P17 2 2))

 

 

(if project

(set_tile "PROJECT" project)

)

 

(setit 1)

 

(set_tile "PROD05" "1")

(set_tile "UPDATE" "0")

(action_tile "accept" "(setq pagelist (prodok pagelist))")

(action_tile "cancel" "(exit)")

;;(action_tile "ALL" "(tilemode pagelist \"1\")")

(action_tile "NONE" "(tilemode pagelist \"0\")")

(action_tile "INS" "(setit 1)")

(action_tile "PROD" "(setit 2)")

 

 

;;Dialogi valmis käynnistettäväksi

(start_dialog)

(unload_dialog dcl_id)

(list project

(if series

(strcase series)

""

)

pagelist

update

)

)

 

 

Calculation in LISP: (all other variables are ok, only get_tile is the problem)

 

(setq PUUU1 (atof (get_tile "PAAA1")))

(setq PUUU2 (atof (get_tile "PAAA2")))

(setq PUUU3 (atof (get_tile "PAAA3")))

(setq PUUU4 (atof (get_tile "PAAA4")))

(setq PUUU5 (atof (get_tile "PAAA5")))

(setq PUUU6 (atof (get_tile "PAAA6")))

(setq PUUU7 (atof (get_tile "PAAA7")))

 

 

 

 

(setq lc_offset2 (min (if (

PUUU2

(if (

PUUU4

(+ PUUU5 (* PUUU7 (- korkeus2 PUUU5)))

)

)

PUUU6

)

)

 

No Matter what i do, i get error:

; error: bad argument type: stringp nil

 

 

Can someone guide me please?

 

BR. Eetu

Posted

I did also try the Value function in dcl box. Gave the values in there and used just the (setq PUUU1 (atof (get_tile "PAAA1")))

 

Still get the same error. all other values in the lisp are defined and working fine.

If i use number in the calculation and not the variables PUUU1 ... the lisp works fine.

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...