Jump to content

All Activity

This stream auto-updates

  1. Today
  2. SLW210

    TCOUNT for multileaders

    You still haven't provided the before and after drawing or the steps you want.
  3. I finally got it to act as you say. I'll see if I have time a little latter to work on it. Do you still have the original with the dimension text?
  4. SLW210

    nestedblock window

    You failed to fix the very first part I told you was giving that error. It should be setq. ;; This global list will store the clean names for selection (defun-q *block_name_list*) Should be ... (setq *block_name_list*)
  5. jim78b

    nestedblock window

    Sorry for late reply but i have problem with my internet connection. i tried to modify the lisp but give me syntax error, sorry. ;;----------------------------------------------------------------------;; ;; SNB_Select.lsp ;; ;; ;; ;; Interactively select and highlight nested blocks from a dialog. ;; ;; ;; ;; Depends on the updated `nestedblocks.dcl` file. ;; ;; ;; ;; To Run: APPLOAD -> Load File -> Type "SNB_SELECT" in the command. ;; ;;----------------------------------------------------------------------;; ;; This global list will store the clean names for selection (defun-q *block_name_list*) ;; Recursive function to populate the dialog list and our background list (defun FindAndListNestedBlocks (blkname level visited) (if (not (member blkname visited)) (if (tblsearch "BLOCK" blkname) (progn (setq visited (cons blkname visited)) ; Add current block to visited list (setq ent (tblobjname "BLOCK" blkname)) (setq ent (entnext ent)) (while ent (setq edata (entget ent)) (if (= "INSERT" (cdr (assoc 0 edata))) (progn (setq nested_blkname (cdr (assoc 2 edata))) (setq indent (make_string (* level 2) 32)) ;; Add the formatted name to the visible list box (add_list (strcat indent "|-- " nested_blkname)) ;; Add the clean name to our background list (setq *block_name_list* (append *block_name_list* (list nested_blkname))) ;; Recurse for the next level (FindAndListNestedBlocks nested_blkname (+ level 1) visited) ) ) (setq ent (entnext ent)) ) ) ) ) ) ;; Main command function (defun c:SNB_SELECT (/ sel edata blkname dcl_id selected_index ss) (princ "\n--- Interactive Nested Block Viewer ---") (setq sel (entsel "\nSelect a parent block to inspect: ")) (if sel (progn (setq dcl_id (load_dialog "nestedblocks.dcl")) (if (not (new_dialog "NestedBlockViewer" dcl_id)) (exit) ) (setq edata (entget (car sel))) (setq blkname (cdr (assoc 2 edata))) ;; Initialize the background list with the top-level block (setq *block_name_list* (list blkname)) ;; Populate the visible list in the dialog (start_list "block_tree") (add_list blkname) (FindAndListNestedBlocks blkname 1 nil) (end_list) ;; --- Define Actions for Dialog Buttons --- ;; Action for the "Highlight Selection" button (action_tile "highlight" (strcat "(progn" " (setq selected_index (atoi (get_tile \"block_tree\")))" " (setq selected_block (nth selected_index *block_name_list*))" " (princ (strcat \"\nHighlighting all instances of: \" selected_block))" " (sssetfirst nil nil) ; Clear any previous selection grips" " (setq ss (ssget \"_X\" (list (cons 0 \"INSERT\") (cons 2 selected_block) (cons 410 (getvar 'ctab)))))" " (if ss (sssetfirst nil ss)) ; Highlight all found instances in current space" ")" ) ) ;; Action for the OK button (and double-clicking a list item) (action_tile "accept" "(done_dialog)") ;; Display the dialog and wait for user action (start_dialog) (sssetfirst nil nil) ; Clear selection grips on exit (unload_dialog dcl_id) ) (princ "\nNo object selected.") ) (princ) ) (princ "\nLISP loaded. Type SNB_SELECT to run.") (princ)
  6. Mirrtext doesn’t have any influence on dims embedded in blocks only way to stop the mirroring is to use an attribute
  7. Yesterday
  8. What about MIRRTEXT variable it forces a flip mirror text. Worked as is for me Bricscad V25.
  9. BIGAL

    TCOUNT for multileaders

    Did you try what I posted ? Worked for me.
  10. Using APROPS at VLIDE I get this alert. Please route me where it shall be . I have the file , but VLIDE did not found "C:\Program Files\Common Files\Autodesk Shared\en-US\acadauto.chm"
  11. mirror is a very common command, especially for symmetric installations of asymmetric platforms, people tend to draw one side and then simply mirror to draw the other, alternative is to copy and then rotate, but this will be bay by bay and takes a lot longer than mirroring. Have you tried :- Inserting into another drawing Stretch the length using the dyn grips, you need to then to type regen to see the correct length (another downside of field vs dim) Delete block then insert from insert menu Drag onto a pallete and then open a new drawing and drag into new drawing (this causes a recover error when I do it) its great to know it works fine for you as none of us here find it stable . When I evaluate the formulae it responds with nonsensical data, see images attached.
  12. rsdonna

    TCOUNT for multileaders

    I gave this a try and I don't know if maybe I'm doing something wrong but it gave me something weird. It changed the end of the 1st line but it just gave me 0's instead of renumbering and then on the two middle mleaders it removed the "D" at the end of strand. Thanks for your help with this, really appreciate it!
  13. Why do you need to mirror? It works fine for me, even mirrored, you just have to RegenALL to get the new value. You could add a flip to the block.
  14. SLW210

    TCOUNT for multileaders

    You got lucky, stopped at work waiting on more information. I lightly tested this on your drawings. ;;; Sequential Numbering added to MLeader, Mtext and Text with Find and Replace. *| ;;; *| ;;; https://www.cadtutor.net/forum/topic/26420-tcount-in-a-multileader/#comment-648519 *| ;;; *| ;;; With help from: https://forums.augi.com/showthread.php?117315-Modify-text-in-multileader *| ;;; *| ;;; By SLW210 (Steve Wilson) *| ;;; *| ;;; No guarantees use at your own risk *| ;;; *| ;;; Original 07/29/2025 *| ;;; *| ;;; *| ;;; Thanks most to AlanJT, lpseifert and irneb (Where have y'all gone?) *| ;;; *| ;;;************************************************************************************************| ;;;************************************************************************************************| ;;; When asked for FIND/REPLACE, leave blank to skip. *| ;;; *| ;;; For MTEXT/MLEADER, enter All to apply the change to all lines, or specify a line number. *| ;;; *| ;;;************************************************************************************************| ;;;************************************************************************************************| (vl-load-com) (defun c:FnRSeq () (c:FindReplaceLineSeq)) ; Shortcut command (defun c:FindReplaceLineSeq (/ ss ent en_obj current_text entType findStr replaceBase lineNum lineNumStr lineList newLines idx replNum newVal i ) ;; Prompt for find text (setq findStr (getstring T "\nEnter FIND text: ")) (if (= findStr "") (progn (princ "\nFIND string cannot be empty.") (exit)) ) ;; Starting replacement number (setq replaceBase (getstring T "\nEnter starting REPLACE number (e.g. 01): " ) ) (if (not (numberp (read replaceBase))) (progn (princ "\nInvalid number. Exiting.") (exit)) ) ;; Prompt for line number (initget 1 "All") (setq lineNumStr (getstring "\nEnter line number for MTEXT/Multileader (or type 'All'): " ) ) (setq lineNum (if (wcmatch (strcase lineNumStr) "ALL") nil (atoi lineNumStr) ) ) ;; Get selection set (setq ss (ssget '((0 . "TEXT,MTEXT,MULTILEADER")))) (if (not ss) (progn (princ "\nNo valid text entities selected.") (exit)) ) ;; Initialize replacement counter (setq replNum (atoi replaceBase)) (setq idx 0) ;; Process each selected entity (repeat (sslength ss) (setq ent (ssname ss idx)) (setq en_obj (vlax-ename->vla-object ent)) (setq entType (cdr (assoc 0 (entget ent)))) (setq current_text (vla-get-TextString en_obj)) (setq newVal (strcat (substr "0000000000" 1 (- (strlen replaceBase) (strlen (itoa replNum))) ) (itoa replNum) ) ) ;; Process by entity type (cond ;; Plain TEXT ((= entType "TEXT") (vla-put-TextString en_obj (vl-string-subst newVal findStr current_text) ) ) ;; MTEXT or MULTILEADER ((or (= entType "MTEXT") (= entType "MULTILEADER")) (setq lineList (split-text-lines current_text)) (setq i -1) (setq newLines (mapcar (function (lambda (line) (setq i (1+ i)) (if (or (null lineNum) (= i (1- lineNum))) (vl-string-subst newVal findStr line) line ) ) ) lineList ) ) (vla-put-TextString en_obj (join-lines newLines "\\P")) ) ) ;; Increment counter and index (setq replNum (1+ replNum)) (setq idx (1+ idx)) ) (princ "\nSequential find & replace completed.") (princ) ) ;;;*************************| ;;; Functions | ;;;*************************| (defun split-text-lines (txt) (vl-remove-if 'null (parse txt "\\P")) ) (defun parse (str delim / result pos start) (setq start 1 result '() ) (while (setq pos (vl-string-search delim str (1- start))) (setq result (cons (substr str start (- pos start -1)) result)) (setq start (+ pos (strlen delim) 1)) ) (reverse (cons (substr str start) result)) ) (defun join-lines (lst sep) (if (null lst) "" (apply 'strcat (cons (car lst) (mapcar (function (lambda (s) (strcat sep s))) (cdr lst)) ) ) ) ) This LISP just does a Find and Replace Sequentially no Prefix/Suffix.
  15. SLW210

    TCOUNT for multileaders

    There was a link to a LISP at Autodesk forums as well. I have a few versions of my LISP as mentioned in that thread, I'll think about updating and altering one if I get time. I need a clearly explained before and after .dwg, just go through what you do in TCOUNT, better yet show it with TCOUNT on MText as well, even with your drawings as MText, I followed the steps you gave in your first post and do not get the results you ask for.
  16. Hi I developed a simple plan view of a decking unit with a custom dimstyle, lines/arrows suppressed so to show only the dim text, when the block was stretched the dim updated therefore indicting the length of panel required. We had big issues with this when mirroring as the text also mirrors, to overcome this I deleted the dimension and added a field with a formula, this overcame the mirroring problem. The problem is that the block always bugs out and shows #### instead of the result, it is not usable in any other drawings, also I have dragged this block onto my tool palette but when i try and insert into another blank drawing I get an error message:- Warning: An error occurred during save. We recommend that you run RECOVER on the drawing. I found a link on the Autocad support site that suggested changing UTC8 settings in windows regional settings, I have done this but the problem still persists. I am wondering is it because the field is in an Mtext box (so i can aply a backround) ? I have attached the drawing below that contains the troublesome block. _d-spans.dwg
  17. rsdonna

    TCOUNT for multileaders

    I tried CopyText and MTMTMLT. I found CopyText great as it is something that I will end up using quite a bit since I have to copy text to multiple mleaders sometimes, but neither of the ones I tried did what I was looking for unfortunately. MTMTMLT only adds the sequential numbering at the end and doesn't let me replace what I have in the text as a place holder. What I need replaced is always at the end of the first line and since I have multiple lines of text sometimes it doesn't work with the numbering being added at the end of all the text
  18. Not that I know of, you'll need to CHSPACE them back to do that. For dimensioned details like that I use the SOL commands (solview+soldraw and solprof) or if you have it VIEWBASE.
  19. SLW210

    TCOUNT for multileaders

    I linked several LISPs in that thread, which ones did you try?
  20. Last week
  21. BIGAL

    TCOUNT for multileaders

    I guess look for newline then work backwards two characters. Try this. (defun c:wow ( / num str str1 str2 newstr obj len ) (setq num (getint "\nEnetr start number ")) (while (setq ent (entsel "\nPick Mleader - Enter to stop. ")) (setq obj (vlax-ename->vla-object (car ent))) (setq str (vlax-get obj 'textstring)) (setq pos (vl-string-position 92 str)) (if (= pos nil) (progn (setq len (strlen str)) (if (< num 10) (setq newstr (strcat (substr str 1 (- len 2)) "0" (rtos num 2 0))) (setq newstr (strcat (substr str 1 (- len 2)) (rtos num 2 0))) ) ) (progn (if (< num 10) (setq newstr (strcat "0" (rtos num 2 0))) (setq newstr (rtos num 2 0)) ) (setq str1 (strcat (substr str 1 (- pos 2)) newstr)) (setq str2 (substr str (+ pos 1))) (setq newstr (strcat str1 str2)) ) ) (vlax-put obj 'textstring newstr) (setq num (1+ num)) ) (princ) )
  22. I just realized something that I forgot. There's a huge difference between Layout 1 and the rest of the layouts, and that is that I've used the CHSPACE command to pull the objects through to the paper space on those subsequent layouts. So that would be why they're showing correctly on the first layout, but not on the subsequent ones (because they are no longer INSIDE the viewport). But still, is there a way to show those as hidden after I've done that?
  23. Interesting article, and it seems to be directed at my problem, but it doesn't work. It did point me to an observation, though... the subsequent layouts (Layout 1 (2), Layout 1 (3)...) are all copies of Layout 1. However, Layout 1 is the only layout that is showing properly as hidden. The rest show as 2D wireframe and you cannot change the visual style on any of them and even Layout 1 shows 2D Wireframe under the properties pane, though the model looks like it's in Hidden style on that layout. Also, in the article, they say to change the Shaded Plot setting, but in the image, they're changing the Visual Style setting, so that's a little confusing; mine doesn't even show a shaded plot setting (EDIT: the shaded plot setting appears when clicking on the viewport... disregard). It's making it difficult to build this thing from the plans, that's for sure, but it's just something that I designed to put together and sell if it looks nice enough. It's not a HUGE deal, but if you can figure it out, that would be cool. I used to be the CAD guy at my job years ago, but this one has me stumped.
  24. jim78b

    nestedblock window

    Ok thanks tomorrow when i have time i Will test .thanks very much
  25. rsdonna

    TCOUNT for multileaders

    I did. I had found it before and it is great just doesn't do exactly what i need. I can use it to add the numbering at the end but if I need to renumber then it won't work the way I need it to. Thank you for this.
  26. rsdonna

    TCOUNT for multileaders

    This is great. Is there a way to have it still do this if there are multiple lines of text in the mleader? I still have the wire name at the top line always but sometimes add 1 or 2 additional lines with other info about that wire. Thanks for your help. SAMPLE.dwg
  27. SLW210

    nestedblock window

    I forgot to post the fix. (setq *block_name_list*) I don't recall the second error.
  28. SLW210

    TCOUNT for multileaders

    Did you try the codes in the thread I posted?
  1. Load more activity
×
×
  • Create New...