Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/31/2024 in all areas

  1. Try the code above again .. I missed setting the 'ff' variable.
    1 point
  2. Yes: I think the only way to achieve this is by transforming each byte into a list of bits. I have already done this. Now I am finishing designing the read and write functions to work with single (32 bits) and double (64 bits) precision numbers. Once I finish this work and test it, I will leave the result in this thread, in case anyone finds it useful. In any case, one thing is clear: in Lisp it cannot be so efficient.
    1 point
  3. I don't use initget anymore rather this. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (ah:butts but "V" '("Please Choose" "All" "All in tab" "Select objects")))) ; ans holds the button picked as an integer value (cond ((if (= ans "All")(setq ss (ssget "_X" '((0 . "*TEXT")))))) ((if (= ans "All in tab")(setq ss (ssget "_X" '((0 . "*TEXT")(cons 410 (getvar 'ctab))))))) ((if (= ans "Select objects")(setq ss (ssget "_:L" '((0 . "*TEXT")))))) ) If you don't want to use the "ans" value you can use the variable but, it is a number matching the button selected, so All would return but=1. Multi radio buttons.lsp
    1 point
  4. @Nikon There were a few errors in the code you posted .. FWIW here are some modifications with comments. ;; Create a new text style and replace all styles in the drawing (defun c:cr-txtst-sel2 ;; RJP - Localize all variables (/ acaddoc eo ff i objstyle oldcmd select ss styles) (vl-load-com) ;; RJP - Check that the font can be found otherwise BOOM! Also search for the system font not tied to a CAD version (if (findfile (setq ff (strcat (getenv "WINDIR") "\\FONTS\\ARIALN.ttf"))) ;; (findfile (setq ff "C:\\Program Files\\Autodesk\\AutoCAD 2019\\Fonts\\ARIALN.ttf")) (progn (setq acaddoc (vla-get-activedocument (vlax-get-acad-object))) (setq styles (vla-get-textstyles acaddoc)) ;; Add the style named "ArialN0" (setq objstyle (vla-add styles "ArialN0")) ;; Assign fontfile "ARIALN.ttf" to the style (vla-put-fontfile objstyle ff) ;; Optional: Make the new style Active (vla-put-activetextstyle acaddoc objstyle) ;; Replace All/Select texts with the ArialN0 style (initget "All Select") (if (= "All" (setq select (getkword "\nSelect text to change [All/Select] <Select> : "))) (setq ss (ssget "_X" '((0 . "*TEXT")))) (setq ss (ssget "_:L" '((0 . "*TEXT")))) ) ;; RJP - Check for valid selection (if ss (progn (setq oldcmd (getvar "cmdecho")) (setvar "cmdecho" 0) (repeat (setq i (sslength ss)) (setq eo (vlax-ename->vla-object (ssname ss (setq i (1- i))))) ;; RJP - Check that the text can be modified (if (vlax-write-enabled-p eo) (vlax-put eo 'stylename "ArialN0") ) ) ;; RJP - This line below bombs the code? ;; (vla-endundomark doc) ; Set the style to the current one (vl-cmdf "_-PURGE" "_ST" " " "_N") ; clear unused text styles (setvar "cmdecho" oldcmd) ) ) ) (alert (strcat ff " NOT FOUND!")) ) (princ) )
    1 point
  5. I think Tharwat had the right solution : https://forums.autodesk.com/t5/autocad-forum/ad-how-to-redifine-f1-key/td-p/9395761
    1 point
  6. Just remove the asterisk when checking for equality. (= select All) (= select Select)
    1 point
×
×
  • Create New...