Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. pkenewell

    nestedblock window

    @jim78b Then you should've just said that. Anyway - I think the problem is that you can't have a multi-line string like in your action tile statement, when there are parenthesis and other embedded code. Do this instead: ;; 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" ")" ) )
  3. Today
  4. I'm looking for a lisp that will allow me to do the exact same thing I do with TCOUNT but for multileaders. I have a drawing where I have mleaders going to many different lines and each has three lines of text. The first line has cable id and I want to be able to replace the last two characters of that line. In TCOUNT I would select each mtext object in order, have the count start at 1 and increase by 1 (1,1) and then I would have it find and replace the '0' I left at the end of each line with the sequential numbers created by TCOUNT. This is what I need to be able to do but on all the mleaders I have in this drawing. Anyone have something like this?
  5. jim78b

    nestedblock window

    Ai
  6. The accepted solution on that article is what I tried to do, although on MY properties pane, it doesn't allow me to change that visual style; it's locked. That's my problem. Why is it locked? Why can't I change it? How do I fix it? It's a dilemma.
  7. pkenewell

    nestedblock window

    Because no credit was given to the Author in the code or your post.
  8. pkenewell

    closed polyline with automatic hatch

    @masterfal First Check the HPLAYER and other HP... variables. These will make a hatch on a particular layer and other specifications regardless of what layer is set current. You have to set HPLAYER to blank (type in a "." for the setting). Look up HPLAYER in your help and it will explain. You can also set HPLAYER to the layer you want in code using (setvar "HPLAYER" "MyLayer")
  9. jim78b

    nestedblock window

    sorry why?
  10. I moved your thread to the AutoCAD Drawing Management & Output Forum. Try this solution... Solved: PLOTTING A VIEW OF 3D MODEL, HIDDEN VISUAL STYLE PLOTS IN COLOR - Autodesk Community
  11. SLW210

    nestedblock window

    Where did you get the LISP?
  12. I wasn't talking to you. I was asking the OP, if not mentioned by name or quoted it is presumed all over the internet the question is for the OP. But, I mentioned, no LISP needed if you are manually making a polyline, -Hatch with "draW boundary" option. I see no need for a LISP and you can also leave a polyline if needed.
  13. i have this code, but give me syntax error. i put all the files in the same dir. ;;----------------------------------------------------------------------;; ;; 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" "(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) here dcl file // nestedblocks.dcl // Defines the dialog box for the Interactive Nested Block Viewer NestedBlockViewer : dialog { label = "Interactive Nested Block Viewer"; // The window title // The list of blocks : list_box { key = "block_tree"; // An identifier for this list width = 60; height = 20; allow_accept = true; } // A row to hold our buttons : row { // New button to trigger the highlighting action : button { key = "highlight"; label = "Highlight Selection"; width = 20; fixed_width = true; } // Spacer to push the OK button to the right : spacer { width = 1; } // Standard OK button to close the dialog : ok_button { is_default = true; } } }
  14. This can be easily done, but, for that I need another example drawing from you or you can just play with that inside this part of code: (while (/= (cdr (assoc 0 data)) "SEQEND") (setq data (entget (entnext (cdr (assoc -1 data)))) tag_value (cdr (assoc 1 data)) val (append val (list (list tag_value block_name))) ) ) where you can add in variable "val" scale factor, rotation, etc. and implement inside this part of code: (command-s "-insert" block_name (list (+ (car npt) num) (cadr npt)) 1 0 (car (nth ct val))) instend of "1" and "0" (scale and rotation). Yes @BIGAL, I know for that and also thinked about that, but for that, the user need to clarify direction of drawed polyline and eventualy reverse the polyline to get right orded of the blocks. It is a task that takes 5 seconds. The "-insert" command are executed with the appropriate queries on my AutoCAD, so I can't say does it good or not. But, as always, thank you @BIGAL .
  15. masterfal

    closed polyline with automatic hatch

    Ahh i see.. i knew was going to be something like that, just couldnt work out exactly what to change. Works like a charm. Appreciate the help! one thing i just noticed though is its not actually drawing the hatch in the correct layer. its drawing the polyline in the correct layer (which gets removed at the end) but the layer the hatch is being put in is whatever layer is set in the hatch dialog box when you run the hatch command. basically just using the previous layer that was used when doing hatch. how can i fix so it drops the hatch into my specified layer?
  16. masterfal

    closed polyline with automatic hatch

    how am i creating polyline? what do you mean..? i just click the points where i want my polyline and c to close. isn't that how everyone does it? i need the hatch in specific hatch layer which would rarely be my current layer + the correct hatch pattern wont always be the last used so i thought setting a little routine that specifies layer and hatch pattern would be the quickest way. this way i just type plh, enter, click click click with mouse, c to close and thats it. surely thats gotta be quicker than running original -hatch and manually entering required hatch/layer types?
  17. It's been a LONG time since posting, so forgive me if I'm posting in the wrong section or whatnot. I've got a 3D drawing that I'm trying to plot using the HIDDEN visual style, but the properties window (when no objects are selected) is showing 2D Wireframe (and that is indeed what the drawing is showing as). How do I change the visual style in paper space to my desired style?? I searched the forum and didn't find anything on this one. Is it a system setting??? Please help. I've attached a photo of the properties box.
  18. Yesterday
  19. @Saxlle I realised should check which way line is drawn. So it will order based on end selected. A reverse of the block list where applicable. The "-insert" not sure if your missing, 1 1 0 the extra one, you can imply "S" 1 gets around the scale problem. command "-INSERT" blkname "s" 1 pt 0.0) I used copy so that the block is copied then don't need to worry about attributes.
  20. ...Continue from previous post, experiment with imperial multiplication. Phh ##******************************************************************************************** ## 41 UDF/ Excel name: impMul() - Imperial multiply (imperial * imperial), with optional ## arguments round off [rd_Off] and suppress trailing [suppress_trailing_label]. ## ## Note: This function uses todec() and toimpa as sub-functions. ## ## Notes with 2 input parameters - scenarios: ## ## [decimal] x [decimal] = return decimal value (just like normal multiplication) ## [decimal] x [imperial feet-inches (or vice versa)] = return (linear) feet-inches ## [imperial feet-inches] x [imperial feet-inches] = return decimal ft² (if less than 1 ft² ## return decimal in²) ## ## Optional number round off digits, applied for decimal ft² or decimal in² only. ## Optional suppress trailing (any character/number) = suppress label ft² or in² ## ## Rev. 1.0 - 7/23/2025 ##******************************************************************************************** =LAMBDA(varImp1,varImp2,[rd_Off],[suppress_trailing_label], LET(rd,IF(ISOMITTED(rd_Off),4,INT(rd_Off)), tr,IF(ISOMITTED(suppress_trailing_label),1,0), IF(AND(ISNUMBER(varImp1),ISNUMBER(varImp2)), varImp1*varImp2, IF(AND(ISTEXT(varImp1),ISTEXT(varImp2)), IF(ABS(todec(varImp1)*todec(varImp2))>=144, IF(tr=0,ROUND((todec(varImp1)*todec(varImp2))/144,rd),ROUND((todec(varImp1)*todec(varImp2))/144,rd)&" ft²"), IF(tr=0,ROUND((todec(varImp1)*todec(varImp2)),rd),ROUND((todec(varImp1)*todec(varImp2)),rd)&" in²")), toimpa(todec(varImp1)*todec(varImp2)) ) ) ) )
  21. @devitg Yours works great. the only thing I would like to add is to set a distance between blocks on the line, just like the copyblockstocurve has. @Saxlle Yours also works, but if block doesn't have scale uniformly set to 1, it asks to type scale, rotation and attribute value, and it goes block by block. Its unnessery.
  22. pkenewell

    closed polyline with automatic hatch

    @SLW210 That's true! the command could be boiled down to this below if you don't want a polyline boundary. However, the PLINE command has more options, and there are 2 extra returns that you have to press at the end to complete the command - that's why I would stick to the original. (defun C:PLH (/ e el) (command "._-hatch" "_Pro" "ANSI34" "10.0" "90" "_W" "_N") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (princ) )
  23. pkenewell

    closed polyline with automatic hatch

    @masterfal Simple - just replace the the options in the command statement for the -HATCH command ; Replace Hatch command line (command "._-hatch" "_pro" "_S" "_S" e "" "") with: (command "._-hatch" "_Pro" "ANSI34" "10.0" "90" "_S" e "" ""); where after "Pro" (properties), the arguments are [Pat. Name] [Scale] [Rotation]
  24. leonucadomi

    ATTDEF COUNT...help

    sorry , I will try to explain myself again the routine you created selects texts and attributes, that's excellent. What I would like you to show is... example: color green texts color yellow ATTDEF att That is, of the total number of selected objects, how many are texts and how many are ATTDEF , regardless of how many times its tags are repeated. another example: number of selected texts : 6 number of selected ATTDEF : 3 I needed Excel to account for them, but if all the amounts are shown here it is very helpful and Excel is not necessary. thanks
  25. I got it now, very fast double extend now. Current settings: Projection=UCS, Edge=None, Mode=Standard then Fence option. If I recall you used to be able to double extend with crossing as well. If I get time I'll dig a little deeper. You have to be careful any extra crossings will send the extend through the closed shapes.
  26. How are you creating the polyline? You can use -Hatch with the "draW boundary" option, just a few clicks for a solid hatch on current layer.
  27. My contribution, you can try it: (prompt "\nTo run a LISP type: CPBLK") (princ) (defun c:CPBLK ( / old_osmode old_attdia ent ptlist spt ept delta num_offset npt ss len i val data block_name data tag_value num ct) (setq old_osmode (getvar 'osmode)) (setq old_attdia (getvar 'attdia)) (setvar 'attdia 0) (setq ent (car (entsel "\nPick the LINE:\n")) ptlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent))) spt (vlax-curve-getStartPoint (vlax-ename->vla-object ent)) ept (vlax-curve-getEndPoint (vlax-ename->vla-object ent)) delta (- (car ept) (car spt)) num_offset (/ delta (length ptlist)) npt (getpoint "\Pick insertation point for new LINE:") ) (setvar 'osmode 0) (command-s "_LINE" npt (strcat "@" (rtos delta) "<" (itoa 0)) "") (setq ss (ssget "_F" ptlist (list (cons 0 "INSERT"))) len (sslength ss) i 0 val (list) ) (while (< i len) (setq data (entget (ssname ss i)) block_name (cdr (assoc 2 data)) ) (while (/= (cdr (assoc 0 data)) "SEQEND") (setq data (entget (entnext (cdr (assoc -1 data)))) tag_value (cdr (assoc 1 data)) val (append val (list (list tag_value block_name))) ) ) (setq i (1+ i)) ) (setq val (vl-remove-if-not '(lambda (x) (/= (car x) nil)) val) num 0 ct 0 ) (repeat (length val) (command-s "-insert" block_name (list (+ (car npt) num) (cadr npt)) 1 0 (car (nth ct val))) (setq num (+ num num_offset) ct (1+ ct) ) ) (setvar 'osmode old_osmode) (setvar 'attdia old_attdia) (prompt (strcat "\nCopied " (itoa (length val)) " blocks along path.")) (princ) ) and it looks like on the .mp4: Recording2025-07-24at08.56.33-ezgif.com-gif-to-mp4-converter.mp4
  28. Hi guys. It's been more than 10 years, but the problem/bug still occurs in AutoCAD 2025. However, after opening a thread in another Forum, I found a solution. Sharing with you here what worked for me. The bold text bug behaviour (that also occurs for other elements) was solved here by instead of printing directly from AutoCAD to the printer, first I PDF the drawing, and then I print from the PDF. This bug is being generated by the direct communication from AutoCAD to the Printer, but for some unknown reason, AutoCAD doesn't generate the same bug when the PDF printer is used. Cheers
  1. Load more activity
×
×
  • Create New...