All Activity
- Past hour
-
Here are two good options from Lee Mac
-
swanny89 joined the community
- Today
-
Migoo joined the community
-
Precisely selecting with a window
SLW210 replied to Discus84's topic in AutoCAD 2D Drafting, Object Properties & Interface
Are you using AutoCAD 2010 as shown in your profile? I do not believe this is an issue in newer AutoCAD versions, I am not sure what version it was fixed though. UPDATE: From the posted thread, looks like AutoCAD 17.1 update or maybe AutoCAD 2018 had the fix. AutoCAD 2023 Help | SELECTIONOFFSCREEN (System Variable) | Autodesk You'll probably need to keep searching and see what workarounds people came up with before the fix. Losing selected objects when zooming/panning etc - AutoCAD 2D Drafting, Object Properties & Interface - AutoCAD Forums Solved: AutoCAD - Zoom after selection lost object selected - Autodesk Community -
dimension Change Qleader Setting via Command Line
SLW210 replied to reza's topic in AutoLISP, Visual LISP & DCL
That LISP the is not original AFAIK. It is a couple of functions, you need to call for it with a LISP to make the settings, etc. Several places to get the correct QlSet.lsp and example LISPs to use it. Qleader lisp routine - AutoLISP, Visual LISP & DCL - AutoCAD Forums Qleader System Variables - AutoLISP, Visual LISP & DCL - AutoCAD Forums qleader lisp - AutoLISP, Visual LISP & DCL - AutoCAD Forums assigning q-leader settings using lisp -
;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq mtext (vla-AddMText mspace (vlax-3d-point pt) 0.0 ; width (0 for default) (strcat "%<\\AcObjProp.16.2 Object(%<\\_ObjId " (itoa (vla-get-ObjectID entity)) ">%).Area \\f \"%lu2%pr2%ps\">%") ) ) ;; Set properties (vla-put-Layer mtext "mtext") (vla-put-Height mtext 0.3) (vla-put-AttachmentPoint mtext 5) ; Middle-center (vla-put-InsertionPoint mtext (vlax-3d-point pt)) (vla-put-StyleName mtext "Standard") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I am replacing entmakex with vla-addmtext and have completed the task. I want to apply various text properties, such as bold, underline, color, style, height, etc.............................thank...........................
-
Need help with attributes count table
BIGAL replied to aridzv's topic in AutoLISP, Visual LISP & DCL
Have a look at lee-mac dynamic block properties there is a get current visibility name in there, also get all visibility names into a list. -
Precisely selecting with a window
BIGAL replied to Discus84's topic in AutoCAD 2D Drafting, Object Properties & Interface
Look at (getvar 'extmax) & (getvar 'extmin) these are the size of your dwg wether your zoomed or not. -
Something I have done for attributes in a block is pop up a dcl with the current attribute values so there is no reason why could not do the same just set a maximum number of lines 1 2 3 4 etc. If you leave a line blank that would be considered end of multi line input. It uses my library Multi getvals.lsp to make the dcl. Some example code can be changed to work with a Dimension. Have a go. ; Change an attribute value in blocks ; Using creation order rather than by tag name ; BY Alan H Sept 2025 (defun AH:blchange( / ss1 blname x inc atts) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq obj (vlax-ename->vla-object (car (entsel "\nPick block object ")))) (setq atts (vlax-invoke obj 'Getattributes)) (setq lst '()) (setq lst '("Enter new values ")) (foreach att atts (setq lst (cons (vlax-get att 'tagstring) lst)) (setq lst (cons 19 lst)) (setq lst (cons 20 lst)) (setq lst (cons (vlax-get att 'Textstring) lst)) ) (setq lst (reverse lst)) (setq ans (AH:getvalsm lst)) (setq x -1) (foreach att atts (vlax-put att 'Textstring (nth (setq x (1+ x)) ans)) ) (princ) ) (aH:blchange) Multi GETVALS.lsp
-
Look for Notepad your Acad.pgp make code even shorter. This the bat file I use. d: cd\alan\lisp findstr %1 *.lsp
-
Tharwat started following Need help with attributes count table
-
Need help with attributes count table
Tharwat replied to aridzv's topic in AutoLISP, Visual LISP & DCL
You can private message me if you are after a custom program. -
drmemo345 joined the community
-
reza started following Change Qleader Setting via Command Line
-
dimension Change Qleader Setting via Command Line
reza posted a topic in AutoLISP, Visual LISP & DCL
Hi everyone When I open a dwg file and use the attached lisp to change the Qleader settings, no changes are made to the settings. Please fix the problem for me. qlset.lsp.lsp test.dwg -
Attribute that updates based on location
EYNLLIB replied to EYNLLIB's topic in AutoLISP, Visual LISP & DCL
(defun update-attributes ( / bln idx ins map obj sel tag val ) (setq ;; List of ;; ((lower-left point) (upper-right point) "attribute value") map '( ((-1179.5 -1006.0) (1179.5 1006.0) "S3.0") ) ;; Block name bln "Detail Cut" tag "SHEETNUMBER" ) (setq bln (strcase bln) tag (strcase tag) ) (if (setq sel (ssget "_X" (list '(0 . "INSERT") '(66 . 1) (cons 2 (strcat "`*U*," bln))))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) obj (vlax-ename->vla-object (ssname sel idx)) ) (if (= bln (strcase (vlax-get-property obj (if (vlax-property-available-p obj 'effectivename) 'effectivename 'name)))) (progn (setq ins (vlax-get obj 'insertionpoint) val (vl-some '(lambda ( itm ) (if (vl-every '<= (car itm) ins (cadr itm)) (caddr itm))) map) ) (if val (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (progn (if (vlax-write-enabled-p att) (vla-put-textstring att val) ) t ) ) ) (vlax-invoke obj 'getattributes) ) ) ) ) ) ) (princ) ) (defun block-position-callback ( rtr arg ) (if (and arg (wcmatch (strcase (car arg) t) "qsave,save,saveas,plot,publish,regen,regenall")) (update-attributes) ) (princ) ) ( (lambda ( key ) (vl-load-com) (foreach rtr (cdar (vlr-reactors :vlr-command-reactor)) (if (= key (vlr-data rtr)) (vlr-remove rtr) ) ) (vlr-set-notification (vlr-command-reactor key '( (:vlr-commandwillstart . block-position-callback) ) ) 'active-document-only ) (update-attributes) (princ) ) "block-position-reactor" ) For whatever reason the code you posted wasn't agreeing with my CAD. I inverted the logic to test if true, and added a nil guard to ensure attributes are only updated when a valid value is found in the area map Thanks for pointing me in the right direction! - Yesterday
-
Eymard Sosa joined the community
-
Precisely selecting with a window
Discus84 posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Hi, Very often the selection window is large enough for the drawing to be really zoomed out. In this case it's hard to point the window exactly where it should be. Zooming in is not possible because whatever is not on the screen will not be selected. Am I missing something here? Is there a way to zoom in and for the window to still catch whatever is not on the screen? Thanks. Lu -
I think the best way to explain it is to include a picture of the DIMENSION before and after it was modified. Although perhaps other, more awake minds than mine have already understood it.
-
@GLAVCVS IT'S OKAY, I JUST NEED IT WITHOUT HAVING TO ADD THE TEXT TO THE BEGINNING, SO TEXTS 1 AND 2 WILL ALREADY BE DEFINED WITHIN THE ROUTINE I mean I just select a dimension and the result is... true dimension accompanied by the "+" sign and below the line "text 1" and below this "text 2" (defun c:dimsub ( / enx grp idx new pos sel str ) (princ "\nColoca subfijo a dimension por debajo de linea con opcion de cambio") (if (setq sel (ssget "_:L" '((0 . "*DIMENSION")))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) enx (entget (ssname sel idx)) grp (assoc 1 enx) ) (if (setq pos (vl-string-search "\\X" (cdr grp))) (setq new (cons 1 (strcat (substr (cdr grp) 1 pos) "\\X" str))) (setq new (cons 1 (strcat "+" "<>\\X" "TEXT 1))) ) (entmod (subst new grp enx)) ) ) (princ) ) this routine is from the master @Lee Mac I mean I'm looking to add a second line
-
Need help with attributes count table
3arizona replied to aridzv's topic in AutoLISP, Visual LISP & DCL
@Tharwat Sorry for opening this old post. Lisp works perfect but i get an error when extracting my dynamic block. My block has other visibilities do not share the same tag names. Is there a way for the lisp to read the current visibility? -
@leonucadomi You should copy the code again. I changed a small thing to prevent NOMUTT from staying at 1.
-
To add all the text lines you need
-
Another option (defun c:subTexta (/ e le txa tx cj para) (if (/= (setq tx (getstring "\nType TEXT to add?: ")) "") (while (setq n (not (setvar "NOMUTT" 1)) x (princ (strcat "\rAdd \'" tx "\' to DIMENSIONs...")) cj (ssget "_:L" '((0 . "*DIMENSION")))) (while (setq e (ssname cj (setq n (if n (1+ n) 0)))) (entmod (subst (cons 1 (cond ((or (wcmatch (setq txa (cdr (assoc 1 (setq le (entget e))))) "*<>\n*") (wcmatch txa "*<>\\X*")) (strcat txa "\n" tx)) (T (strcat txa "<>\\X" tx)))) (assoc 1 le) le ) ) ) ) ) (setvar "NOMUTT" 0) (princ) )
-
I NEED TO ADD A SECOND TEXT BELOW THE FIRST
-
master , I am trying to do the following (defun c:dimsub ( / enx grp idx new pos sel str ) (princ "\nColoca subfijo a dimension por debajo de linea con opcion de cambio") ; (if (= "" (setq str (getstring t "\nSpecify string <TYP>: "))) ;(setq str "TYP") ; ) (if (setq sel (ssget "_:L" '((0 . "*DIMENSION")))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) enx (entget (ssname sel idx)) grp (assoc 1 enx) ) (if (setq pos (vl-string-search "\\X" (cdr grp))) (setq new (cons 1 (strcat (substr (cdr grp) 1 pos) "\\X" str))) (setq new (cons 1 (strcat "+" "<>\\X" "TEXT 1"))) ) (entmod (subst new grp enx)) ) ) (princ) )
-
But if you were curious as to what the entmake route looks like - consider the following thread: https://www.theswamp.org/index.php?topic=20446
-
You're right. The file opens now. Thank you again.
-
dilan yıldırım joined the community
-
@CyberAngel I'm having recurring issues with the open file history in Visual Lisp. I asked about this issue here a while back. @rlx explained that the history is stored in the vlide.dsk file. I tried using the GLAVCVS code to open it.
-
Lee Mac started following Field
-
If you wish to entmake a field, you need to also entmake the FIELD entity within the TEXT entry of the ACAD_FIELD dictionary found within the extension dictionary attached to the entity - this is theoretically possible, but a lot of work and wheel reinvention. Instead, if you either create the MText object using vla-addmtext or convert the MTEXT entity into a VLA object and set the textstring property to a field expression, the CAD platform will automatically parse the field expression and configure the corresponding dictionaries for you.