Recent Posts

Pages: 1 ... 7 8 [9] 10
81
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. )
82
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  :
84
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.
85
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.
86
.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!!
87
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
88
.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
89
.NET / I'm not having any luck finding a developer reference
« Last post by Rustabout on May 15, 2022, 05:04:13 PM »
I can easily 'Google' my way to the Developer 'Guide' but I'm finding it to be far from thorough. It feels harder and harder each year to find anything on Autodesks sites. Any good links? Even a book.
90
AutoLISP (Vanilla / Visual) / Re: Layer on and off button
« Last post by abe123456789 on May 15, 2022, 12:20:50 PM »


ronjonp code is what im looking for it is so simple.
Any recommendations on what books to learn active x ?


I currently have
Autocad Platform customization - Lee ambrosius
Visual Lisp Developer bible - David Stein
The language and its development enviroment - Reinaldo N. Togores

Thank you mhupp

Pages: 1 ... 7 8 [9] 10