Author Topic: New Challenge for you Code heads...  (Read 9204 times)

0 Members and 1 Guest are viewing this topic.

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #15 on: May 17, 2007, 10:23:43 AM »
yes it should rotate the whole thing. I will download this and check it out

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #16 on: May 17, 2007, 03:40:37 PM »
WoW! Works great. After talking with some guys here and going over "design" Standards....They dont want to give people the oppertunity to input the wrong multiplier....so they asked me to add radio buttons for the "standard" options but leave an "other" feature so that if there is an oddball we can still use it.

Some changes that were made.

I added it to the DCL file and added/updated these keys

Code: [Select]
gvaothr1     - radio button for user defined input - talks to min100   [color=red](new)[/color]
gvaothr2     - radio button for user defined input - talks to max100   [color=red](new)[/color]
gvaothr3 - radio button for user defined input - talks to ang100   [color=red](new)[/color]
gva1 - radio button for minimum multiplier - default too 1.125   [color=red](new)[/color]
gva4 - radio button for maximum multiplier - default too 4   [color=red](new)[/color]
gva6 - radio button for maximum multiplier - default too 6   [color=red](new)[/color]
gva8 - radio button for maximum multiplier - default too 8   [color=red](new)[/color]
gva60 - radio button for default angle of gva - default too 60 degrees   [color=red](new)[/color]

The calculation for the "mincirc" variable was changed to "min100 * ss100" (thats the multiplier times the screen width now instead of the height)

I wanted these new variables too work like a activation button...like they select the button and the the edit box becomes active, and what ever was entered in the edit box would then be considered the variable to be used in the drawing of the items.

Code: [Select]
gvaothr1
gvaothr2
gvaothr3

The buttons related too:

Code: [Select]
gva1
gva4
gva6
gva8

are for the radio buttons on the UI. These should be used to have default vaules instead of the user defined one. But the "gvaothr#" related buttons should still be availble to use of needed.

as in my last post, yes the rotation angle should just rotate the entire thing.

I cant thank you enought for your help here. Its is very appreciated.

I have uploaded the dcl and lsp files again.



T.Willey

  • Needs a day job
  • Posts: 5251
Re: New Challenge for you Code heads...
« Reply #17 on: May 17, 2007, 05:09:07 PM »
I don't have time today, and tonight I'm going out of town, so I won't be able to work on this until next week (if work allows).  Sorry.

Maybe someone else will jump in.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

lispman21

  • Guest
Re: New Challenge for you Code heads...
« Reply #18 on: May 18, 2007, 09:21:42 AM »
Try this code out it may be what you are looking for

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #19 on: May 18, 2007, 10:07:59 AM »
I don't have time today, and tonight I'm going out of town, so I won't be able to work on this until next week (if work allows).  Sorry.

Maybe someone else will jump in.

Thats cool, I appreciate all your help. I will keep working on it and see what happens. Hopefully you can get some time soon and we can finish it...its sooo close!!

I got a cubs sox game to go to at noon!

oh ya...Lispman21... I will check it out.

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #20 on: May 21, 2007, 12:29:43 PM »
Lispman21,

Yes it does grey it out untill it is checked, but if you select something else it stays active. When it is not selected it should go back to grey so there is no userinput in the edit box.

I will look more at it later I have some actual work on my desk right now :-)

Hope hear from you guys soon :-)


lispman21

  • Guest
Re: New Challenge for you Code heads...
« Reply #21 on: May 21, 2007, 03:16:24 PM »
This one should take care of the edit box staying ative when not selected.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: New Challenge for you Code heads...
« Reply #22 on: May 21, 2007, 03:39:51 PM »
Here is one that will rotate it per what you want.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #23 on: May 21, 2007, 05:35:58 PM »
sweet that worked great T.

Now the last thing is just to get the radio buttons to work correctly. I have been tring to get it too work but I just cant figure it out.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: New Challenge for you Code heads...
« Reply #24 on: May 21, 2007, 06:01:54 PM »
Here are the two files that work.  If not selected 'user defined' the edit boxes will be greyed out.  Any more mods you will have to do yourself.   :wink:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #25 on: May 22, 2007, 01:52:43 PM »
thanks for all the help T.

Although I am running circles here with these damn radio buttons.

I think I have to set up conditions for the buttons but it isnt working for me.

