Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/07/2022 in all areas

  1. Give this a shot and let me know. (defun c:Test ( / int sel ent get str brk pos inc) ;;------------------------------------------------------------;; ;; Author: Tharwat Al Choufi - Date: 07.Apr.2022 ;; ;; website: https://autolispprograms.wordpress.com ;; ;;------------------------------------------------------------;; (and (setq int -1 sel (ssget "_X" '((0 . "TEXT") (1 . "(FIG 2-##),(FIG 2-###),FIG 2-##,FIG 2-###")))) (while (setq int (1+ int) ent (ssname sel int)) (and (setq get (entget ent)) (setq str (cdr (assoc 1 get)) brk (wcmatch str "*)") pos (vl-string-search "-" str) ) (or (< (setq inc (atoi (substr (if brk (vl-string-trim ")" str) str) (+ pos 2)))) 47) (and (setq inc (1+ inc)) (entmod (subst (cons 1 (strcat (substr str 1 (1+ pos)) (itoa inc) (if brk ")" ""))) (assoc 1 get) get)) ) ) ) ) ) (princ) ) (vl-load-com)
    2 points
  2. The overall length is 72'-0" from the center of the left most column to the center of the right most column PLUS and additional 2"-8" x 2 (5'-4" total) from the center of those same columns to the edge of the slab. Total distance, as accepted by Penn-Foster, then comes to 77'-4". I've seen P-F also accept an overall length of 72'-0" but that requires a deviation to the flared supports at each end to achieve. Remember... you are NOT being taught structural engineering; you are being taught AutoCAD.
    1 point
  3. No problem - I might grab this code too, might come in useful later If I did that I would make a couple of small changes perhaps. Splitting it into 2 routines, the first one for the user to enter the 'prefix' (in this case 'FIG 2-'), the start number (in this case, 47) and perhaps the increment (+1), and then passing that to the other routine would make it more flexible, and doing it that way, text based, it would also work in a batch for me.
    1 point
  4. Thanks for your time to help resolve my issue.. Tharwats code is working for me .. but I was getting a blank “inspect” error.. so it was no help tracking down my mistakes.. thanks again
    1 point
  5. I have just tried your code quickly and it appears to work for me, though it was just a quick test. Anything FIG 2-47 or greater gets incremented by 1. Note that I used the code below, which might not be your complete code of course - all I did was add a defun at the start and localised the variables So I will ask you a question back, what is the problem with what you are doing? and are there any error messages as you run your routine - helps narrow down why it is not working. (defun c:testthis ( / allt fignum Turbos1 I tst ter terr terrF terr3 front wire back div gage newfig newfigu elist ) (vl-load-com) (setq allt (ssget "X" '((0 . "text")))) (setq I -1) (while (setq fignum (ssname allt (setq I (1+ I)))) (setq Turbos1 (cdr (assoc 1 (entget fignum)))) (setq tst (wcmatch Turbos1 "*FIG 2-??*")) (if (= tst T) ;if no.1 (progn (setq ter (vl-string-search "-" turbos1)) (setq terr (+ ter 2)) (setq terrF (+ ter 1)) (setq terr3 (+ terr 2)) (setq front (strcase (substr Turbos1 1 terrF))) (setq wire (strcase (substr Turbos1 terr 2))) (setq back (strcase (substr Turbos1 terr3))) (setq div (atoi wire)) )) ;end Progn, end if no.1 (if (>= div 47) ;if no.2 (progn (setq gage (+ div 1)) (setq newfig (rtos gage 2 0)) (setq newfigu (strcat front newfig back)) (setq elist (entget fignum)) (setq elist (subst (cons 1 newfigu)(assoc 1 elist) elist)) (entmod elist) (entupd fignum) )) ;end progn, end if no.2 ) ; end while )
    1 point
  6. mhupp use bpoly rather than boundary Like you polygon is different in Bricscad, I uses a check for acadver and use wcmatch so basically do like 3 lines instead of 1. ACADVER = "22.0 BricsCAD" (read only)
    1 point
×
×
  • Create New...