Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/06/2021 in all areas

  1. @k88 Updated my above post to explain a little better.
    1 point
  2. Within the *error* function, try changing: (and rng (vlax-release-object rng)) (mapcar (function (lambda (obj) (and obj (vlax-release-object obj))))(list cell rng wBook xlApp)) (gc) To: (foreach obj (list cell rng wBook xlApp) (and (eq 'VLA-OBJECT (type obj)) (vl-catch-all-apply (function vlax-release-object) (list obj)) ) ) (gc)(gc) also include this: (vlax-invoke-method xlApp 'EnableEvents :vlax-false) after creating the excel application object (setq xlapp(vlax-get-or-create-object "Excel.Application"))
    1 point
  3. The (while) loop just allows you to continue selecting polylines until you hit enter and entsel returns NIL. (while (setq en (entsel "\nSelect an Entity: ")) ;; Do soemthing for each selected entity... ) ;; End while when en variable is NIL (user pressed enter instead of selecting another entity). The (vl-remove-if 'not) function is used to filter out the NIL values after (mapcar) is used to get the DXF code 10 (the vertices) from all the other entity codes returned by the (entget) function. The (mapcar) statement returns nils for anything that is not DXF code 10 and stacks them into the list. Here is an example to show you how this works: Command: (setq el (entget (car (entsel)))) Select object: ((-1 . <Entity name: 2015a32b6d0>) (0 . "LWPOLYLINE") (330 . <Entity name: 2014eac42d0>) (5 . "1D15") (100 . "AcDbEntity") (67 . 1) (410 . "Sheet1") (8 . "0") (100 . "AcDbPolyline") (90 . 4) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 3.91426 4.38087) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 5.66079 6.03297) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 8.18059 4.83386) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 10.5804 6.29943) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0 1.0)) Command: (setq elx (mapcar '(lambda (x) (if (= 10 (car x))(cdr x))) el)) (nil nil nil nil nil nil nil nil nil nil nil nil nil nil (3.91426 4.38087) nil nil nil nil (5.66079 6.03297) nil nil nil nil (8.18059 4.83386) nil nil nil nil (10.5804 6.29943) nil nil nil nil nil) Command: (vl-remove-if 'not elx) ((3.91426 4.38087) (5.66079 6.03297) (8.18059 4.83386) (10.5804 6.29943)) EDITED: To better explain
    1 point
  4. I am in awe of the coding of Lee Mac. I rarely understand all of the details but he always gets to a solution that works.
    1 point
  5. You need to dig into the entity 330 two times as far as I remember to reach the gems in the bottom of the ocean.
    1 point
×
×
  • Create New...