I have tried:

Code: [Select]
(defun get_userinput ()
  (setq cs100 (distof (get_tile "cs100")))
  (setq cs101 (distof (get_tile "cs101" )))
  (setq ss100 (distof (get_tile "ss100")))
  (setq ss101 (distof (get_tile "ss101")))
  (setq vp100 (distof (get_tile "vp100")))
  ;;(setq min100 (distof (get_tile "min100")))
  ;;(setq max100 (distof (get_tile "max100")))
  (setq gva1 (* 1 1.125))
  (setq gva4 (* 1 4))
  (setq gva6 (* 1 6))
  (setq gva8 (* 1 8))
  (setq gva60 (* 1 60))
  ;;(setq ang100 (* pi (/ (distof (get_tile "ang100")) 180)))
(done_dialog 1)
)

(defun get_radiobuttons ()
  (cond
    ((= gva60b "1") (setq ang100 (* pi (/ (gva60))) 180))
    ((= gvaothr3 "1") (setq ang100 (* pi (/ (distof (get_tile "ang100")) 180))))
    )
  (cond
    ((= gva1b "1") (setq minc (gva1)))
    ((= gvaothr1 "1") (setq minc (distof (get_tile "min100"))))
      )
  (cond
    ((= gva4b "1") (setq maxc (gva4)))
    ((= gva6b "1") (setq maxc (gva6)))
    ((= gva8b "1") (setq maxc (gva8)))
    ((= gvaothr2 "1") (setq maxc (distof (get_tile "min100"))))
      )
  )

(defun get_minmaxcirc ()
  (setq mincirc (* minc ss100))
  (setq maxcirc (* maxc ss101))
  )

and...

Code: [Select]
(defun get_radiobuttons ()
  (cond
    (if (= $value "gva60b") (setq ang100 (* pi (/ (gva60))) 180))
    (if (= $value "gvaothr3") (setq ang100 (* pi (/ (distof (get_tile "ang100")) 180))))
    )
  (cond
    (if (= $value "gva1b") (setq minc (gva1)))
    (if (= $value "gvaothr1") (setq minc (distof (get_tile "min100"))))
      )
  (cond
    (if (= $value "gva4b") (setq maxc (gva4)))
    (if (= $value "gva6b") (setq maxc (gva6)))
    (if (= $value "gva8b") (setq maxc (gva8)))
    (if (= $value "gvaothr2") (setq maxc (distof (get_tile "max100"))))
      )
  )

Neither have worked. Am I atleast on the right track for this???

T.Willey

  • Needs a day job
  • Posts: 5251
Re: New Challenge for you Code heads...
« Reply #26 on: May 22, 2007, 02:24:44 PM »
Did you notice that I had to change you dcl file a little?  I have to add a key value to the radio columns so that I could tell which radio was pressed.  This will help you get what you want, as it returns the key for the radio pressed.  Then you can check to see if it is user specified, and if so get the edit box instead of the on of the radio buttons.

Hope that helps.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #27 on: May 22, 2007, 03:02:42 PM »
Ya, I added

Code: [Select]
  (setq gvaothr1 (get_tile "gvaothr1")) 
  (setq gva1b (get_tile "gva1b"))
  (setq gvaothr2 (get_tile "gvaothr2"))
  (setq gva4b (get_tile "gva4b"))
  (setq gva6b (get_tile "gva6b"))
  (setq gva8b (get_tile "gva8b"))
  (setq gvaothr3 (get_tile "gvaothr3"))     
  (setq gva60b (get_tile "gva60b"))

and now each one will return a 1 or 0 based on which radio button is selected

So from there I came up with:

Code: [Select]
(defun get_userinput ()
  (setq cs100 (distof (get_tile "cs100")))
  (setq cs101 (distof (get_tile "cs101" )))
  (setq ss100 (distof (get_tile "ss100")))
  (setq ss101 (distof (get_tile "ss101")))
  (setq vp100 (distof (get_tile "vp100")))
;;  (setq min100 (distof (get_tile "min100")))
;;  (setq max100 (distof (get_tile "max100")))
  (setq gva1 (* 1 1.125))
  (setq gva4 (* 1 4))
  (setq gva6 (* 1 6))
  (setq gva8 (* 1 8))
  (setq gva60 (* 1 60))
  (setq gvaothr1 (get_tile "gvaothr1")) 
  (setq gva1b (get_tile "gva1b"))
  (setq gvaothr2 (get_tile "gvaothr2"))
  (setq gva4b (get_tile "gva4b"))
  (setq gva6b (get_tile "gva6b"))
  (setq gva8b (get_tile "gva8b"))
  (setq gvaothr3 (get_tile "gvaothr3"))     
  (setq gva60b (get_tile "gva60b"))
;;  (setq ang100 (* pi (/ (distof (get_tile "ang100")) 180)))
(done_dialog 1)
)

