Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/09/2024 in all areas

  1. @mhupp The arrow key codes (char 37-40) - at least on my keyboard - only work in the context of the number pad when number lock of OFF. The separate arrow keys return nothing to grread; no code 2, no char. data.
    1 point
  2. I made some comments on your code. It does work but could be made more efficient. However the main point it does work, and I'll often leave things at that rather than spending hours optimising code to save milliseconds. The 'nil' report is just the LISP telling you that there is no result from the LISP. You could put this at the end (princ) which makes the LISP exit quietly. You could see the LISP reporting something by putting for example 'a' as the last line. So some comments I'd make: (defun c:zoo () ;; I'd use (defun c:zoo ( / ) - easier to check if you have localised variables (if (setq a (entlast)) ;; OK, check there is a Last Entity (while (setq b (entnext a)) ;; after (entlast) there should be no entnext (setq a b) ) ;; Add comment here "End While" - longer codes makes modification easier ;; Add here what happens if there is no 'entlast' ) ;; Add comment here "End if" - as above (setq ent (entget a)) (setq po (assoc 10 ent)) (setq pt (cdr po)) ;; Could combine this line to the po line above (setq po (cdr (assoc 10.... ))) (command "zoom" "c" pt 50 "") ;; Add here (princ) to exit quietly (no 'nil' after ending the code) ) Following your code format I'd do something like this (defun c:zoo ( / a pt) ;; Localise variables in case other LISPS use the same (especially common ones like pt) (if (setq a (entlast)) (progn ; If 'a' found (setq pt (cdr (assoc 10 (entget a)))) ;; Get point (command "zoom" "c" pt 50) ;; Zoom to point ) ; end progn (progn ; if 'a' not found ;; If 'a' not found (princ "\nNo entity found") ;; Report that 'a' not found ) ; end progn ) ; end if (princ) ; exit quietly ;;change this to pt to see effect of LISP reporting something (zooming point) )
    1 point
  3. AutoCAD Structural Detailing was retired a while ago, you should move to something newer. AutoCAD Structural Detailing discontinued (autodesk.com) Lots of add-ons for AutoCAD as well. IIRC there are Excel solutions as well. The main thing is gathering the information to input into the program. You might look on YouTube for some videos, being this is old program, would have been a long time ago for any tutorials, maybe look through old Autodesk University material, maybe there was a coarse on this back when it was newer.
    1 point
  4. Do a google "programs for reinforced concrete autocad lisp" you will be swamped with answers some free some you have to pay for.
    1 point
  5. The easiest answer is to use layouts then you process in layout order. As part of making layouts you draw a rectang at desired scale around objects then layouts are made automatically based on the rectang. Each layout has the title block at 1:1 scale ie true size like A2 but the mview reflects the objects at desired scale. Remove the line (setq lst (BubbleSort lst)) from the code. when asked to select titles pick them one at a time in the order you want and it should work. The issue with do in view order is what about using horizontal titles, a grid of titles, random placement of titles. Yes adding a extra attribute is one way around the problem. But for me use layouts. You will not look back.
    1 point
  6. I also found this article...https://download.autodesk.com/us/support/files/gsg_asd_reinforcement.pdf And this thread...
    1 point
  7. No clue on ASD either except AutoCAD Structural Detailing. Wasn't very long ago that someone asked the same thing, there are several threads on this already. Find those threads and read through them, come back here and ask specific questions and post a .dwg and all other relevant information.
    1 point
  8. BBS: Bar Bending Schedule? (I am electrically biased so a guess here) As BigAl suggests a table or example drawing might help
    1 point
  9. This is my attempt at your task. Remembers last dia used. Adds circle matching bottom Quadrant point. (defun c:DG ( / diameters ans radius pt ) (setq diameters (list "Choose diameter" "3/8" "1/2" "5/8" "3/4" "7/8" "1" "1 1/4" "1 3/8" )) ; List of diameters (if (not AH:Butts)(load "Multi radio buttons.lsp")) ; loads the program if not loaded already (if (= lastBarDiameter nil)(setq lastBarDiameter 1)) ; this is needed to set default button (setq ans (ah:butts lastBarDiameter "V" diameters)) (setq lastBarDiameter but) ;; Store the last entered bar diameter ;; Set the layer based on the bar diameter (cond ((= but 1) (setq radius 0.375)(if (not (tblsearch "layer" "B3")) (command "LAYER" "M" "B3" "C" "10" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 2) (setq radius 0.5)(if (not (tblsearch "layer" "B4")) (command "LAYER" "M" "B4" "C" "14" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 3) (setq radius 0.625)(if (not (tblsearch "layer" "B5")) (command "LAYER" "M" "B5" "C" "30" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 4) (setq radius 0.75)(if (not (tblsearch "layer" "B6")) (command "LAYER" "M" "B6" "C" "40" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 5) (setq radius 0.875)(if (not (tblsearch "layer" "B7")) (command "LAYER" "M" "B7" "C" "50" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 6) (setq radius 1.0)(if (not (tblsearch "layer" "B8")) (command "LAYER" "M" "B8" "C" "70" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 7) (setq radius 1.25)(if (not (tblsearch "layer" "B9")) (command "LAYER" "M" "B9" "C" "99" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ((= but 8) (setq radius 1.375)(if (not (tblsearch "layer" "B10")) (command "LAYER" "M" "B10" "C" "110" "" "L" "CONTINUOUS" "" "p" "n" "" ""))) ) (setq radius (/ radius 2.0)) ;; Draw the circle at the specified point (setq pt (getpoint "\nSpecify the bottom point for the circle:")) ; Prompt for bottom point (setq pt (mapcar '+ pt (list 0.0 radius 0.0))) (command "circle" "_non" pt radius) ;; Set the current layer to 0-35 (or any default layer you want) ;(setvar "clayer" "0-35") ;; Clean exit (princ) ) Make sure you save Multi radio buttons in a support path or add the full path to the (load "Multi... Multi radio buttons.lsp
    1 point
  10. Since AutoLISP lists are stored as singly-linked lists in memory (whereby each element is a pair consisting of a value (car) and a pointer to the next pair (cdr), with the last pair containing a null pointer), using cons to push an item onto a list is a very efficient operation, as a new cons pair can simply point to the previous head of the list. Whereas, to append an element to the end of the list, the interpreter must traverse the entire linked list and point the last element to the newly appended element. As such, the performance of cons will not be impacted by the list length, whereas the performance of append will worsen by a factor of the list length.
    1 point
×
×
  • Create New...