Jump to content

Leaderboard

Popular Content

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

  1. 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.
    2 points
  2. 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
  3. Still working on a expanded excel library functions so could do select text then select cell and it will PUT value direct not using clipboard. Stumbled on real nice get cell address. So if say make a list or selection set of text could do a multi PUT. For multi need extra question go right or down. Watch this space, very close. This is Acad / Bricscad asking excel to select a range and return the cell range. Big thanks to FIXO code unfortunately no longer with us did lots of excel stuff. So the get from is done Importing X and Y Coordinates for Custom made blocks from excel. - Autodesk Community - AutoCAD https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/importing-x-and-y-coordinates-for-custom-made-blocks-from-excel/td-p/11373585
    1 point
  4. FYI if you don't release "htmlfile" it could so some funky things after multiple copies. ;;MP ;;http://www.theswamp.org/index.php?topic=21764.msg263322#msg263322 (defun _GetClipBoardText( / htmlfile result ) (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'GetData "Text")) (vlax-release-object htmlfile) )
    1 point
×
×
  • Create New...