(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