- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun c:APV (/ ss1 Lastent TargEnt TargLayer undo obj ss of en pt ent)
(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)
)
Hello I need some help please. I have put together this code here. the working principles of this is to do the following
Select all objects layer
Offset distance =
Select all objects layer
Offset distance =
Offsets are done in and out of every layer that is selected at the required offset distance.
Boundary command is done to work out the internal boundary of area selected
Continue onto the next boundary to select
when exiting the command the offsets that were produced are deleted the only thing to remain is the boundary lines
But there is a bit of a problem with this command as shown below
as you can see the boundary that was created in pink did not consider the white polyline in this boundary. So I thought then the polylines that are offset should be a closed shape but I dont know how to do that in lisp so if anyone knows how to do this that would be great.
I found this
which I used and it is really good but it needs to close these objects automatically without me selecting anything.
I appreciate any help that can be given I appreciate it might not be possible.
Cheers
Solved! Go to Solution.