All Activity
- Past hour
-
Help with Penn Foster structural drafting plate 1
ReMark replied to JimJames1978's topic in Student Project Questions
- Today
-
AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
Tamim replied to Tamim's topic in AutoLISP, Visual LISP & DCL
understood, but i have more than 10000 numbers for each CAD file -
Function to calculate Mtext Justification based on Rotation
CivilTechSource replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
@BIGAL apologies if my query was not clear. I am trying basically to create the mtext around a house and I want the text justification to be relative to the points the user clicks. I think I will be approaching it using the three point system. e.g. if P1 & P2 angle is between between 270 to 90 then justification will be left and then check where p3 X,Y is relative to p1 X,Y to establish if top or bottom. Therefore it will be Top Left. -
AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
Saxlle replied to Tamim's topic in AutoLISP, Visual LISP & DCL
Do it row by row, not selecting everything. -
AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
Tamim replied to Tamim's topic in AutoLISP, Visual LISP & DCL
Thanks for the prog. However, this only works for a single X row. I need to select both top and bottom rows (like Y1 and Y2), and show the result below the image. -
Saxlle started following AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
-
AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
Saxlle replied to Tamim's topic in AutoLISP, Visual LISP & DCL
Hi @Tamim, Try with this: (prompt "\nTo run a LISP type: reara") (princ) (defun c:reara ( / old_osmode base_blk spacing ss base_blk_pt dist_blk_lst len i ins_pt dist n dist_n x_cord y_cord new_pt) (setq old_osmode (getvar 'osmode)) (setvar 'osmode 0) (setq base_blk (car (entsel "\nPick the base block:\n")) spacing (getreal "\nEnter the spacing:\n") ) (prompt "\nSelect BLOCK's:") (setq ss (ssget (list (cons 0 "INSERT"))) base_blk_pt (cdr (assoc 10 (entget base_blk))) dist_blk_lst (list) ) (if (ssmemb base_blk ss) (ssdel base_blk ss) ) (setq len (sslength ss) i 0 ) (while (< i len) (setq ins_pt (cdr (assoc 10 (entget (ssname ss i)))) dist (distance base_blk_pt ins_pt) dist_blk_lst (cons (list dist (ssname ss i)) dist_blk_lst) i (1+ i) ) ) (setq dist_blk_lst (vl-sort dist_blk_lst (function (lambda (x1 x2) (< (car x1) (car x2))))) n 0 ) (repeat (length dist_blk_lst) (setq dist_n (- (car (nth n dist_blk_lst)) spacing (* spacing n)) x_cord (- (cadr (assoc 10 (entget (cadr (nth n dist_blk_lst))))) dist_n) y_cord (caddr (assoc 10 (entget (cadr (nth n dist_blk_lst))))) new_pt (list x_cord y_cord) ) (command-s "_move" (cadr (nth n dist_blk_lst)) "" (cdr (assoc 10 (entget (cadr (nth n dist_blk_lst))))) new_pt) (setq n (1+ n)) ) (setvar 'osmode old_osmode) (prompt (strcat "\nThe " (itoa (length dist_blk_lst)) " are rearanged!")) (princ) ) See the following video how it works. Rearange blocks.mp4 Best regards. -
Break an object at 2 points and replace the properties of the line
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Unfortunately, the error remains ; error: too few arguments Maybe I messed up with localization? ; https://www.cadtutor.net/forum/topic/98693-break-an-object-at-2-points-and-replace-the-properties-of-the-line/ ; Break an object and use a different linetype ; Bu AlanH Sept 2025 (defun c:brkobjLocal ( /cenpt end1 end2 ent ent1 ent2 obj1 obj2 pt1 pt2 rad st1 st2 type ) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 512) (setq ent (entsel "\nPick object 1st point to break at ")) (setq ent1 (car ent)) (setq pt1 (cadr ent)) (setq pt2 (getpoint "\nPick second point ")) (command "_.break" pt1 pt2) (setq ent2 (entlast)) (setq type (cdr (assoc 0 (entget ent1)))) (setq obj1 (vlax-ename->vla-object ent1)) (setq st1 (vlax-curve-getstartPoint obj1)) (setq end1 (vlax-curve-getendPoint obj1)) (setq obj2 (vlax-ename->vla-object ent2)) (setq st2 (vlax-curve-getstartPoint obj2)) (setq end2 (vlax-curve-getendPoint obj2)) (if (or (= type "LINE")(= type "LWPOLYLINE")) (progn (command "_.line"end1 st2 "") (command "_.chprop" (entlast) "" "_LT" "DASHED" "_s" 10 "") ) ) (if (= type "ARC") (progn (setq rad (vlax-get obj1 'radius)) (setq cenpt (vlax-get obj1 'center)) (command "_.arc" end1 "_C" cenpt st2) (command "_.chprop" (entlast) "" "_LT" "DASHED" "_s" 10 "") ) ) (if (= type "CIRCLE") (progn (setq rad (vlax-get obj1 'radius)) (setq cenpt (vlax-get obj1 'center)) (command "_.arc" end1 "_C" cenpt st1) (command "_.chprop" (entlast) "" "_LT" "DASHED" "_s" 10 "") ) ) (princ) ) (c:brkobjLocal) -
Break an object at 2 points and replace the properties of the line
BIGAL replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Sorry my fault it has a typo I fixed code above There should be a space after the "/" was missing in code posted, I sort the variable names and put in code missed the needed space. (defun c:brkobj ( / cenpt end1 end2 ent ent1 ent2 obj1 obj2 pt1 pt2 rad st1 st2 type ) It has a linetype, and Linetype Scale so change both of those to suit. -
Break an object at 2 points and replace the properties of the line
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Thank You're absolutely right. I added _ (command "_.break" pt1 pt2) ............... (command "_.line" end1 st2 "") (command "_.chprop" (entlast) "" "_LT" "DASHED" "_s" 20 "") Unfortunately, I was unable to verify the operation of the code. ; error: too few arguments -
Break an object at 2 points and replace the properties of the line
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Thank This code deletes the line between points pt1 and pt2. But I need to leave this line between the points pt1 and pt2 and change the properties of the line to a dashed line... -
Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Missing
BIGAL replied to duke's topic in AutoLISP, Visual LISP & DCL
The developer reference refers to how to set the position of a dcl. in the current screen. Lee-mac has a great explanation of how to use it. I tried with a preset value of X&Y. https://www.lee-mac.com/dialogposition.html An example. I am running twin screens at 1920x1080 so the values below are screen on right with a Y value about 1/2 way up. (setq *screenpoint* '(2620 425)) (setq dcl_id (load_dialog fname)) (if (not (new_dialog "ddgetvalAH" dcl_id "" (cond ( *screenpoint* ) ( '(-1 -1) )))) (exit) ) To get a value, look at the X&Y of pos. (setq pos (done_dialog)) -
Break an object at 2 points and replace the properties of the line
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Thank The code works perfectly for straight sections. For circles and arcs, I would like to simply change the properties of the lines between points pt1 and pt2. There is no need to connect these points with a straight line. How can I set the scale for the line (LTSCALE 20)? -
Tamim started following AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
-
AutoLISP: Change Block Spacing in X-Direction (Row-Wise, No Y-Shift)
Tamim posted a topic in AutoLISP, Visual LISP & DCL
I need help with adjusting the X-direction spacing of multiple blocks (row-wise) in AutoCAD. The Y-position should remain unchanged. For example, the current spacing between blocks is 27 ft, but once I select all the blocks and input a new value like 23 or 24, the blocks should automatically update to the new spacing as per my requirement. BLK Sample.dwg -
mhupp started following Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Missing
-
Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Missing
mhupp replied to duke's topic in AutoLISP, Visual LISP & DCL
You have to add a form to work on. DCLStudio.mp4 -
Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Missing
duke replied to duke's topic in AutoLISP, Visual LISP & DCL
Claro, aquí tienes la traducción. Te ofrezco dos versiones: una más directa y otra un poco más conversacional, ideal para un foro de ayuda. Opción 1 (Traducción Directa) I'm a beginner with DCL, so I may not be able to give a very clear explanation. An AI helped me download OpenDCL. First, it helped me understand simple DCL (without a separate program), but I would like a more flexible way to manage a dialog box or window to my liking—to place it wherever I want on the screen. Simple DCL only allows it to be positioned in the center of the current window. But when I try to use OpenDCL, it appears as shown in the screenshots. According to the AI, it is supposed to look different, and for that reason, it can't help me learn how to create windows with it. Thanks for any help you can provide. Opción 2 (Versión más Conversacional para Foros) Hello, I'm new to DCL, so please bear with me if my explanation isn't perfect. An AI assistant helped me download OpenDCL. It first helped me understand basic DCL, but my goal is to have more control over dialog boxes, specifically to be able to place them anywhere I want on the screen. The standard DCL seems to lock the position to the center of the current window. The problem is, when I try to use OpenDCL, it shows up in the way you see in the screenshots. The AI told me this isn't how it's supposed to look, and because of this issue, it can't guide me on how to learn to create windows. Any help you could offer would be greatly appreciated. Thank you. -
Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Missing
duke replied to duke's topic in AutoLISP, Visual LISP & DCL
-
Break an object at 2 points and replace the properties of the line
BIGAL replied to Nikon's topic in AutoLISP, Visual LISP & DCL
For me if you have an object and use Break. When selecting the first point you get an entity name ie ent1 Select 2nd point and run break pt1 pt2 Ok the second entity is (entlast) so no need for ssget's etc When you break say line pline the new object is created in the same direction so the gap is join endpoint ent1 to startpoint ent2. But as mentioned a circle and an arc need a slight variation on this. But still have a start and endpoint. Oh yeah a circle needs to be selected in an anti clockwise direction. Clockwise gives a big arc. Yes a break in the arc of a pline is an interesting problem. Or worse a part arc and straight. ; https://www.cadtutor.net/forum/topic/98693-break-an-object-at-2-points-and-replace-the-properties-of-the-line/ ; Break an object and use a different linetype ; Bu AlanH Sept 20205 (defun c:brkobj ( /cenpt end1 end2 ent ent1 ent2 obj1 obj2 pt1 pt2 rad st1 st2 type ) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 512) (setq ent (entsel "\nPick object 1st point to break at ")) (setq ent1 (car ent)) (setq pt1 (cadr ent)) (setq pt2 (getpoint "\nPick second point ")) (command "break" pt1 pt2) (setq ent2 (entlast)) (setq type (cdr (assoc 0 (entget ent1)))) (setq obj1 (vlax-ename->vla-object ent1)) (setq st1 (vlax-curve-getstartPoint obj1)) (setq end1 (vlax-curve-getendPoint obj1)) (setq obj2 (vlax-ename->vla-object ent2)) (setq st2 (vlax-curve-getstartPoint obj2)) (setq end2 (vlax-curve-getendPoint obj2)) (if (or (= type "LINE")(= type "LWPOLYLINE")) (progn (command "line"end1 st2 "") (command "chprop" (entlast) "" "LT" "DASHED" "s" 10 "") ) ) (if (= type "ARC") (progn (setq rad (vlax-get obj1 'radius)) (setq cenpt (vlax-get obj1 'center)) (command "arc" end1 "C" cenpt st2) (command "chprop" (entlast) "" "LT" "DASHED" "s" 10 "") ) ) (if (= type "CIRCLE") (progn (setq rad (vlax-get obj1 'radius)) (setq cenpt (vlax-get obj1 'center)) (command "arc" end1 "C" cenpt st1) (command "chprop" (entlast) "" "LT" "DASHED" "s" 10 "") ) ) (princ) ) (c:brkobj) -
Multileader justify paragraph doesn't work
BIGAL replied to 3dwannab's topic in AutoCAD Bugs, Error Messages & Quirks
What does dumpit.lsp reveal it should show in the Textstring property TextString = "\\pxqc;This is a test of\\Psetting the text\\P to middle centre" The pxqc is centre justified, a pxql is left justified. You should have a copy of dumpit.lsp. -
Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Missing
BIGAL replied to duke's topic in AutoLISP, Visual LISP & DCL
Do you need to use OpenDCl or can normal DCL be used ? Maybe explain what your trying to do in the DCL. There is some very smart DCL builders that post here. -
Function to calculate Mtext Justification based on Rotation
BIGAL replied to CivilTechSource's topic in AutoLISP, Visual LISP & DCL
@CivilTechSource "spent time creating that polyline" one way out of making a pline around multi objects provided there are no gaps is to use BPOLY, draw a random pline around the objects, use BPOLY and pick a point between the dummy pline and the objects you should get two new plines, erase the dummy and new outer pline, but you have now a new boundary pline. Use say layiso first to limit objects and set a dummy layer. Need a real dwg to see what is going on. - Yesterday
-
Break an object at 2 points and replace the properties of the line
mhupp replied to Nikon's topic in AutoLISP, Visual LISP & DCL
So went ahead and joined my first part of mine and what Blackbox & Glavcvs posted. Can either run it by typing BD or BreakDash ;;----------------------------------------------------------------------------;; ;; Break Entities and changed layer, linetype, color (defun C:BD () (C:BreakDash) (princ)) (defun C:BreakDash (/ SS1 SS2 SS3 pt1 pt2 ent entdata newent) (setq SS2 (ssadd)) (while (setq SS1 (ssget "_+.:E:S" '((0 . "*LINE,CIRCLE,ARC")))) (setq ent (ssname SS1 0) pt1 (getpoint "Select the first break point: ") pt2 (getpoint "Select the second break point: ") LastEnt (entlast) ) (command-s "_.BREAK" ent pt1 pt2) (while (setq LastEnt (entnext LastEnt)) (ssadd LastEnt SS2) ) (setq SS3 (ssget "_W" pt1 pt2 '((0 . "LINE")))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS3))) (if (ssmemb ent SS2) (progn (entmod (append ent '((8 . "0") '(6 . "DASHED2") '(62 . 84)))) (entupd ent) ) ) ) ) (princ) ) And found Cab's post for break all objects -
3dwannab started following Multileader justify paragraph doesn't work
-
Multileader justify paragraph doesn't work
3dwannab posted a topic in AutoCAD Bugs, Error Messages & Quirks
Hi all, ACAD 2026 Issue: MLEADER text does not update when setting paragraph alignment to Justify in the editor. Steps to Reproduce: Create a MLEADER with text. Open the text in the MTEXT editor. Set the paragraph alignment to Justify. Close the editor. Expected: Text should be justified. Actual: Text remains left-aligned; Justify has no effect. -
try this : (defun Fill_Toolbar_Background (x- y- x+ y+ c / y vws bgf-fac delta-y) (setq y y- vws (getvar "viewsize") bgf-fac (/ 0.1 (/ (atof GrM-Button-Background-Fill) 100.0))) (setq delta-y (/ vws 1000.0)) (while (<= y y+)(grdraw (list x- y)(list x+ y) c)(setq y (+ y (* delta-y bgf-fac (/ vws start-viewsize)))))) did very little testing though... oh , about the 'duplicated' background fill , although there are two and the first could (should) have been deleted, it doesn't matter because lisp only evaluates the last version. Every new definition overwites the previous one.
-
Break an object at 2 points and replace the properties of the line
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
PS: Note that I have disabled (40 . 0.25) and (47 . 20) because they are rejected by most objects in your filter, and I haven't taken the time to find out which objects they actually apply to. -
Break an object at 2 points and replace the properties of the line
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Hi As @mhupp mentioned, there are extra 'quotes' marks in your code. Also, as Mhupp suggested, you can use the filter "_+.:E:S" to select the object to be cropped in a single step, and then implement it within a 'while' loop to repeat the operation as many times as needed. Putting all of this together, your code could look something like this: (defun c:Br2ptReplDash (/ ss pt1 pt2 ent entdata newent entUlt) (while (setq ss (SETVAR "NOMUTT" 1) ss (princ "\nSelect object to trim (RIGH CLICK to EXIT)...") ss (ssget "_+.:E:S" '((0 . "*LINE,POLYLINE,CIRCLE,ARC"))) ) (SETVAR "NOMUTT" 0) (setq entUlt (entlast)) (princ "\nSelect the object to split: ") (setq ent (ssname ss 0)) ;; Entering the first break point (setq pt1 (getpoint "\nSelect the first break point: ")) ;; Entering the second break point (setq pt2 (getpoint "\nSelect the second break point: ")) ;; Checking the object type and performing the split (cond ((= (cdr (assoc 0 (entget ent))) "LWPOLYLINE") ;; break the LWPOLYLINE (command "_.BREAK" ent pt1 pt2) ) ((= (cdr (assoc 0 (entget ent))) "LINE") ;; break the line (command "_.BREAK" ent pt1 pt2) ) ((= (cdr (assoc 0 (entget ent))) "POLYLINE") ;; break polyline (command "_.BREAK" ent pt1 pt2) ) ((= (cdr (assoc 0 (entget ent))) "CIRCLE") ;; break the circle (command "_.BREAK" ent pt1 pt2) ) ((= (cdr (assoc 0 (entget ent))) "ARC") ;; break the arc (command "_.BREAK" ent pt1 pt2) ) (T (prompt "An object of an unsupported type.") ) ) (command "_.LINE" pt1 pt2 "") (if (not (equal entUlt (entlast))) (progn (entmod (append (ENTGET (ENTLAST)) '((8 . "0") ; the default layer (6 . "DASHED2") ; line type ;'(70 . 0) ;(40 . 0.25) ; thickness ;(47 . 20) (62 . 84) ) ) ; LTSCALE ) (princ "\nProcess completed for these objects") (vlr-beep-reaction) ) (princ "\n*** The operation could not be performed ***") ) ) (if (not entUlt) (princ "\nObjects are not selected.")) (princ) )