Jump to content

Recommended Posts

Posted

Custom buttons.
Hello does anyone have the vector_image of any of these two buttons ??

img1.PNG

img2.PNG

Posted

Why not just use the ones built into AutoCAD for the Select All command?

Small Image RCDATA_16_SELALL

Large Image RCDATA_32_SELALL

Posted

I don't understand, I'm creating a dlc and I would like to add buttons similar to those in the photo.
and I was wondering if anyone already has vector_image ready

Posted

I did this custom button along time ago but did not used it in any of my programs, so hope you like it and feel free to modify it to suit your needs.

 

: image_button { key = \"img\"; width = 4.75; height = 2.2; fixed_width = true; fixed_height = true; color = graphics_background;}
(start_image "img")
     (mapcar 'vector_image
             '(13  13  18  11  11  11  11  11  11  11  11  11  11  11
               11  11  11  11  11  11  11  11  11  11  11  11  11  11
               11  11  11  11  11  11  11  11  11  11  11  11  11  11
               11  11  11  11  11  11  11  11  11  11  11  11  11  11
               11  11  11  11  11  11  11  11  11  11  11  11  11  11
               11  11  11  11  11  11  11  11  11  11  11  11  11  11
               11  11  11  11  11  11  18  18  18  18  18  18  18  18
               18  18  18  18  11  18  11  18  11  18  11  18  11  18
               11  18  11  18  11  18  11  18  11  18  11  18  11  17
               17  17  17  11  11  11  17  17  17  8   7   7   8   17
               18  18  18  18  18  18  18  18  18  19  19  19  20  20
               20  20  20  20  20  19  19  19  16  19  16  19  16  19
               16  19  19  19  18  18  18  18  19  15  15  15  15  15
               15  15  15  15  14  14  14  14  14  14  14  14  13  13
               13  19  20  18  18  18  19  19  19  19  19  19  19  19
               19  19  20  20  20  20  20  18  20  18  16  13  13  23
               24  24  23  4   3   3   4
              )
             '(6   6   10  6   19  19  19  19  19  19  18  18  18  18
               18  18  18  18  17  17  17  17  17  17  17  17  16  16
               16  16  16  16  16  16  15  15  15  15  15  15  15  14
               14  14  14  14  14  14  14  13  13  13  13  13  13  13
               13  12  12  12  12  12  12  12  12  11  11  11  11  11
               11  11  11  10  10  10  10  10  10  10  10  9   9   9
               9   9   8   8   9   9   10  10  10  9   9   9   9   9
               9   9   8   8   8   8   8   8   8   8   8   8   8   8
               8   8   7   7   7   7   7   7   7   7   7   7   7   7
               7   6   7   7   7   6   6   6   6   19  18  7   6   6
               7   10  17  17  17  17  17  17  18  18  19  19  20  20
               20  20  20  20  20  21  21  21  18  21  18  21  19  21
               19  21  21  21  22  22  22  22  21  19  19  19  19  19
               19  19  19  19  19  19  19  20  20  20  20  20  20  20
               20  21  20  17  16  16  16  16  16  16  16  16  16  16
               16  15  15  15  15  15  15  17  20  22  18  20  9   25
               23  4   3   3   4   23  25
              )
             '(17 11 13 11 8  8  8  8  7  7  7  7  7  7  7  7  7  7  7
               7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7
               7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7
               7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7
               7  7  7  7  7  7  7  7  7  7  7  7  7  7  17 17 17 17 17
               16 16 16 16 16 16 15 7  15 7  15 7  15 7  15 7  14 7  14
               7  14 7  14 7  14 7  14 7  13 7  13 13 12 13 7  7  7  7
               8  8  11 8  7  7  8  17 18 13 13 13 13 13 13 13 13 13 13
               13 13 13 13 13 13 13 13 13 13 13 16 13 16 13 16 13 17 17
               17 17 18 18 18 17 13 13 13 13 13 13 13 13 13 13 13 13 13
               13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13
               13 13 13 13 13 13 13 13 20 18 20 18 16 13 4  23 24 24 23
               4  3  3
              )
             '(6   6   6   19  19  19  19  19  19  19  18  18  18  18
               18  18  18  18  17  17  17  17  17  17  17  17  16  16
               16  16  16  16  16  16  15  15  15  15  15  15  15  14
               14  14  14  14  14  14  14  13  13  13  13  13  13  13
               13  12  12  12  12  12  12  12  12  11  11  11  11  11
               11  11  11  10  10  10  10  10  10  10  10  9   9   9
               9   9   8   8   9   9   10  10  10  9   9   9   9   9
               9   9   8   8   8   8   8   8   8   8   8   8   8   8
               8   8   7   7   7   7   7   7   7   7   7   7   7   7
               7   6   7   7   7   6   6   6   6   19  19  18  7   6
               6   7   12  13  13  13  13  13  13  14  14  14  14  14
               15  15  15  15  15  15  16  16  16  18  16  19  16  19
               17  20  20  20  21  21  21  22  19  17  17  17  17  17
               18  18  18  18  18  19  19  19  19  19  19  20  20  20
               20  16  14  12  12  12  12  12  11  11  11  11  11  11
               10  10  10  10  10  10  9   15  17  20  22  18  20  25
               25  23  4   3   3   4   23
              )
             '(81  2   2   2   81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  81  81  81  81  81  81  81  81  81  81  81  81
               81  81  7   7   7   7   7   7   7   7   7   7   7   7
               7   7   7   7   7   7   7   7   7   7   7   7   7   7
               7   7   7   7   7   7   7   7   7   7   7   7   7   7
               7   7   7   7   7   7   7   7   7   7   7   7   7   7
               7   7   7   7   7   7   7   7   7   7   7   7   7   7
               7   7   7   7   7   7   2   2   2   2   2   2   2   110
               110 110 110 110 110 110 110
              )
     )
     (end_image)

 

