Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Upload another example file to see what it looks like. But I'm afraid it can't be done easily, because you have to choose a reference point for the base block, and then rearrange the other blocks to be at equal distances. If you want to select "n" blocks, what can be a reference point from that selection set, which block? Also, they have different insertation points.
  3. Now it works perfectly
  4. This is an example of what Plate 2 of the Penn-Foster structural project would look like.
  5. understood, but i have more than 10000 numbers for each CAD file
  6. @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.
  7. Do it row by row, not selecting everything.
  8. 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.
  9. 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.
  10. 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)
  11. 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.
  12. 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
  13. 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...
  14. 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))
  15. 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)?
  16. 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
  17. You have to add a form to work on. DCLStudio.mp4
  18. 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.
  19. 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)
  20. 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.
  21. 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.
  22. @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.
  23. Yesterday
  24. 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
  25. 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.
  26. 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.
  1. Load more activity
×
×
  • Create New...