Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/09/2024 in all areas

  1. Try this: (defun c:foo (/ o s) (if (setq s (ssget ":L" '((0 . "*TEXT")))) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (setq o (vlax-ename->vla-object e)) (if (= "TEXT" (cdr (assoc 0 (entget e)))) (vla-put-textstring o (strcat "%%O" (vl-string-left-trim "%%O" (vla-get-textstring o)))) (vla-put-textstring o (strcat "\\O" (vl-string-left-trim "\\O" (vla-get-textstring o)))) ) ) ) (princ) )
    2 points
  2. The short answer is that you have specified too much of a gap. The CIRC1 shape at a scale of 0.04 is 0.08 in diameter. So the space (negative distance) should be 0.08, and you have specified 0.05+0.05=0.10 which gives the 0.02 gap. I suspect you are just beginning to learn about linetype definitions, but to correct your code, I would amalgamate the two line sections and also the two space sections into one each. You do not need an x dimension because the insertion point of CIRC1 is at the left hand quadrant point. This would give the code line to be:- A, .4,[CIRC1,ltypeshp.shx,s=.04],-0.08
    1 point
  3. Its not an answer to the question but does a 2 column radio button answer in just a few lines of code, it uses the library code Multi radio buttons 2 col, which it loads on demand. So just make 2 lists of what you want to see displayed in your dcl. Then use the cond etc. The code returns the displayed string or the button number selected a bit hidden but is there. There is sample code in the top of the code. Just a question why do you need 8 views ? Multi radio buttons 2col.lsp
    1 point
  4. Maybe like this change values to suit. Note s=2.5 I think the circ1 is based on a 1 dia circle. The -5 gap = x offset. *JHOOK,JHOOKS ----O----O----O----O----O----O-- A,50,-5.0,[CIRC1,ltypeshp.shx,S=2.5,R=0.0,X=-5.0,Y=0.0]
    1 point
  5. Use variables to save current view location rather than command line. Don't have to delete the old view to save new location, won't have output to the command line and its faster. (defun C:V1 () (setq vc (getvar 'viewctr)) (setq sz (getvar 'viewsize)) (prompt "\nView Saved") ) (defun C:R1 () (vl-load-com) (setq Drawing (vla-get-activedocument (vlax-get-acad-object)))) (vla-zoomcenter Drawing VC SZ) (princ) ) This is another lisp I have that Zoom to the same place across multiple drawings. ;;----------------------------------------------------------------------------;; ;; Zoom Area Across Multiple Drawings (defun C:ZAD (/ a) (initget "Yes No") (setq a (cond ((getkword "\nRedefine Zoom Area? [Yes/No]: ")) ("No") ) ) (if (= "Yes" a) (progn (vl-cmdf "_.Zoom" "W" Pause Pause) (setq vc (getvar 'viewctr)) (setq SZ (getvar 'viewsize)) (vl-propagate 'vc) (vl-propagate 'sz) ) (if (or (= vc nil) (= sz nil)) (prompt "\nPlease Define Zoom Area") (vl-cmdf "_.Zoom" "C" VC SZ) ) ) (princ) )
    1 point
  6. Give this a try, assuming they are not modified dynamic blocks. (defun c:foo (/ s) (if (setq s (ssget "_X" '((0 . "INSERT") (2 . "YOURBLOCKNAME")))) (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) '((8 . "YOURLAYERNAME"))))) ) (princ) )
    1 point
  7. dont know if you have seen it already but i think this link would be interesting https://help.autodesk.com/view/ACDLT/2024/ENU/?guid=GUID-037BF4D4-755E-4A5C-8136-80E85CCEDF3E
    1 point
  8. looks like arrow keys are 37-40 I only used the numpad with that command but according to this its 96-105 maybe grread defaults to both ?
    1 point
×
×
  • Create New...