Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. You can private message me if you are after a custom program.
  3. Today
  4. 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
  5. (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!
  6. Yesterday
  7. 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
  8. GLAVCVS

    subfix in dimension...

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

    subfix in dimension...

    @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
  10. @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?
  11. GLAVCVS

    subfix in dimension...

    @leonucadomi You should copy the code again. I changed a small thing to prevent NOMUTT from staying at 1.
  12. GLAVCVS

    subfix in dimension...

    To add all the text lines you need
  13. GLAVCVS

    subfix in dimension...

    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) )
  14. leonucadomi

    subfix in dimension...

    I NEED TO ADD A SECOND TEXT BELOW THE FIRST
  15. leonucadomi

    subfix in dimension...

    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) )
  16. Lee Mac

    Field

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

    Find&open files

    You're right. The file opens now. Thank you again.
  18. PGia

    Find&open files

    @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.
  19. Lee Mac

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

    Find&open files

    And try again
  21. GLAVCVS

    Find&open files

    It’s possible that vlide.dsk is not located in AutoCAD’s Support File Search Path. Find it using Windows Explorer and add its location to AutoCAD’s Support File Search Path.
  22. issammesk

    text field

    THANK YOU SIR
  23. CyberAngel

    Find&open files

    Not sure what you're trying to do. VLIDE is an AutoCAD command to open the Visual Lisp Integrated Development Environment.
  24. PGia

    Find&open files

    @GLAVCVS I type vlide@dsk in the command line, but it doesn’t do anything.
  25. maahee

    Field

    (defun c:bm () ;code;;;;;;;; (setq s (car(entsel))) (if s (progn (setq ar (vlax-ename->vla-object s)) (setq area (vla-get-Area ar)) (setq p (getpoint "\nselect point")) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 p) (cons 40 0.3) (cons 71 5) (cons 1 (strcat "%<\\AcObjProp.16.2 Object(%<\\_ObjId " (itoa (vla-get-objectid ar)) ">%).Area \\f \"%lu2%pr2%ps\">%" ) ) (cons 7 "Standard") (cons 73 1) ) ) ) ; end progn ) ;code;;;;;;;; ) This part of the code displays the object area as: &lt;\AcObjProp.16.2 Object(%&lt;\_ObjId 2401165245680&gt;%).Area \f "%lu2%pr2%ps" in AutoCAD model space. If you double-click on the text, it will show the object area. (example 100.00)
  26. SLW210

    text field

    You could make them blocks, update one, the rest update. The best IMO would be, as mentioned by CyberAngel, custom properties that can be referenced by fields. You could also use LISP, etc., but since you mentioned fields, the custom properties and fields might be easier for you.
  27. Let me give you update from 8 more years, it helped me today! I hope someone sends a notification from 2033 too Or i will become the last ghost here...
  28. Last week
  29. PGia

    Find&open files

    It works Thank you so much
  1. Load more activity
×
×
  • Create New...