All Activity
- Past hour
-
sorry why?
- Today
-
Visual Style Locked in Paper Space
SLW210 replied to Beeftimer's topic in AutoCAD Drawing Management & Output
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 -
Where did you get the LISP?
-
closed polyline with automatic hatch
SLW210 replied to james9710's topic in AutoLISP, Visual LISP & DCL
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. -
jim78b started following nestedblock window
-
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; } } }
-
Copy blocks to curve according to another curve
Saxlle replied to HypnoS's topic in AutoLISP, Visual LISP & DCL
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 .- 20 replies
-
- autolisp
- block position
-
(and 3 more)
Tagged with:
-
closed polyline with automatic hatch
masterfal replied to james9710's topic in AutoLISP, Visual LISP & DCL
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? -
closed polyline with automatic hatch
masterfal replied to james9710's topic in AutoLISP, Visual LISP & DCL
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? -
Beeftimer started following Visual Style Locked in Paper Space
-
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.
- Yesterday
-
Copy blocks to curve according to another curve
BIGAL replied to HypnoS's topic in AutoLISP, Visual LISP & DCL
@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 replies
-
- autolisp
- block position
-
(and 3 more)
Tagged with:
-
Excel VBA: 7 Functions for dealing with feet & inches in Excel
phuynh replied to phuynh's topic in .NET, ObjectARX & VBA
...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)) ) ) ) ) -
Copy blocks to curve according to another curve
HypnoS replied to HypnoS's topic in AutoLISP, Visual LISP & DCL
@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.- 20 replies
-
- autolisp
- block position
-
(and 3 more)
Tagged with:
-
closed polyline with automatic hatch
pkenewell replied to james9710's topic in AutoLISP, Visual LISP & DCL
@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) ) -
closed polyline with automatic hatch
pkenewell replied to james9710's topic in AutoLISP, Visual LISP & DCL
@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] -
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
-
How to Extend Lines to shape 2D Polyline
SLW210 replied to Mountain_XD's topic in AutoLISP, Visual LISP & DCL
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. -
closed polyline with automatic hatch
SLW210 replied to james9710's topic in AutoLISP, Visual LISP & DCL
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. -
Saxlle started following Copy blocks to curve according to another curve
-
Copy blocks to curve according to another curve
Saxlle replied to HypnoS's topic in AutoLISP, Visual LISP & DCL
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- 20 replies
-
- 1
-
-
- autolisp
- block position
-
(and 3 more)
Tagged with:
-
doraimom started following text prints out bold when its NOT bold
-
text prints out bold when its NOT bold
doraimom replied to happyunited's topic in AutoCAD Drawing Management & Output
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 -
masterfal started following closed polyline with automatic hatch
-
closed polyline with automatic hatch
masterfal replied to james9710's topic in AutoLISP, Visual LISP & DCL
Hi All, managed to tweak this code slightly so it draws into a specific layer and then removes the polyline at the end so you are just left with solid hatch. just wondering if i wanted to specify a certain hatch pattern instead of solid (eg ANSI34 with scale of 10 and angle of 90) how would i do that? (defun C:PLH (/ e el old_layer hatch_ent) ;; Store the current layer (setq old_layer (getvar "clayer")) ;; Set the desired layer for the polyline and hatch (command "._layer" "_m" "layernamehere" "") ; Create layer if it doesn't exist (command "._layer" "_s" "layernamehere" "") ; Set current layer (command "._pline") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (if (and (setq e (entlast)) ; 'e' now holds the entity name of the polyline (setq el (entget e)) (= (cdr (assoc 0 el)) "LWPOLYLINE") (= (logand (cdr (assoc 70 el)) 1) 1) ) (progn (command "._-hatch" "_pro" "_S" "_S" e "" "") (setq hatch_ent (entlast)) ; Get the entity name of the newly created hatch (entdel e) ; Delete the polyline using its entity name 'e' ) (princ "\nInvalid Polyline Created (Must be complete and Closed).") ) ;; Restore the original layer (command "._layer" "_s" old_layer "") (princ) ) -
" how many times each tag is repeated. " that is in the answer I provided. (("048" 1) ("047" 1) ("046" 1) ("045" 2) ("044" 1) ("043" 2) ("042" 1) ("041" 2) ("040" 1) ("039" 1) ("038" 2) ("037" 1) ("036" 2) ("035" 2) ("034" 6) ("033" 6) ("032" 6) ("031" 2) ("030" 2) ("029" 12) ("028" 6) ("027" 6) ("026" 23) ("025" 2) ("024" 4) ("023" 6) ("022" 6) ("021" 1) ("020" 1) ("019" 2) ("018" 2) ("017" 1) ("016" 1) ("015" 2) ("014" 6) ("013" 2) ("012" 2) ("011" 2) ("010" 1) ("009" 1) ("008" 1) ("007" 1) ("006" 4) ("005" 16) ("004" 1) ("003" 1) ("002" 1) ("001" 1)) change code at end add princ lst3 ) (princ lst3) (princ) ) I can do the send to excel if you want ? You have asked for text also can you post anther sample dwg with say both, text and Attdef. Will have a think about missing value.
-
var1, var2, and var3 should be "punto," "angulo," and "distancia"? So: angle and distance... between what objects?
-
Copy blocks to curve according to another curve
BIGAL replied to HypnoS's topic in AutoLISP, Visual LISP & DCL
You don't draw a line read the questions asked, pick the pline, pick the block, pick a point to draw the line & blocks and enter a gap distance between them say 1000. The line with copied blocks is automatically drawn. The line will be as long as there is blocks.- 20 replies
-
- 1
-
-
- autolisp
- block position
-
(and 3 more)
Tagged with:
-
How to Extend Lines to shape 2D Polyline
BIGAL replied to Mountain_XD's topic in AutoLISP, Visual LISP & DCL
Here is the help for Extend it has some variables you can set may be applicable for Acad. https://help.bricsys.com/en-us/document/command-reference/e/extend-command?version=V25&id=165079077042 - Last week
-
;BACALADO DE BILBADOOO (PLUS) (defun nqf (tuSS / i lista tipObj cant cad txs atts) (princ "\nNumero que falta") (terpri) (if tuSS (setq cant (sslength tuSS)) (progn (alert "No existe conjunto de seleccion o esta vacio") (exit) ) ) (princ "\nCantidad de textos seleccionados = ") (princ cant) (princ "\nLista de numeros faltantes") ;Pasar del SS a una lista de valores (setq i 0 txs 0 atts 0) (repeat (sslength tuSS) (setq tipObj (cdr (assoc 0 (setq le (entget (ssname tuSS i))))) num (atoi (cdr (assoc (if (= tipObj "TEXT") 1 2) le))) i (1+ i) lista (if (setq l (assoc num lista)) (subst (list num (1+ (cadr l))) l lista) (append lista (list (list num 1))) ) ) (if (= tipObj "TEXT") (setq txs (+ txs 1)) (setq atts (+ atts 1))) ) ;Imprimir los valores que no aparezcan (terpri) (setq i 1) (princ (strcat "\nLista de numeros existentes\n" (while lista (if (setq v (assoc i lista)) (setq cad (if (= (cadr v) 1) (if cad (strcat cad ", " (itoa (car v))) (itoa (car v)) ) (if cad (strcat cad ", " (itoa (car v)) "(" (itoa (cadr v)) ")") (strcat (itoa (car v)) "(" (itoa (cadr v)) ")") ) ) lista (vl-remove v lista) ) (princ (strcat "\nFalta el # " (itoa i))) ) (setq i (1+ i)) cad ) "\nTextos: " (itoa txs) "\nAtributos: " (itoa atts) ) ) (princ) ) (defun c:nqf nil (nqf (ssget '((0 . "TEXT,ATTDEF")))))