Recent Posts

Pages: [1] 2 3 ... 10
1
AutoLISP (Vanilla / Visual) / Re: LISP to insert block and rename
« Last post by like_citrus on May 16, 2022, 07:45:47 PM »
Thanks for sending this. I'll look into it soon.
2
AutoLISP (Vanilla / Visual) / Getting down to the numbers [dims]
« Last post by ScottMC on May 16, 2022, 06:34:03 PM »
Rare.. Here's a micro tool to help when needing a number trans!
 Just got it runnin so lacking the filters desired + the 'Text Override' OMH..

Code: [Select]
(defun c:gdt ( / a  ldtx) ;; http://www.theswamp.org/index.php?topic=404.msg4785#msg4785
  (vlax-add-cmd "gdt" 'c:gdt "gdt" acrx_cmd_transparent) ;; allows trans use!
  (princ "\n Dim Extractor..")
        (setq a (entget (car (entsel)))) ;; Keith..
        (setq ldtx (distof (rtos (cdr (assoc 42 a))(getvar "lunits")(getvar "luprec"))))
 ;(princ (strcat "\n Dim Length: "(rtos ldtx)))
 (princ (rtos ldtx))
(princ)
)
3
AutoLISP (Vanilla / Visual) / Re: LISP to insert block and rename
« Last post by mhupp on May 16, 2022, 03:04:46 PM »
For importing blocks
http://www.lee-mac.com/steal.html

This is what i use to rename blocks.
Code - Auto/Visual Lisp: [Select]
  1. ;;----------------------------------------------------------------------------;;
  2. ;; Add Prefix/Suffix to Block Name
  3. (defun C:BLKRENAME (/ blklst SS blk lst c a n)
  4.   (vl-load-com)  
  5.   (prompt "\nSelect Block(s) or Enter To Rename All")
  6.   (if (or (setq ss (ssget '((0 . "INSERT")))) (setq ss (ssget "_X" '((0 . "INSERT")))))
  7.     (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
  8.       (setq blk (cdr (assoc 2 (entget e))))  ;Get Block Name
  9.       (if (not (vl-position blk lst))        ;If Block Name is not in List Add
  10.         (setq lst (cons blk lst))
  11.       )
  12.     )
  13.   )
  14.   (setq c 0)        ;Count
  15.   (initget "Prefix Suffix")
  16.   (setq rep
  17.     (cond
  18.       ((getkword "\n Specify your aim [Prefix/Suffix] :")) ( "Suffix")
  19.     )
  20.   )
  21.   (cond
  22.     ((= rep "Prefix")
  23.       (setq prfx (getstring "\nEnter Prefix: "))
  24.       (foreach n lst
  25.         (vla-put-Name (vla-item blklst n) (strcat prfx n))
  26.         (setq c (1+ c))
  27.       )
  28.     )
  29.     ((= rep "Suffix")
  30.       (setq sufx (getstring "\nEnter Suffix: "))
  31.       (foreach n lst
  32.         (vla-put-Name (vla-item blklst n) (strcat n sufx))
  33.         (setq c (1+ c))
  34.       )
  35.     )
  36.   )
  37.   (prompt (strcat "\n" (rtos c 2 0) " Block(s) Renamed"))
  38.   (princ)
  39. )
4
AutoLISP (Vanilla / Visual) / Re: Triangulation (re-visited)
« Last post by ahsattarian on May 16, 2022, 06:40:20 AM »
Hi everyone.
Can enyone check this file. In my opinion function PROF works wrong with this settings.

pawcyk

Have a look at this file,  Done by my own LISP and evaluated from your points every 5.00  meters  :
6
AutoLISP (Vanilla / Visual) / LISP to insert block and rename
« Last post by like_citrus on May 15, 2022, 10:51:06 PM »
Hi, is there a LISP anyone has to insert a block from another drawing and rename it with a suffix, to differentiate from the original block.
Something like Open, Select file, Paste, Rename with suffix.
7
AutoLISP (Vanilla / Visual) / Re: Layer on and off button
« Last post by BIGAL on May 15, 2022, 10:44:31 PM »
abe12345678 Reinaldo N. Togores has 4 books available I bought them on kindle way cheaper than hard copy. Nice thing is can copy and paste code.
8
.NET / Re: I'm not having any luck finding a developer reference
« Last post by Rustabout on May 15, 2022, 09:37:24 PM »
Only just starting digging but it's proven helpful so far. Thank you!!
9
AutoLISP (Vanilla / Visual) / Re: Layer on and off button
« Last post by stevej on May 15, 2022, 08:16:05 PM »
As an alternative, this is what I've used for years. A simple layer toggle.
This example is for the TEXT layer. If the layer is OFF, it is turned ON. If the layer is ON, it is turned OFF.

Code: [Select]
(defun C:TOGGLETEXT (/ elist clr)
  (setq elist (entget (tblobjname "LAYER" "TEXT"))
        clr   (assoc 62 elist)
  )
  (entmod (subst (cons 62 (- (cdr clr))) clr elist))
  (princ)
)

If the layer you wish to toggle might not yet be in the drawing, a check for the layer can be performed first with this version, which includes a notification that the layer does not exist..

Code: [Select]
(defun C:TOGGLETEXT (/ elist clr)
  (if (not (tblsearch "LAYER" "TEXT"))
    (alert
      (strcat "                   TEXT Layer"
              "\n    Does not exist on this drawing"
      )
    )
    (progn
      (setq elist (entget (tblobjname "LAYER" "TEXT"))
            clr   (assoc 62 elist)
      )
      (entmod (subst (cons 62 (- (cdr clr))) clr elist))
    )
  )
  (princ)
)

Steve
10
.NET / Re: I'm not having any luck finding a developer reference
« Last post by kdub on May 15, 2022, 05:52:34 PM »
fwiw:

I've downloaded the ObjectARX SDK and use the help from the Docs folder.

Copied and renamed the ones I use most.
The arxref.chm is handy as well.

. . but I do use this often . .
https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-C3F3C736-40CF-44A0-9210-55F6A939B6F2


I've been away from cad for a few years, so everything helps :0
Pages: [1] 2 3 ... 10