Author Topic: Cursor Change  (Read 4197 times)

0 Members and 1 Guest are viewing this topic.

psuchewinner

  • Guest
Cursor Change
« on: October 11, 2005, 08:15:42 PM »
Can anyone tell me how to change the cursor to the "Paint Brush" (like it does for MatchProp) by using V-Lisp :lol:?

I know that somebody out there knows how..

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Cursor Change
« Reply #1 on: October 11, 2005, 08:59:48 PM »
I would but then I'd have to, well, you know.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Cursor Change
« Reply #2 on: October 12, 2005, 12:13:30 AM »
Hi Psuchewinner, did you see this discussion? It may give you some ideas.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

psuchewinner

  • Guest
Re: Cursor Change
« Reply #3 on: October 13, 2005, 09:33:44 AM »
Thanks, that works, sort of.  I can get the image to the screen but how can keep the intities from scaling during a zoom?  I fear that since this is GRDARW, this is not what I am looking for.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Cursor Change
« Reply #4 on: October 13, 2005, 10:18:40 AM »
I don't mean to be flippant but modify the code so the vectos are not scaled. Would you want help with that?

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

psuchewinner

  • Guest
Re: Cursor Change
« Reply #5 on: October 13, 2005, 10:28:59 AM »
Sure,  I took everything that I beleive deals with scaling but still scales when using the wheel on my mouse.  Maybe I am missing something.  Here is the modified code

Coding starts here::::::
(defun GrVectorsGetPoint ( vectors / *error* _drawVectors end result key val val2 )

    ;;  clean up the screen if
    ;;  the user bails via esc

    (defun *error* ( x )
        (redraw)
        (princ)
    )

    ;;  draw the vectors relative to the
    ;;  specifiedd point using xor ink

    (defun _drawVectors ( vectors point )
        (foreach vector
            (mapcar
               '(lambda (vector)
                    (mapcar
                       '(lambda (point2)
                            (mapcar '+ point point2)
                        )
                        vector
                    )
                )
                vectors
            )
            (grdraw
                (car vector)
                (cadr vector)
                -1
            )
        )
    )

    ;;  while the user cursors about dynamically redraw
    ;;  the vectors. When the user finally picks a point
    ;;  clear off the vectors and return the point picked.
    ;;  I've not written this to handle wonky ucs's etc,
    ;;  that's your job. :P

    (while (not end)
        (setq
            result (grread t 1 0)
            key    (car result)
            val    (cadr result)
        )
        (cond
            (   (eq 5 key)
                (cond
                    (   (null val2)
                        (setq val2 val)
                        (_drawVectors vectors val)
                    )
                    (   t
                        (redraw)
                        (_drawVectors vectors val)
                        (setq val2 val)
                    )
                )
            )
            (   (eq 3 key) (setq end t))
        )
    )

    ;;  clear the screen of any crap we
    ;;  drew that remains

    (redraw)

    ;;  return the selected point (if the
    ;;  user picked one) to the caller

    (if (eq 3 key) val)
)
    ;;  for this exercise let's make the graphic
    ;;  size relative to the screen height ...