(defun get_radiobuttons ()
  (cond
    ((= gva1b "1") (setq minc (gva1)))
    ((= gvaothr1 "1") (setq minc (distof (get_tile "min100"))))
      )
  (cond
    ((= gva4b "1") (setq maxc (gva4)))
    ((= gva6b "1") (setq maxc (gva6)))
    ((= gva8b "1") (setq maxc (gva8)))
    ((= gvaothr2 "1") (setq maxc (distof (get_tile "min100"))))
      )
  (cond
    ((= gva60b "1") (setq ang100 (* pi (/ (gva60))) 180))
    ((= gvaothr3 "1") (setq ang100 (* pi (/ (distof (get_tile "ang100")) 180))))
    )
  )

(defun get_minmaxcirc ()
  (setq mincirc (* minc ss100))
  (setq maxcirc (* maxc ss101))
  )

I was hoping that with the condition set it would work but wont. There has too be somethign wrong with the code I just dont know what. Like I said I am not that good at this, but I am learning.


T.Willey

  • Needs a day job
  • Posts: 5251
Re: New Challenge for you Code heads...
« Reply #28 on: May 22, 2007, 03:24:04 PM »
A quick look.  Here
Code: [Select]
(defun get_radiobuttons ()
  (cond
    ((= gva1b "1") (setq minc (gva1)))
    ((= gvaothr1 "1") (setq minc (distof (get_tile "min100"))))
      )
  (cond
    ((= gva4b "1") (setq maxc (gva4)))
    ((= gva6b "1") (setq maxc (gva6)))
    ((= gva8b "1") (setq maxc (gva8)))
    ((= gvaothr2 "1") (setq maxc (distof (get_tile "min100"))))
      )
  (cond
    ((= gva60b "1") (setq ang100 (* pi (/ (gva60))) 180))
    ((= gvaothr3 "1") (setq ang100 (* pi (/ (distof (get_tile "ang100")) 180))))
    )
  )
You need to take the parens out that surround the 'gva#'.  They are variables not functions.  See if that gets you going.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

AVCAD

  • Guest
Re: New Challenge for you Code heads...
« Reply #29 on: May 22, 2007, 05:03:13 PM »
Ok so i took out the () like you said and I changed alittle bit of the code

Code: [Select]
(defun get_radiobuttons (minc maxc anggva)
  (cond
    ((= gvaothr1 1) (setq minc min100))
    ((= gva1b 1) (setq minc 1.125))
    )
  (cond
    ((= gvaothr2 1) (setq maxc max100))
    ((= gva4b 1) (setq maxc 4))
    ((= gva6b 1) (setq maxc 6))
    ((= gva8b 1) (setq maxc 8))
      )
  (cond
    ((= gvaothr3 1) (setq anggva ang100))   
    ((= gva60b 1) (setq anggva (* pi (/ 60)) 180))
      )
  )

(defun get_minmaxcirc ()
  (setq mincirc (* minc ss100))
  (setq maxcirc (* maxc ss101))
  )

instead of calling out a seperate variable i just called what that varible should be...1.125, 4, 6, 8, 60...

I changed the ang100 variable here to becalled anggva so that it could be called later.

Code: [Select]
  (cond
    ((= gvaothr3 1) (setq anggva ang100))   
    ((= gva60b 1) (setq anggva (* pi (/ 60)) 180))

I also made sure to change that call in

Code: [Select]
(DrawCircles mincirc maxcirc anggva InsPt (car ScList) (cadr ScList))
Yet still got no where....I must be missing something, cause anggva, minc, and maxc are all coming up nil when the program runs.

Should it not be a condition statement? maybe a If statement? if it is then I an lost cause i dont know the if statement code and I have looked online but there are no good examples I have found.