Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/10/2020 in all areas

  1. Assoc is simply a function to catch the first item within a list of lists, and returning that list. For instance, (setq lst (list '("one" 1 2 3) '("two" 4 5 6) '("three" 7 8 9) '("four" 10 11 12) ) ) If you run (assoc "two" lst), you'll get ("two" 4 5 6) The same is with an entity. If you run (entget <line entity>), entget returns a list of dotted pairs like: '( (0 . "LINE") (8 . "0") (10 3.0 6.0.0) (11 23.4 15.6 0.0) (62 . 1) ... and many more ) Which is why if you run (assoc 10 (entget <line>)), you'll get (10 3.0 6.0 0.0) Then (cdr) of that list is simply (3.0 6.0 0.0) denoting the start point.
    1 point
  2. I don't really recommend that practice because, especially since you're using the command in the while loop, it will slow AutoCAD down. Plus, if you don't set your object snap off, that point might snap to another point if there are other objects nearby. If you still insist, then you can insert the following lines right after your command line: (vlax-curve-GetStartPoint (entlast)) (vlax-curve-GetEndPoint (entlast)) Plus, to append to a list, I would do: (setq pts (cons (list startpt endpt) pts)) And at the end of your while loop, do: (setq pts (reverse pts))
    1 point
  3. Be careful but you can use regedit and search to find the answer. Mine returned Australia.
    1 point
  4. Perhaps (getvar "Locale")? If what you are wanting is the Language, then The AutoCAD setting would be the same would it not? In my system it is: (vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\User Profile" "Languages") EDIT or this? (vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International\\" "LocaleName")
    1 point
  5. If it's me, like what dlanorh says, I will rotate it. I'd set the rotation of the block at (- (angle intersectionpt endpt) (* 0.5 pi)) And endpt can be found using (if (equal intersectionpt startpt 1e-8) endpt startpt), so line direction doesn't matter.
    1 point
  6. Text & MText: (ssget "_C" p1 p2 '((0 . "TEXT,MTEXT"))) Everything else: (ssget "_C" p1 p2 '((-4 . "<NOT") (0 . "TEXT,MTEXT") (-4 . "NOT>")))
    1 point
  7. You don't need to mirror the block, just rotate it pi radians (180degrees). If you know the insertion point and the end of line 2, you can test if the angle (line1 ip) Line2 ip) (end line2) is clockwise or ccw. Depending on result rotate or not. This code function by Gilles will test whether the angle is clockwise or ccw. It requires 3 points in order of the direction. (defun gc:clockwise-p ( p1 p2 p3 ) (< (sin (- (angle p1 p3) (angle p1 p2))) -1e-14))
    1 point
×
×
  • Create New...