(defun  c:Test1 ()
    (GrVectorsGetPoint
                   '(
              ((0.0156928 -0.0584586 0.0) (0.0592298 -0.0584586 0.0))
         ((0.0156928 -0.0728943 0.0) (0.0592298 -0.0728943 0.0))
         ((0.0302051 -0.0728943 0.0) (0.019628 -0.0909935 0.0))
         ((0.0447175 -0.0728943 0.0) (0.0341404 -0.0909935 0.0))
              ((0.0314743 -0.0476326 0.0) (0.0314743 -0.018049 0.0))
         ((0.0434483 -0.018049 0.0) (0.0434483 -0.0476326 0.0))
         ((0.0434483 -0.0476326 0.0) (0.0592298 -0.0476326 0.0))
         ((0.0592298 -0.0476326 0.0) (0.0592298 -0.0728943 0.0))
              ((0.0592298 -0.0728943 0.0) (0.0486527 -0.0909935 0.0))
         ((0.0486527 -0.0909935 0.0) (0.00511569 -0.0909935 0.0))
         ((0.00511569 -0.0909935 0.0) (0.0156928 -0.0728943 0.0))
         ((0.0156928 -0.0728943 0.0) (0.0156928 -0.0476326 0.0))
              ((0.0156928 -0.0476326 0.0) (0.0314743 -0.0476326 0.0))
         ((0.0156928 -0.0549598 0.0) (0.0592298 -0.0549598 0.0))
         ((0.0156928 -0.066987 0.0) (0.0592298 -0.066987 0.0))
         ((0.0156928 -0.0634882 0.0) (0.0592298 -0.0634882 0.0))
              ((0.0314743 -0.018049 0.0) (0.0434483 -0.018049 0.0))
         ((0.0157225 -0.0549563 0.0) (0.0592412 -0.0584523 0.0))
         ((0.0592412 -0.0584523 0.0) (0.0157225 -0.0584523 0.0))
         ((0.0157225 -0.0584523 0.0) (0.0157225 -0.0549563 0.0))
              ((0.0592412 -0.0584523 0.0) (0.0157225 -0.0584523 0.0))
         ((0.0157225 -0.0584523 0.0) (0.0157225 -0.0549563 0.0))
         ((0.0157225 -0.0549563 0.0) (0.0592412 -0.0584523 0.0))
         ((0.0157225 -0.0549563 0.0) (0.0592412 -0.0584523 0.0))
              ((0.0592412 -0.0584523 0.0) (0.0592412 -0.0549563 0.0))
         ((0.0592412 -0.0549563 0.0) (0.0157225 -0.0549563 0.0))
         ((0.0592412 -0.0584523 0.0) (0.0592412 -0.0549563 0.0))
         ((0.0592412 -0.0549563 0.0) (0.0157225 -0.0549563 0.0))
              ((0.0157225 -0.0549563 0.0) (0.0592412 -0.0584523 0.0))
         ((0.0157225 -0.0634867 0.0) (0.0592412 -0.0669826 0.0))
         ((0.0592412 -0.0669826 0.0) (0.0157225 -0.0669826 0.0))
         ((0.0157225 -0.0669826 0.0) (0.0157225 -0.0634867 0.0))
              ((0.0592412 -0.0669826 0.0) (0.0157225 -0.0669826 0.0))
         ((0.0157225 -0.0669826 0.0) (0.0157225 -0.0634867 0.0))
         ((0.0157225 -0.0634867 0.0) (0.0592412 -0.0669826 0.0))
         ((0.0157225 -0.0634867 0.0) (0.0592412 -0.0669826 0.0))
              ((0.0592412 -0.0669826 0.0) (0.0592412 -0.0634867 0.0))
         ((0.0592412 -0.0634867 0.0) (0.0157225 -0.0634867 0.0))
         ((0.0592412 -0.0669826 0.0) (0.0592412 -0.0634867 0.0))
         ((0.0592412 -0.0634867 0.0) (0.0157225 -0.0634867 0.0))
              ((0.0157225 -0.0634867 0.0) (0.0592412 -0.0669826 0.0))
            )
          )
    ;;  no final princ so you can see the coordinate returned
)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Cursor Change
« Reply #6 on: October 13, 2005, 10:33:25 AM »
I don't have time until lunch to look at this, but what you have to do is grab the viewsize when it starts and then scale the vectors accordingly when the viewsize changes. The way it is now, and sorry for misleading you the way I phrased my last post, the vectors are drawn absolute, that is, for example, a vector is drawn 100 units wide. Now if you zoom in 2x the vector is still drawn 100 units wide, but now sit eems twice as big, so it needs to be scaled accordingly. Note that this will slow things down a bit but if it's a nominal set of vectors, like that to replicate the copy properties thingie, it should be near instant.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

psuchewinner

  • Guest
Re: Cursor Change
« Reply #7 on: October 13, 2005, 11:39:11 AM »
Any help yyou could give will be most appreciated.  Could you provide some commenting to help me understand the scaling concept?  I can usuallly disect code to figure it out but I am confused about the "scale" value/funtion in the function "scalevectors".

BTW. What ever happened to the cadvault?  I cant seem to get to the "espresso code cafe'".  Has it been dismantled?

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Cursor Change
« Reply #8 on: October 13, 2005, 12:27:59 PM »
BTW. What ever happened to the cadvault? I cant seem to get to the "espresso code cafe'". Has it been dismantled?
Long story short, Yes
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Cursor Change
« Reply #9 on: October 13, 2005, 04:18:16 PM »
Here ya go, have fun.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

psuchewinner

  • Guest
Re: Cursor Change
« Reply #10 on: October 14, 2005, 05:56:16 AM »
Thanks alot! That is EXACTLY what I was after.  Thank you for your help.  You were the only one to step up and help.  I used to find a lot of helpful stuff in the cadvault but since it is gone, I guess I will be looking for you.  I usually do not aske for help, preferring to figure it out for myself but this time I was stumped.(  :realmad: )             Guess I will be dissecting today between tasks.    :-D  Thanks again  :-)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Cursor Change
« Reply #11 on: October 14, 2005, 07:23:22 AM »
Thanks alot! That is EXACTLY what I was after. Thank you for your help.

My pleasure psuchewinner, glad it could help.

You were the only one to step up and help.

Hey hey hey -- Don't be tough on the other forumites -- it takes time to figure these things out so some questions may go unanswered for a awhile, but it's not because there's a lack of interest, ability or desire to step up and help. Luckily enough your particular challenge happens to be in an area where I've a little experience, so it didn't take much time to cobble together a potential solution. In other words, talk nice 'bout my friends, they will most certainly be more qualified to answer your next question than me.

I used to find a lot of helpful stuff in the cadvault but since it is gone, I guess I will be looking for you.

PS: I think what you meant to say is "I guess I'll be looking to the swamp".

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst