Jump to content

Leaderboard

  1. GLAVCVS

    GLAVCVS

    Community Member


    • Points

      3

    • Posts

      673


  2. eldon

    eldon

    Trusted Member


    • Points

      1

    • Posts

      4,338


  3. Steven P

    Steven P

    Trusted Member


    • Points

      1

    • Posts

      2,826


  4. Stefan BMR

    Stefan BMR

    Community Member


    • Points

      1

    • Posts

      492


Popular Content

Showing content with the highest reputation on 04/14/2025 in all areas

  1. @EIA You can use a dynamic block. А-А.dwg
    1 point
  2. PEDIT command has the option to revert the polyline. However, you have to run the lisp once, then, if require revert, you have to UNDO the lisp, revert the polyline, then run the lisp again. IMO, the chainage lisp should decide the starting point based on the selection point.
    1 point
  3. Also: I suggested you enter the height with 'getint'. I think it's better to use 'getreal' so you can enter decimals if necessary. So, maybe you should change it.
    1 point
  4. Another important thing to note: you must enter the value of 'a' by pressing ENTER, not RIGHT CLICK, so that the code can enter the GRREAD loop. Otherwise, you would have to add 12 to the '(5 3)' list, but the '...(RIGHT CLICK for exit)...' function would be disabled. GRREAD is like this
    1 point
  5. As StevenP says, to request any parameter from the keyboard, consider the following: -If it's an integer: 'getint' -If it's a decimal number: 'getreal' -If it's a text string: 'getstring' The advantage of using 'getint' or 'getreal' (as appropriate) is that the function itself will prevent the user from entering data that doesn't match the expected type. However, if you use 'getstring', any data entered will be considered a text string and will need to be converted. In this case, if the user had mistakenly entered a string beginning with a non-numeric character (for example, "y734"), converting it with 'atoi' or 'atof' would return 0. Therefore, it's advisable to use the 'get...' functions appropriately.
    1 point
  6. Looking at that code... you have the function LM:nest-list, which I suppose is originally LM:flatten. But anyway, you only have the function definition defun, you never actually invoke the function. I rewrote the code a little in such a way that the function is invoked. See if this helps you further. (defun c:test ( / ps k pl u r r1 m dists maxDist mP) ;;;;;;;;;;;;;;;;;;;;;;;code above (setq ps '((2398.08 1991.12 0.0) (2399.02 1992.25 0.0) (2398.11 1991.16 0.0 2398.08 1991.12 0.0) (2398.14 1991.12 0.0) (2399.06 1992.22 0.0 2399.09 1992.26 0.0))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;nested list convert into non-nested list ;; https://www.lee-mac.com/flatten.html ;; Flatten List - Lee Mac ;; Transforms a nested list into a non-nested list (defun LM:flatten ( l ) (if (atom l) (list l) (append (LM:flatten (car l)) (if (cdr l) (LM:flatten (cdr l)))) ) ) (setq k (LM:flatten ps )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;nested list convert into point list (setq pl '()) (setq u 0) (repeat (/ (length k) 3) (setq r (nth u k)) (setq r1 (nth (+ u 1) k)) (setq pl (reverse (cons (list r r1) pl))) (setq u (+ u 3)) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;point sort by distance min to max (setq m '(2398.0882 1991.0917)) ;; :referance point which use find the distsnce point is constant. ; Initialize distances list (setq dists (list)) ; Calculate the distances from the reference point to each check point (foreach a pl (setq dists (cons (distance m a) dists)) ) (setq maxDist (apply 'max dists)) (setq mP (nth (vl-position maxDist dists) pl)) ;; print results: (princ "\n") (princ mP) (princ ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sort fourth and fifth point tobe use for next activity ...
    1 point
  7. Tip: use getint instead of getstring (for integers) or getreal for real numbers
    1 point
  8. I don't know what the official explanation would be, but I think that you have got AutoCAD confused. I think that hatching was never originally intended to show actual tiles, but was intended to flood an area with a simulation of the appearance. So the dimensions of the hatch NET, for example, is curious and you have found that you need to apply an irrational scale factor of 188.97638. This gives AutoCAD a computational task. Then there is the spacing of the edges of the Grass Roads. If one sets the length precision to 6, then one sees that the spacing and widths of the Grass roads is not exact (3599.999999). This also gives AutoCAD a computational task. So combined with the previous, AutoCAD forgets where it is occasionally, hence the gaps. The difference in length by 0.000001 is enough to have a line or not. What I have done in the accompanying picture is to first of all make the dimensions of the Grass roads a multiple of 600.00000000. Then I used a hatch pattern that I wrote. It gives a tile of 1 by 1 dimension, so is easy to scale up to 600 by 600 tile. This then seems to work. Hatch pattern *TILE11, tile 1 by 1 0, 0, 0, 0, 1 90, 0, 0, 0, 1 *
    1 point
  9. You have many posts so you should know by now all the functions required, so have a go. pick text then atoi (while pick text next number check is 2 or 3 digits <10 <100 so pad with "0" update text entmod or vlax-put 'textstring ) end while
    1 point
×
×
  • Create New...