Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/10/2019 in all areas

  1. GATTE 2 Global Attribute Edit with Layout Selection This small program works just like AutoCAD's GATTE express tool, with the extra option of choosing which layouts to apply attribute changes to. There are two versions of this program: Version 1 Command: GATTE2 ..is made in lisp and is loaded using these instructions. It uses CAB's Layout Select program to select which layouts you want. (Make sure you download and place LayoutSelect.dcl in an AutoCAD search path or GATTE2 will not work!) Version 1 Required Files: GATTE2.lsp LayoutSelect.dcl Both in GATTE2 V1.zip. Version 2 Command: G2N ..contains an optional Number Incrementer. It is a .NET program and can be loaded using the command NETLOAD; this can then be put into a lisp for startup if desired. Another way to load a .NET program is shown here. Version 2 Dialog Window Version 2 Required Files: GATTE2.dll (in GATTE2 V2 dll.zip ) Alternatively, compile version 2 using the source files in GATTE2 V2 CS Files.zip. Any comments are welcome, reply to the original thread. GATTE2 V1.zip GATTE2 V2 CS files.zip GATTE2 V2 dll.zip
    1 point
  2. For what it's worth, you needn't iterate over the list repeatedly - you can construct the string whilst adding items to the list box, e.g.: (setq lst '(("n1" 74678.6 53741.6 0.0) ("n2" 74683.8 53741.6 0.0) ("n3" 74683.8 53747.6 0.0) ("n4" 74677.6 53747.6 0.0))) (start_list "Coord") (foreach itm lst (add_list (apply 'strcat (cons (car lst) (mapcar '(lambda ( x ) (strcat " " (rtos x))) (cdr lst))))) ) (end_list)
    1 point
  3. I have no experience using the Core Console in AutoCAD and consequently I'm unsure of any incompatibilities with the use of my program in conjunction with this utility. However, an easier approach might be to use my Script Writer application to evaluate my Burst Upgraded application across an entire set of drawings - in this case, the Script Line supplied to my Script Writer might look something like the following: _.open *file* (load "BurstUpgradedV1-7.lsp" nil) (if LM:burstsel (LM:burstsel (ssget "_X" '((0 . "INSERT")(66 . 1))) nil)) _.qsave _.close
    1 point
  4. (defun C:incoord (/ pc) (setq pc (getpoint "\nClick on the point: ")) (while pc (##InsTextCoord pc) (setq pc (getpoint "\nNext Point [Or <Enter> to end]: ")) ) (princ) ) (defun ##InsTextCoord (ponto / px py pz) (setq px (car ponto)) (setq py (cadr ponto)) (setq pz (caddr ponto)) (command ".text" ponto "" "" (strcat "X= " (rtos px) ", Y= " (rtos py) ", Z= " (rtos pz) )) ) (princ "\n INCOORD to start") (princ)
    1 point
  5. Once you select an option this will continuously allow you to keep picking points until you hit Enter or Spacebar. (defun c:enz (/ clr key pnt a b c) ;; Tharwat - 5.Jul.2019 ;; (load "enz.lsp") enz ;; https://www.cadtutor.net/forum/topic/68126-require-lisp-3-in-1-for-xyz-coordinates-with-leader/?tab=comments#comment-552639 ;; Add Commas ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/1-000-comma-separator/m-p/1857166#M230806 ;; Code Source: John Uhden ;; This function pads a numeric string with commas. ;; Arguments: ;; num = any number, real or integer (>= 0) ;; # = precision, integer (>= 0) ;; (defun rtoc (num # / p#) (setq num (rtos num 2 #) # 1) (while (and (/= (substr num # 1) ".")(<= # (strlen num))) (setq # (1+ #)) ) (setq # (1- #) p# #) (if (= (setq # (rem # 3)) 0)(setq # 3)) (while (< # p#) (setq num (strcat (substr num 1 #) "," (substr num (1+ #))) # (+ 4 #) p# (1+ p#) ) ) num ) (setq clr (getvar 'clayer)) ; from dlanorh's code (cond ( (null (tblsearch "LAYER" "Coor Text")) (command "-layer" "_M" "Coor Text" "_C" 7 "" "")) (t (setvar 'clayer "Coor Text"))) (and (or (initget "NoZ All Z") (setq key (cond ((getkword "\nPick your go [No Elevation , All Coordinates , Z coordinates only] [NoZ/All/Z] < NoZ > :" ) ) ("NoZ") ) ) ) (setq pnt (getpoint "\nSpecify base point : ")) (setq dim (getvar 'DIMZIN)) (setvar 'DIMZIN 0) (while pnt (mapcar 'set '(a b c) (mapcar '(lambda (k p) (strcat k (rtoc p 4))) '("E=" "N=" "Z=") pnt ) ) (setvar 'DIMZIN dim) (command "_.LEADER" "_none" pnt "\\" "" (nth (vl-position key '("NoZ" "All" "Z")) (list (strcat a "\\P" b) (strcat a "\\P" b "\\P" c) c) ) "" ) (setq pnt (getpoint "\nSpecify base point : ")) ) ; while ) (setvar 'clayer clr) (princ) )
    1 point
  6. Start list is one variable. Final list is 4 variables. I think it's impossible to convert quite right you want. (setq lst '(("n1" 74678.6 53741.6 0.0) ("n2" 74683.8 53741.6 0.0) ("n3" 74683.8 53747.6 0.0) ("n4" 74677.6 53747.6 0.0))) (mapcar (function (lambda(x)(cons (read (car x)) (cdr x)))) lst)) ;; returns : '((N1 74678.6 53741.6 0.0) (N2 74683.8 53741.6 0.0) (N3 74683.8 53747.6 0.0) (N4 74677.6 53747.6 0.0)) ;; using nth, foreach, mapcar etc you can get access to any element of list
    1 point
  7. Hint search here (Cadtutor) triangulation.
    1 point
  8. Tharwat's code with slight modifications in my later post.
    1 point
  9. I've amended my earlier post to remove the colour tags - I daren't think how many thousand other such posts still exist with embedded formatting...
    1 point
  10. (defun c:test ( / e i j m n p s ) (if (setq s (ssget '((0 . "LWPOLYLINE")))) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i))) n (cdr (assoc 210 (entget e))) m (vlax-curve-getendparam e) j -1 ) (while (<= (setq j (1+ j)) m) (setq p (trans (vlax-curve-getpointatparam e j) 0 e)) (entmakex (list (cons 0 "TEXT") (cons 7 (getvar 'TEXTSTYLE)) (cons 40 (getvar 'TEXTSIZE)) (cons 10 p) (cons 11 p) (cons 72 1) (cons 73 2) (cons 1 (itoa (1+ j))) (cons 210 n) ) ) ) ) ) (princ) )
    1 point
×
×
  • Create New...