Jump to content

Leaderboard

Popular Content

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

  1. Thanks a lot for the tip! There are many things I don't know yet, I'm still learning, although I will soon be 66 years old.
    2 points
  2. In the latter option, the dotted line indicates the direction along a given angle, rather than following the cursor. I apologize, but I and the author of the topic are Russian speakers, so I will repeat the answer in Russian. В последнем варианте пунктирная линия указывает направление по заданному углу, а не бегает за курсором.
    2 points
  3. There is a slightly more optimised way to set and reset variables once you get more than about 2 or 3: ;;Include near the beginnin of the code: (setq vars '("CMDECHO" "NOMUTT" "SNAPANG")) ;; Variables to change as a list (setq old_Vars (mapcar 'getvar vars)) ;; get existing variable values (mapcar 'setvar vars '(0 1 1)) ;; set variables to new values (in order of the list above) ;;Reset the variables (mapcar 'setvar vars old_Vars) Change to suit.
    2 points
  4. This work after add these lines (defun LM:roundm (n m) (* m (fix ((if (minusp n) - +) (/ n (float m)) 0.5))) ) Elevationpoint_New 2.lsp
    2 points
  5. Added some convenience: (defun c:11 (/ p0 ang dist) (defun 11error (errormsg /) (setvar "SNAPANG" old_snapang) ; reset variables (setvar "ORTHOMODE" old_orthomode) (setq *error* temperr) ; reset *error* (prompt "\nFunction Canelled.") ) (vl-load-com) (setq p0 (getpoint "Pick the first point >") ang (angtof (rtos (getreal "Enter angle >")) 0) ) (setq Old_snapang (getvar "SNAPANG")) ; to record what it was, might not be 0 (setq old_orthomode (getvar "ORTHOMODE")) (setq temperr *error*) ;store *error* ; can wait till here to set error function, after recording old variables (setq *error* 11error) (setvar "SNAPANG" ang) (setvar "ORTHOMODE" 1) (setq dist (distance p0 (getpoint p0 "Pick a second point >"))) (setvar "SNAPANG" Old_Snapang) ; moved this here, seto to old value (no assumption what it was) (setvar "ORTHOMODE" old_orthomode) (entmakex (list (cons 0 "LINE") (cons 10 p0) (cons 11 (polar p0 ang dist)))) (setq *error* temperr) ; reset error (princ) )
    2 points
  6. open up bother versions in their own notepad or similar and compare them side by side - a good way to learn, spot the difference and consider what was done and why?
    1 point
  7. Speed is always a compromise between loading and running the automation and doing it manually. For example if I had routines that I used once a year that took 1/10th second to load each then it might not be optimistic to load them on every drawing. If I had routines that I used in virtually every drawing then even that 1/10th second each it is well worth loading them, BigAl usually has to hand or in his memory a line that loads a LISP on command, so you could type in '30' if the command isn't loaded then it is loaded. Makes opening drawings quicker (I think you need the LISPs in a trusted file location?).
    1 point
  8. Run in vlide etc can see where error occurs.
    1 point
  9. So how far through the routine does it go before the error occurs?
    1 point
  10. Small change I'd make, (defun c:11 (/ p0 ang dist) (defun 11error ( errormsg / ) (setvar "SNAPANG" old_snapang) ; reset variables (setq *error* temperr) ; reset *error* (prompt "\nFunction Canelled.") ) (vl-load-com) (setq p0 (getpoint "Pick the first point >") ang (angtof (rtos (getreal "Enter angle >")) 0) ) (setq Old_snapang (getvar "SNAPANG") ) ; to record what it was, might not be 0 (setq temperr *error*) ;store *error* ; can wait till here to set error function, after recording old variables (setq *error* 11error) (setvar "SNAPANG" ang) (setq dist (distance p0 (getpoint p0 "Pick a second point >"))) (setvar "SNAPANG" Old_Snapang) ; moved this here, seto to old value (no assumption what it was) (entmakex (list (cons 0 "LINE") (cons 10 p0) (cons 11 (polar p0 ang dist)))) (setq *error* temperr) ; reset error )
    1 point
×
×
  • Create New...