Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/13/2023 in all areas

  1. Been doing some reading. See below which adds to RonJons code from a couple of years ago. I've referenced a couple of the posts I looked at for reference. The third one is quite good to keep handy - a complete list of vla- fuctions. I've put a couple of notes in the code, see how this is for you. ;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/tablestyle-text-color/td-p/9142019 ;https://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-7B82400C-53D0-4D1A-94FA-66BB3040F0AA ;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/complete-list-of-vl-vla-and-vlax-functions/td-p/4666405 ;https://help.autodesk.com/view/OARX/2019/ENU/?guid=GUID-DF80B4AB-0481-4702-967F-021B4F59AD9F (defun c:foo (/ co e el o col) ;; RJP » 2019-11-12 (cond ((and (setq e (car (entsel))) (= "ACAD_TABLE" (cdr (assoc 0 (setq el (entget e))))) (setq co (vla-get-truecolor (vlax-ename->vla-object e))) (setq o (cdr (assoc 342 el))) ) ;;Text Colours (vla-put-colorindex co 12) (vla-setcolor (setq o (vlax-ename->vla-object o)) actitlerow co) (vla-put-colorindex co 11) (vla-setcolor o acheaderrow co) (vla-put-colorindex co 256) (vla-setcolor o acdatarow co) ;;Cell Colours: ;;Create a colour object (setq col (vlax-create-object (strcat "AutoCAD.AcCmColor." (substr (getvar "ACADVER") 1 2)))) ;;Setting the table background colours (vla-SetRGB col 240 0 240) ; set the true colour; ;;In the row below note the (+ ac..... ) which is what row types to include (vla-SetBackgroundColor o (+ acTitleRow acHeaderRow acDataRow) col) ;; colour row types ;; Clear the background colors (vla-SetBackgroundColorNone o (+ acTitleRow acHeaderRow acDataRow) :vlax-true) ; no colour in row types ;; Set the border color (vla-SetRGB col 12 34 56) ; set the colour ;;Note 1 you can also do each row type individually (2 rows here) or combined as above (row 1 below) ;;Note 2 the (+ acHorzTop.....) which is which border to adjust (vla-SetGridColor o (+ acHorzTop acHorzBottom acHorzInside acVertLeft acVertRight acVertInside) (+ acHeaderRow acTitleRow) col) ;;Note here that you can use the colour object, col, or the colour index (from RonJon), co. (vla-put-colorindex co 256) ; 0 for ByBlock, 256 for ByLayer (vla-SetGridColor o (+ acHorzTop acHorzBottom acHorzInside acVertLeft acVertRight acVertInside) (+ acDataRow ) co) ;; Release the color object (vlax-release-object col) ) ; end cond ) ; end conds )
    1 point
  2. I have all these snippets but I do not possess the skills or knowledge to effectively put them together.. Like these: (VLA-SETCOLOR2 (VLA-SETCELLGRIDCOLOR (VLA-SETCELLGRIDCOLOR2 (vla-SetBackgroundColor I tried marrying those with ronjonp's code above but had no luck whatsoever... I'm a hack that can sometimes get something to work... I rely on people such as yourself or Lee or ronjonp or mhupp or so many others that I could name here to hold my hand or to shine a light or provide the missing pieces.. and for that I am so very grateful.. I've come a long way but I'm still in 1st grade around those who really know what they are doing.. I feel good that I at least try before saying "write me program that does X."
    1 point
  3. Talking to myself I suppose... I found this code by ronjonp that changes the text color inside a selected table - AWESOME! (defun c:foo (/ co e el o) ;; RJP » 2019-11-12 (cond ((and (setq e (car (entsel))) (= "ACAD_TABLE" (cdr (assoc 0 (setq el (entget e))))) (setq co (vla-get-truecolor (vlax-ename->vla-object e))) (setq o (cdr (assoc 342 el))) ) (vla-put-colorindex co 12) (vla-setcolor (setq o (vlax-ename->vla-object o)) actitlerow co) (vla-put-colorindex co 11) (vla-setcolor o acheaderrow co) (vla-put-colorindex co 256) (vla-setcolor o acdatarow co) ) ) (princ) If I can change the border colors of the three sections I'm golden. Help? Please?
    1 point
  4. I walked away with not only my end goal met but I learned something as well...
    1 point
  5. Updated the lisp to streamline the process. You no longer have to select a text from a list just select it with your mouse and it will spit out how many block it found and the value. and error checking to see if it was a attribute you selected. Example LAOB-2.0.lsp
    1 point
  6. I actually just changed my OSNAPCOORD to 0 and it started to work Thanks Mircea
    1 point
×
×
  • Create New...