Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/29/2022 in all areas

  1. Try this, Note your dwg has offsets like 22 no where near 1/16 = 0.0625 need a real pline to test. (defun c:del116 ( / ent co-ord start end ss1 ss2 obj obj2 obj3 oldsnap) (setq ent (car (entsel "\nPick pline "))) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent)))) (setq obj (vlax-ename->vla-object ent)) (setq start (vlax-curve-getstartPoint obj)) (setq end (vlax-curve-getEndPoint obj)) (command "line" start end "") (setq obj2 (vlax-ename->vla-object (entlast))) (vla-offset obj2 0.0625) (setq obj3 (vlax-ename->vla-object (entlast))) (setq start (vlax-curve-getstartPoint obj3)) (setq end (vlax-curve-getEndPoint obj3)) (setq ss1 (ssget "F" (list start end) (list (cons 0 "LWPOLYLINE")))) (vla-offset obj2 -0.0625) (setq obj3 (vlax-ename->vla-object (entlast))) (setq start (vlax-curve-getstartPoint obj3)) (setq end (vlax-curve-getEndPoint obj3)) (setq ss2 (ssget "F" (list start end) (list (cons 0 "LWPOLYLINE")))) (if (and (= ss1 nil)(= ss2 nil)) (progn (alert "pline outside range") (vla-delete obj2) ) (progn (alert "pline within range") (command "erase" ent "") ) ) (setvar 'osmode oldsnap) (princ) )
    1 point
  2. A quick answer This will copy ' --TEXTSTRING-- ' to the clipboard and you can then paste to a spreadsheet from there, this is perhaps the simplest solution though having to manually paste to excel add a little work (can also paste to wherever you want with this, a text editor, word processor, another drawing or wherever. CAD is off today, Sunday, but I think if you create your text string with a tab character in between 'cells' it might paste them into new cells - not something I have done though. Not sure about multiple lines. (vlax-invoke (vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData) 'setData "TEXT" --TEXTSTRING-- ) You could also look at 'paste special' in excel, s there an option to paste CSV (comma separated values), and in that case you can create a temporary CSV file and paste that? Working with spreadsheets via AutoCAD.... a but tricky I understand but if you can save your text as a half way, like CSV it become a little easier but you need to do more work.
    1 point
×
×
  • Create New...