Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/30/2020 in all areas

  1. It's currently setup so that if you select a blank area of the screen this is deemed the end of selection. This is the easiest way to control and exit the loop so you have to ensure the required text is inside the pick box. There are three options : 1. Increase the size of the pickbox and reset it on exit. (find a size that suits and eliminates miss picks) 2. Have it ask a "Select Another" question on every iteration of the loop. 3. Change the selection process completely to a selection set pick. This would work if all the TEXT or MTEXT you want to select were on the same layer and would also aleviate the need to check for duplicate entries, but could result in missed items with no way to check. I leave the decision up to you. It's late here so I'm off to bed, ansd will make any changes when I have time tomorrow morning.
    1 point
  2. Many thanks for the drawing, it was a big help. The problem was with the text width. It was picking up the width of the MTEXT text box, which I though I had accounted for. This should now work correctly. I was previously storing all the selected entities in a list to make deleting them easier. The lisp now checks any selected entity against the list. If you have already selected it a pop up alert will tell you it has already been selected. Hope this now works as you require. (defun rh:em_txt ( pt txt lyr sty tht xsf) (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 pt) (cons 1 txt) (if lyr (cons 8 lyr)) (if sty (cons 7 sty)) (if tht (cons 40 tht)) (if xsf (cons 41 xsf)) );end_list );end_entmakex );end_defun (vl-load-com) (defun c:t+ ( / *error* ent elst el num xsf tot nlst sel pt txt) (defun *error* ( msg ) (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred."))) (princ) );end_defun (while (not tot) (setq el (entget (setq ent (car (entsel "\Select First Text Number Entity : "))))) (cond ( (wcmatch (cdr (assoc 0 el)) "*TEXT") (cond ( (= (cdr (assoc 0 el)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")) xsf (cdr (assoc 41 el)))) (t (setq num (atof (getpropertyvalue ent "Text")) xsf 1.0)) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number")) (t (setq tot num))) ) (t (alert "Not a Text Entity")) );end_cond (cond (num (setq nlst (cons ent nlst)))) );end_while (while (setq sel (entsel "\nSelect Next Text Number Entity : ")) (setq elst (entget (setq ent (car sel)))) (cond ( (and (wcmatch (cdr (assoc 0 elst)) "*TEXT") (not (vl-position ent nlst))) (cond ( (= (cdr (assoc 0 elst)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")))) (t (setq num (atof (getpropertyvalue ent "Text")))) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number"))) ) ( (vl-position ent nlst) (alert "Already Selected")) (t (alert "Not a Text Entity")) );end_cond (if num (setq tot (+ tot num) nlst (cons ent nlst) num nil)) );end_while (cond (tot (setq pt (getpoint "\nSelect Total Insertion Point : ") txt (if (zerop (rem tot 1.0)) (rtos tot 2 0) (rtos tot 2 3)) );end_setq (rh:em_txt pt txt (cdr (assoc 8 el)) (cdr (assoc 7 el)) (cdr (assoc 40 el)) xsf) (if nlst (foreach o (mapcar 'vlax-ename->vla-object nlst) (vla-delete o))) ) );end_cond (princ) );end_defun
    1 point
  3. I have no idea why it is doing this. Save this as a sample.dwg in AutoCAD 2012 format and attach it to a post so I have something to test against and find out why this is happening. I think this could be a ucs problem.
    1 point
  4. The most popular configuration for a space frame is based on a pyramid cell, highlighted in red below. Is that what you seek to construct? If so create a simple single line rectangular 3D grid 60 x 60 x 36 and use it to layout your steel tubes.
    1 point
×
×
  • Create New...