Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/01/2023 in all areas

  1. (command "_.text" "_j" "_m" "_non" (list 0.0 0.0 0.0) "1.0" "0.0" "lalalalala") (setpropertyvalue (entlast) "WidthFactor" 0.7)
    1 point
  2. Untested, but it should work... (defun c:polys2regs ( / ss i poly lay reg regx) (if (setq ss (ssget "_:L" '((0 . "*POLYLINE") (-4 . "&=") (70 . 1)))) (repeat (setq i (sslength ss)) (setq poly (ssname ss (setq i (1- i)))) (setq lay (cdr (assoc 8 (entget poly)))) (if command-s (command-s "_.REGION" poly "") (vl-cmdf "_.REGION" poly "") ) (setq reg (entlast)) (entupd (cdr (assoc -1 (entmod (subst (cons 8 lay) (assoc 8 (setq regx (entget reg))) regx))))) ) ) (princ) ) HTH. M.R.
    1 point
  3. If you use Notepad ++ it has a inbuilt Lisp check so can see start and end ( ) very helpful. Notepad++ is free. Also has a run lisp code from Notepad++.
    1 point
  4. I use entmod to change things. you don't have to mess with osnaps it should be faster then using command ;;----------------------------------------------------------------------;; ;; Change Elevation of selected items (defun C:ELV (/ SS) (or (setq *elv (vlax-ldata-get "Set" "Elevation")) (setq *elv 5.0)) ;Change 5.0 to your default (if (setq elv (getreal (strcat "\nSpecify Elevation <" (rtos *elv) ">: "))) (vlax-ldata-put "Set" "Elevation" elv) ;saves new elevation to drawing file to be called next time the command is (vlax-ldata-put "Set" "Elevation" (setq elv *elv)) ;stores old elevation ... ) (While (setq SS (ssget)) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (entmod (mapcar '(lambda (a) (if (member (car a) '(10 11 12 13 14 15 16 17 18)) (list (car a) (cadr a) elv) a ) ) (entget e) ) ) ) ) (princ) )
    1 point
  5. @Guspar. see it (defun C:move-to-elevation () (setq ss (ssget)) (setq elevation (getreal "the elevation")) (setq osmode (getvar 'osmode)) (setvar 'osmode 0) (command "move" ss "" '(0 0 0) (list 0 0 elevation)) ; just set the dstination point (setvar 'osmode osmode) (princ) )
    1 point
  6. think OP wants something like this (an oldie from Fixo i believe) (vl-load-com)(defun C:demo (/ blockdata blockdef blockname blockref en ent tmp) (if (setq ent (entsel "\n >> Select a block instance >>")) (progn (setq en (car ent) blockref (vlax-ename->vla-object en) blockname (vla-get-effectivename blockref) blockdef (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) blockname) ) (if (equal :vlax-true (vla-get-hasattributes blockref)) (progn (foreach attrib (vlax-invoke blockref 'GetAttributes) (vlax-for item blockdef (if (equal (vla-get-objectname item) "AcDbAttributeDefinition") (progn (if (equal (vla-get-tagstring attrib) (vla-get-tagstring item)) (progn (setq tmp (list (vla-get-promptstring item) (vla-get-tagstring attrib) (vla-get-textstring attrib))) (setq blockdata (cons tmp blockdata)) ) ) ) ) ) ) (setq blockdata(reverse blockdata) ) (foreach lst blockdata (princ (strcat "\n Prompt: " (car lst) " *** Tag: " (cadr lst) " *** Value: " (last lst))) ) ) ) ) (princ "\n >> Nothing selected. Try again...") ) (princ) ) (prompt "\n >> Type DEMO to execute..." ) (prin1) found it here
    1 point
×
×
  • Create New...