Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/28/2024 in all areas

  1. Let me start by posting this; it's the lego blocks you need to create the layer with the properties you asked for. If somebody wants to write a function to extract that data from other entities... feel free ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; CREATE LAYER with color / also true color ;; transparency. ;; Taken from Steven P, I presume from a Lee Mac function. ;; https://www.cadtutor.net/forum/topic/85796-select-all-layer-turn-to-color-252/#findComment-640849 (defun LM:setlayertransparency ( lay trn / ent ) (defun LM:trans->dxf ( x ) (logior (fix (* 2.55 (- 100 x))) 33554432) ) (if (setq ent (tblobjname "layer" lay)) (progn (regapp "accmtransparency") (entmod (append (entget ent) (list (list -3 (list "accmtransparency" (cons 1071 (LM:trans->dxf trn)) ) ; end list ) ; end list ))) ; end entmod ) ; end progn ) ; end if ) ; end defun ;; (LM:setlayertransparency Layname (atoi xxx) ) ;; test, create earth cable layer (defun c:test_cl ( / ) (_create_new_layer_ "mynewlayer3" ;;name '(178 254 1) ;;color (yellowy green) "Center" ;;ltype 1 ;;plot ) ;; set to 70% transparency (LM:setlayertransparency "mynewlayer3" 70 ) (_create_new_layer_ "mynewlayer4" ;;name 15 ;;color "continuous" ;;ltype 1 ;;plot ) )
    1 point
  2. or if your asking how to snap to other snap points add up the values of what you want to snap to. and set osmode to that. Example you want end point and mid point (setvar osmode 3) OSMODE
    1 point
  3. @Ashishs This is not perfect, but it attempts to strip out any color codes from the Text in the Mleader before replacing with the new color code. Try the updated code. ;|============================================================== dimcol.lsp by Phil Kenewell - 11/25/2024 Description: By request of a user on CADTutor.com https://www.cadtutor.net/forum/topic/94150-looking-for-a-lsp-to-select-a-dimension-in-the-drawing-and-change-the-color-to-red-for-any-type-of-dimension-be-it-a-rotated-aligned-or-angular/ This program allows you to change the color of all selected Dimensions and Leaders, QLeader, Mleaders. Last Update: 11/27/2024 = Added variable cl and (acad_colordlg) to select the color at start instead of hardcoding. ===============================================================|; (defun c:dimcol (/ cl co e e2 i l l2 n o ss tx) (vl-load-com) ;----------------------------- ;; Change this variable to Change the color. ACI color number integer: (setq cl 5); 1=RED, 2=YELLOW, 3=GREEN, 4=CYAN, 5=BLUE, 6=MAGENTA etc... ;(setq cl (acad_colordlg cl)); Alternately select color at beginning. ;--------------------------------------------------------------------- (command "._undo" "_Begin") (if (setq ss (ssget '((0 . "DIMENSION,*LEADER")))) (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i))) l (entget e) ) (cond ((wcmatch (cdr (assoc 0 l)) "DIMENSION,LEADER,QLEADER") (command "._dimoverride" "_dimclre" cl "_dimclrd" cl "_dimclrt" cl "" e "") (if (assoc 340 l) (progn (setq l2 (entget (setq e2 (cdr (assoc 340 l))))) (if (assoc 62 l2) (progn (entmod (subst (cons 62 cl) (assoc 62 l2) l2))(entupd e2)) (progn (entmod (append l2 (list (cons 62 cl))))(entupd e2)) ) ) ) ) ((= (cdr (assoc 0 l)) "MULTILEADER") (if (assoc 62 l) (progn (entmod (subst (cons 62 cl) (assoc 62 l) l))(entupd e)) (progn (entmod (append l (list (cons 62 cl))))(entupd e)) ) (setq o (vlax-ename->vla-object e) co (vla-get-leaderlinecolor o) tx (vla-get-textstring o) ) (vla-put-colorindex co cl) (vla-put-leaderlinecolor o co) (while (wcmatch tx "*\\C*;*") (setq n 0) (repeat 257 (setq tx (vl-string-subst "" (strcat "\\C" (itoa n) ";") tx) n (1+ n) ) ) ) (vla-put-textstring o (strcat "\\C" (itoa cl) ";" tx) ) ) ) ) ) (command "._Undo" "_End") (princ) )
    1 point
  4. Even Better: https://www.lee-mac.com/layerdirector.html
    1 point
  5. How are your LISP abilities? Could draw the line, use a selection set 'window' with a small aperture centred on the start point to grab all the entities at the start point. Remove the new line from the selection set and with luck you'll be left with just one.. which you can get the layer from with (assoc 8 -EntityDescription- ) and apply that to 'entlast' - the line you just drew. Lisp could be a whole lisp including draw line or could be modify the line after it has been drawn (though use format painter would be just as easy in that case) I don't have something to copy and paste though
    1 point
  6. This is my attempt at grids of a viewport. It will cost you a cup of coffee. Supports twisted views.
    1 point
×
×
  • Create New...