Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/11/2025 in Posts

  1. 1 point
  2. 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.
    1 point
  3. 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)
    1 point
  4. 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.
    1 point
  5. 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
    1 point
  6. 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 point
  7. 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.
    1 point
  8. 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) )
    1 point
  9. I do not see any screen shots. Current Build [9.3.1.1] (The current build is always under development. It is where we add new features for testing. It's usually very stable, but may contain a few bugs.) Did you try the stable version? Stable Build [9.1.5.2] (The stable build has all the known bugs worked out, but may not be as up-to-date as the current build.) According to the response on the OpenDCL forum, those sub menus do not exist. Serious UI Failure in OpenDCL Studio - 'Options' and 'New Project' Menus are Mis As far as I can tell, AutoCAD 2021 was the first version for Windows 11, so there could be issues there.
    1 point
  10. @rlx will definitely have a look at it, your dcl stuff is great. One thing you can do is unzip a zip file using lisp, so could have all the files and a DAT file and save them to a known directory, as part of my Install.lsp it adds the support paths and load the toolbar. The reason for comment was I used CIV3D so I had a custom menu that had often used Civ3D commands, this saved having to change workspaces. You just have to open the CUI and copy the commands to say notepad.
    1 point
×
×
  • Create New...