Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/16/2022 in all areas

  1. (defun c:APV (/ ss1 Lastent TargEnt TargLayer undo obj ss of en pt ent) ;also always declare your variables (setq SS1 (ssadd)) (setq LastEnt (entlast)) (while (setq TargEnt (car (entsel "\nSelect object on layer to select: "))) (setq TargLayer (assoc 8 (entget TargEnt))) (sssetfirst nil (ssget "_X" (list TargLayer))) (defun *error* (msg) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE"))) (setq of (getdist "\nSpecify Offset Distance: "))) (progn (setq undo (not (vla-StartUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object) ) ) ) ) ) (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc)) (mapcar (function (lambda ( o ) (vl-catch-all-apply (function vla-offset) (list obj o) ) ) ) (list of (- of)) ) ) (vla-delete ss) (setq undo (vla-EndUndoMark doc)) ) ) ) (if (setq en (entnext LastEnt)) ;adds all offsets to SS1 (while en (ssadd en SS1) (setq en (entnext en)))) (while (setq pt (getpoint "\nPick internal point: ")) (command "_.-boundary" "_a" "_i" "_n" "" "" "_non" pt "") ) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS1))) (entdel ent) ) (princ) ) This is the Code that I am left with for anyone facing the same problem. Works well for me any further comments let me know
    1 point
  2. <> is the button up top will pop up another window to input the code so its easier to copy and scoll down as much. You have to have ss1 and Lastent outside of the while. they keeps getting reset every loop. so it will only pick up the entity's after that point. (defun c:APV (/ ss1 Lastent TargEnt TargLayer undo obj ss of en pt ent) ;also always declare your variables (setq SS1 (ssadd)) (setq LastEnt (entlast)) (while (setq TargEnt (car (entsel "\nSelect object on layer to select: "))) (setq TargLayer (assoc 8 (entget TargEnt))) (sssetfirst nil (ssget "_X" (list TargLayer))) (defun *error* (msg) As for ** Error: Automation Error. Invalid input ** I think its the circle trying to offset in but I'm going to guess the radius is smaller than 15 so radius would be negative and error. try using (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc)) (mapcar (function (lambda (o) (vl-catch-all-error-message ;won't display error messages of offset (function vla-offset) (list obj o) ) ) ) (list of (- of)) ) )
    1 point
  3. hello i want help for creating lisp for me please ... the lisp will do these functions 1- as the attached image (1a) if i have block with yellow at right and some green blocks 2- i want when i launch the lisp to ask me to draw poly line that i want as in image 2a 3- after that when i draw this path with polyline and press enter the lisp ask me to choose blocks that i want to connect to this polyline and i will choose one by one or multiple blocks then after choosing the blocks and press enter ... the lisp will offset the main polyline that i draw and connect every polyline with the basepoint of the blocks that i choose sequentially as appear in this image 5a (attached DWG) can anyone help me please sample.dwg
    -1 points
×
×
  • Create New...