Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/02/2021 in all areas

  1. I can't remember why I did it this way, but on my PDF routine I added a date and time stamp using: (setq myfilename --filepatgh and filename-- ) (setq myfilename (strcat myfilename " [" (menucmd "M=$(edtime,$(getvar,date),DD-MO-YY)") " " (menucmd "M=$(edtime,$(getvar,date),HH-MM-SS)") "]" )) Will it work using that and inserting the whole filepath and filename instead of suffixing the time and date?
    1 point
  2. untested (defun c:t5 (/ ss l c d) (setq c (vla-get-Blocks (setq d (vla-get-ActiveDocument (vlax-get-acad-object))))) (princ "\nSelect blocks to reset props to ByBlock") (if (and (setq ss (ssget '((0 . "INSERT")))) (setq l (ss->ol ss))) (foreach o l (mapcar '(lambda (n) (vlax-for x (vla-item c n)(vla-put-Color x 0) (vla-put-linetype x "ByBlock") (vla-put-Layer x "0") (vla-put-Lineweight x -2)(vla-put-EntityTransparency x "ByBlock"))) (nb o)))) (vla-regen d acAllViewports) (princ) ) ;;; selectionset to (object) list (defun ss->ol (ss / i l) (setq i 0) (repeat (sslength ss) (setq l (cons (vlax-ename->vla-object (ssname ss i)) l) i (1+ i))) l) ;;; test if object is block and return name / effective name : (block-n (vlax-ename->vla-object (car (entsel)))) (defun block-n (o) (if (and (= 'vla-object (type o))(eq (vla-get-objectname o) "AcDbBlockReference")) (if (vlax-property-available-p o 'EffectiveName)(vla-Get-EffectiveName o)(vla-Get-Name o)) nil)) ;;; nested block names : test : (nb (vlax-ename->vla-object (car (entsel "\nSelect block: ")))) (defun nb ( b / c l n) (or c (setq c (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object))))) (vlax-for o (vla-item c (block-n b)) (if (and (eq "AcDbBlockReference" (vla-get-ObjectName o)) (not (member (setq n (block-n o)) l)))(progn(setq l (cons n l))(nb o))))(cons (block-n b) l))
    1 point
  3. Unable to figure it out Why not on layer "Image", have a look at (setq ss (ssget "X" '((0 . "IMAGE")))) you can then either entmod (assoc 8 or use (vla-put-layer I dont use often maybe even (setpropertyvalue ent "layer" "IMAGE")
    1 point
  4. Look into Strlen and Substr with those 2 lisp commands can do what you want. (setq dwgn (getvar 'dwgname)) (setq len (strlen dwgn)) your turn substr https://www.afralisp.net/reference/autolisp-functions.php
    1 point
×
×
  • Create New...