Jump to content

Leaderboard

Popular Content

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

  1. Hello friends, Running a forum like this often feels like a long-running battle against those who would like to deface or destroy what we do here. From time-to-time we need to change the way we operate to stay one step ahead of the hackers and haters. From today, the way you login to this forum will change. Historically, you've been able to login using your screen name and password. The problem with this approach is that your screen name is publicly available, so all a hacker has to do is to find your password. From today, you will not be able to login using your screen name, you will need to use the email address associated with your account. Since your email address is not publicly available, this change presents a significant defense against hackers. If you already login using your email address, you do not need to change the way you login. We recommend that you always use a strong password to avoid your account being hacked.
    3 points
  2. Like this ! (setq ss (ssget "_:L" '((0 . "TEXT,MTEXT"))))
    3 points
  3. ;Sum of numbers (setq ents (ssget)) ;; Get all the text entities (setq sum nil nums nil ) (setq count1 0) (while (< count1 (sslength ents)) (setq nums (cons (atof (cdr (assoc 1 (entget (ssname ents count1))))) nums)) ;; Insert the value of the text into a list (setq count1 (1+ count1)) ) (setq sum (apply '+ nums)) ;; Add them all (entmake (list (cons 0 "TEXT") (cons 1 (rtos sum)) (cons 10 (getpoint)) (cons 40 (getvar "TEXTSIZE")))) ;; Make a single line that will be placed at the cursor Here is my solution. If anyone that sees this has a better solution, feel free to correct me. Hope that helps!
    2 points
  4. Don't need to limit things not no locked layers since your just reading the values, and (0 . "TEXT,MTEXT") can be shorted to just (0 . "*TEXT") This will allow you to select any text. it will only add up text that is only numbers. since distof will only work if the string is only numbers. ;;----------------------------------------------------------------------------;; ;;Sum of selected text that is only numbers (defun C:foo (/ sum ss) (setq sum 0) (setq SS (ssget '((0 . "*TEXT") (1 . "*#*")))) (foreach text (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (if (setq x (distof (cdr (assoc 1 (entget text)))) (setq sum (+ x sum)) ) ) ) (entmake (list (cons 0 "TEXT") (cons 1 (rtos sum 2 3)) (cons 10 (getpoint)) (cons 40 (getvar "TEXTSIZE")))) (princ) )
    1 point
  5. That method of breaking the loop worked beautifully. Found the break immediately. Strange, because I was able to fill the polygon with HATCH, which to me indicated that there was no break! Many thanks Steven P
    1 point
  6. I did not post anything but thought about it, make sure line/pline are filleted, then make a circle at end pt, use this with intersectwith to get the 2 points intersecting, can use these points to work out the rest. (ssget pt) etc. Just a suggestion. Oh yeah a thought a pline&line join together, a line&line again join, then only need 1 routine as its always a pline corner.
    1 point
  7. Yes, you can use fields so block 2 attribute has the value from a block 1 attribute. You can not cheat and copy the 2 blocks as the field is hard coded for the very 1st attributes picked. Is this for title blocks say copied in multi layouts have something else to do that. "Update atts all layouts.lsp"
    1 point
  8. this is where getdist shines (setq dist (getdist "\nEnter distance")) you can enter 200, 200", 16'8", or pick points with a mouse.
    1 point
  9. A variable is set to the value implied a real, integer or string so (setq dist 200) is just that 200 as a value, if you want it to be inches you need to work with all variable in same units, if you are calculating in feet then need to do (setq dist (/ 200 12.)) note the "." so get a real answer not an integer answer.
    1 point
×
×
  • Create New...