Jump to content

All Activity

This stream auto-updates

  1. Today
  2. pergolaPanels.dwg Attached.
  3. rsdonna

    TCOUNT for multileaders

    Sure, here is a sample of what I'll have in my drawings. In my drawings I'll have maybe 50 mleaders like these and I'm looking for a way to be able to pick them in order and then have it replace the -00 at the end with the sequential numbering. In TCOUNT I can pick what number I want it to start from and what the increment will be and then whether I want to overwrite, find and replace (which is what I need it to do), and also a prefix and a suffix option to place the text. Thanks for your help SAMPLE.dwg
  4. devitg

    TCOUNT for multileaders

    @rsdonna Ok , please upload your sample.dwg where you need to apply.
  5. Maybe upload the .dwg and some images of your plot settings.
  6. SLW210

    TCOUNT for multileaders

    Try something in this thread.
  7. SLW210

    nestedblock window

    It has more issues than Time magazine. Probably better rewriting something from scratch. I fixed the first 2 issues that came up, then there were more after that and I ran out of spare time to work on it. ;; This global list will store the clean names for selection (defun-q *block_name_list*) Was the error you mentioned. Once fixed more came up.
  8. Yesterday
  9. (setq plent (entsel "\nPick pline near end "))) (setq pt (cadr plent)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))) (setq obj (vlax-ename->vla-object plent)) (setq pt1 (vlax-curve-getstartPoint obj)) (setq pt2 (vlax-curve-getendPoint obj)) (setq d1 (distance pt pt1)) (setq d2 (distance pt pt2)) (if (> d1 d2)d (setq co-ord (reverse co-ord)) ) To reverse direction of a line or pline, "It is a task that takes 5 seconds." No its instant.
  10. pkenewell

    nestedblock window

    Yes - replace the following section of your code with my replacement. REPLACE THIS (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 )" ) WITH THIS (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" ")" ) ) The DCL and the LISP file must both be in an AutoCAD support path.
  11. jim78b

    nestedblock window

    But the dcl and lisp files must be in the same directory ?
  12. jim78b

    nestedblock window

    So i Will Copy your code in my lisp ?
  13. rsdonna

    TCOUNT for multileaders

    I don't have a TCOUNT lisp. TCOUNT is part of the express tools in AutoCAD. It's what I use when I'm going to renumber text or mtext. Unfortunately TCOUNT doesn't work in mleaders so I'm looking for a way to be able to do with mleaders what I do for text and mtext.
  14. devitg

    TCOUNT for multileaders

    @rsdonna, please upload your sample.dwg and the TCOUNT lisp
  15. 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" ")" ) )
  16. 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?
  17. jim78b

    nestedblock window

    Ai
  18. 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.
  19. pkenewell

    nestedblock window

    Because no credit was given to the Author in the code or your post.
  20. 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")
  21. jim78b

    nestedblock window

    sorry why?
  22. 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
  23. SLW210

    nestedblock window

    Where did you get the LISP?
  24. 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.
  25. 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; } } }
  26. 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 .
  27. 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?
  1. Load more activity
×
×
  • Create New...