Image_button.PNG

  • Like 1
Posted

is there a library where i can find buttons like these from AutoCAD? or does it have to be done manually?
my buttons are "width = 3.5;" similar to autocad's but I can't find the vector_image of these buttons anywhere

Posted

I don't think that there is a library so you need to retrieve them manually as I did.

The width or the height attributes are not a matter in this case, so you can increase the size of the image as you like with respect to the attribute tile. aspect_ratio 

Posted

I am pretty sure had a icon editor program it allowed you to look in the correct dll if I remember correct and could access the Acad icons. I think its on my old laptop if I can find time will have a look for it.

 

I use paint.net a good program can set pixel size and make icons with good quality, use that for my toolbar icons.

  • Like 1
Posted

Fantastic @Lee Mac!!
but I can't make it work, what am I doing wrong ??

generates an error in my mapcar.

 

: image_button { key = \"img\"; width = 3.5; fixed_width = true; fixed_height = true; aspect_ratio = 1.0;}

 

(defun vectors ( key )
  (start_image key)
  (mapcar 'vector_image 
          '(
            -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 095 096 096 096 096 096 096 096 096 095 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 096 254 254 254 254 254 254 254 254 096 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 096 063 063 -15 063 063 063 063 063 096 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 096 063 -15 250 -15 063 063 063 063 096 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 096 -15 250 250 -15 063 063 063 063 096 -15 -15 -15 -15
            -15 -15 -15 -15 -15 -15 254 250 -15 250 -15 063 063 063 063 096 -15 -15 -15 -15
            254 254 254 254 254 254 250 -15 -15 250 -15 063 063 063 063 096 254 254 254 254
            254 254 254 254 254 250 -15 -15 -15 250 -15 063 063 063 063 096 254 254 254 254
            254 254 254 254 250 -15 -15 -15 -15 250 -15 063 063 063 063 096 254 254 254 254
            254 254 254 250 250 250 -15 -15 -15 250 -15 063 063 063 063 096 254 254 254 254
            254 254 254 254 254 250 -15 250 -15 250 -15 063 063 063 063 096 254 254 254 254
            254 254 254 254 254 250 -15 250 250 250 -15 063 063 063 063 096 254 254 254 254
            254 254 254 254 250 -15 250 254 254 250 254 096 096 096 096 095 254 254 254 254
            254 254 254 254 250 -15 250 254 254 254 254 254 254 254 254 254 254 254 254 254
            254 254 254 254 254 250 254 254 254 254 254 254 254 254 254 254 254 254 254 254
            254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254
            -15 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 -15
            )
  )
  (end_image)
)

 

Posted

Thank you for your positive feedback.

 

You are currently only supplying the vector_image function with the ACI colour - you'll also need to provide the pixel coordinates for each colour, as represented by the lists stored by the x & y variables in my application.

Posted
On 9/7/2020 at 10:18 AM, Lee Mac said:

Thank you for your positive feedback.

 

You are currently only supplying the vector_image function with the ACI colour - you'll also need to provide the pixel coordinates for each colour, as represented by the lists stored by the x & y variables in my application.

 

still unsuccessful, what am i doing wrong?

(defun vectors2 (key / i j)
  (setq i (/ (dimx_tile key) 151.) j (/ (dimy_tile key) 66.))
  (start_image key)
  (fill_image 0 0 (dimx_tile key)(dimy_tile key) -15)
  (foreach x '(
               (-15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 095 096 096 096 096 096 095 -15 -15 -15 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 096 063 063 063 063 063 096 -15 -15 -15 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 096 254 254 063 063 063 096 -15 -15 -15 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 253 250 254 063 063 063 096 254 008 254 -15 -15 -15)
               (-15 -15 -15 -15 -15 -15 -15 250 250 254 063 063 063 096 -15 252 251 254 -15 -15)
               (-15 -15 -15 -15 -15 -15 250 -15 250 254 063 063 063 096 -15 254 252 008 -15 -15)
               (254 254 254 254 254 250 -15 -15 250 253 096 096 096 095 -15 254 254 149 254 254)
               (254 254 254 254 250 -15 -15 -15 250 -15 254 -15 -15 -15 -15 254 254 149 254 254)
               (254 254 254 250 -15 -15 -15 -15 250 -15 008 253 -15 -15 -15 -15 253 008 254 254)
               (254 254 250 250 250 -15 -15 -15 250 254 254 251 253 -15 -15 253 251 254 254 254)
               (254 254 254 254 250 -15 250 -15 250 254 254 254 008 149 149 008 254 254 254 254)
               (254 254 254 254 250 -15 250 250 250 254 254 254 254 254 254 254 254 254 254 254)
               (254 254 254 250 -15 250 254 254 250 254 254 254 254 254 254 254 254 254 254 254)
               (254 254 254 250 -15 250 254 254 254 254 254 254 254 254 254 254 254 254 254 254)
               (254 254 254 254 250 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254)
               (254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254)
               (-15 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 254 -15)
               )
    (vector_image (fix (* (car x) i))(fix (* (cadr x) j))(fix (* (caddr x) i))(fix (* (cadddr x) j))(last x))
  )
  (end_image)
  (princ)
)

 

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