Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/12/2023 in all areas

  1. You could try with random drawing of rectangles desired width and length, but to fit, so that runnings from left to right and from bottom to top match... Here is my code, but you'll have to draw samples manually... And in fact everything should be orthogonal... https://www.theswamp.org/index.php?topic=53697.0 (you have to be logged at theswamp.org to access...)
    2 points
  2. Could you draw a small sample of the result you're going for? I think yes, it's doable. Quite a challenge though
    1 point
  3. This is how I would approach, just the way I like to do it rather than using ssdel (setq selection (ssget (list (cons 0 "TEXT")))) this will only pick "Simplenotes" ie Text. (setq selection (ssget (list (cons 0 "*TEXT")))) should pick Text & Mtext. (setq selection (ssget (list (cons 0 "*TEXT")(cons 8 "Yourlayer")))) should pick Text & Mtext by layer. (if (= selection nil) (alert "no objects selected") (repeat (setq x (sslength selection)) (setq txt (cdr (assoc 1 (ssname selection (setq x (1- x)))))) ..... write to file ) ; end repeat Does this work in Drafsight, should return something like this. #<VLA-OBJECT _Application 000000002CA7D018> this would mean can write to Excel direct no need for a csv. (princ (vlax-get-or-create-object "excel.Application"))
    1 point
  4. Where you using this as your example? ronjonp is using ssget with "X" option that select everything with out using mouse clicks. Your using ssget with the ":L" option that requires you to select things with your mouse. meaning the selection has all the entity's + the last point picked with the mouse and is shown like this when processed thought only (mapcar 'cadr This means it will try enget on everything in that list. <Entity name: 384ff500> - ok <Entity name: 384ff180> - ok <Entity name: 384ffb40> - ok (0 (12762.6821816407 3114.44834460322 0.0)) - errors here You have to wrap the mapcar to remove any lists (aka point data) in the list so your only left with entity names. (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) TLDR; (foreach e (mapcar 'cadr (ssnamex s)) - use only with SSGET "X" (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) - use with all other ssget --edit using (command deselects things so if you had stuff selected before running the command it won't be anymore and will have to re select everything. use the following to avoid (command allowing you to have things selected before you use the command. (vl-load-com) (vla-startundomark (setq Drawing (vla-get-activedocument (vlax-get-acad-object))) ... code (vla-endundomark Drawing)
    1 point
  5. Maybe just burst everything? http://www.lee-mac.com/upgradedburst.html
    1 point
  6. The easiest and fastest functions that you can read about, are nentsel & nentselp which should be a good way to work directly with nested objects even nested into nested.
    1 point
  7. Q1. probably not what you want but create small squares 80x80 & create a grid over the polyline. then use the following lisp. ;;----------------------------------------------------------------------;; ;;DELETE ALL outside Polyline (defun C:PCross (/ SS1 SS2 coords) (setq SS1 (ssget)) ;Select everything (if (setq SS (ssget "_+.:E:S" '((0 . "*POLYLINE")))) ;select polyline (progn (setq coords (vl-remove-if 'not (mapcar (function (lambda (p) (if (= 10 (car p)) (cdr p)))) (entget (ssname SS 0))))) (setq SS2 (ssget "_CP" coords)) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS2))) (ssdel ent SS1) ) ) ) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS1))) (entdel ent) ) (princ) )
    1 point
×
×
  • Create New...