All Activity
- Past hour
-
I don't know if I understood exactly what the need was, but here is my proposal. Moving the cursor over entities adds to the selection if the mode is active (left-click) and pressing + or - toggles to add or remove. (defun C:AutoSel ( / oldpcka key_mod ss tmp key_sel e_sel) (setq oldpcka (getvar "PICKADD") key_mod 'ssadd) (setvar "PICKADD" 2) (or (setq ss (ssget "_I")) (setq ss (ssget "_P")) ) (if ss (sssetfirst nil ss) (setq ss (ssadd))) (princ "\n[+/-]: AutoSelect ADD/REMOVE [Left-Click]: AutoSelect ON/OFF [Right-Click]: Quit AutoSelect ") (princ "\nAutoSelect <<OFF>>") (while (or (= 5 (car (setq tmp (grread t 5 2)))) (= 3 (car tmp)) (member tmp '((2 43) (2 45)))) (cond ((= 2 (car tmp)) (cond ((eq (cadr tmp) 43) (setq key_mod 'ssadd) (princ "\nMode add select") ) ((eq (cadr tmp) 45) (setq key_mod 'ssdel) (princ "\nMode remove select") ) ) ) ((= 3 (car tmp)) (if (null key_sel) (progn (setq key_sel T) (princ "\nAutoSelect <<ON>>") ) (progn (setq key_sel nil) (princ "\nAutoSelect <<OFF>>") ) ) ) ((= 5 (car tmp)) (cond ((and key_sel (setq e_sel (nentselp (cadr tmp)))) (cond ((eq 'ENAME (type (car (last e_sel)))) ((eval key_mod) (car (last e_sel)) ss) ) ((eq "VERTEX" (cdr (assoc 0 (entget (car e_sel))))) ((eval key_mod) (cdr (assoc 330 (entget (car e_sel)))) ss) ) (T ((eval key_mod) (car e_sel) ss)) ) (sssetfirst nil ss) ) (T nil) ) ) (T (princ "\nAbnormal command shutdown ")) ) ) (setvar "PICKADD" oldpcka) (princ "\nEnd of command. ") (prin1) )
- Today
-
Standard texts are hiding somehow can anyone please help??
SLW210 replied to Vijay's topic in AutoCAD 2D Drafting, Object Properties & Interface
I have moved your thread to the AutoCAD 2D Drafting, Object Properties & Interface Forum. Can you post a .dwg? Are you using AutoCAD 2015 as shown in your profile? What are your computer and graphics card specifications? What Operating System? -
- Yesterday
-
thanks all!! @pkenewell thanks you. this is good. but i want to use "ssget" has "quick iniget". use express tools can do it,but not express tools how to do it. (defun _redrawss (ss mode / i) (if (and ss (= (type ss) 'PICKSET) (> (sslength ss) 0)) (repeat (setq i (sslength ss)) (redraw (ssname ss (setq i (1- i))) mode) ) ) ) (defun _getwindowselection (msg p1 filter flag / gr p3 p2 p4 col winflag) (princ msg) (setq p3 nil) (while (/= 3 (car (setq gr (grread t 13 0)))) (if (= 5 (car gr)) (progn (redraw) (setq p3 (cadr gr)) (if (and p1 p3) (progn (setq p2 (list (car p3) (cadr p1) (caddr p3)) p4 (list (car p1) (cadr p3) (caddr p3)) col (if (or (eq flag "_C") (minusp (- (car p3) (car p1)))) -256 256) ) (grvecs (list col p1 p2 p1 p4 p2 p3 p3 p4)) ) ) ) ) ) (redraw) (if (and p1 p3) (progn (setq winflag (cond (flag) ((minusp (- (car p3) (car p1))) "_C") (t "_W") ) ) (if filter (ssget winflag p1 p3 (list filter)) (ssget winflag p1 p3) ) ) nil ) ) ;;BYLAYER (defun get-real-linetype (ed / lt lay layed) (setq lt (assoc 6 ed)) (if (or (null lt) (= (cdr lt) "BYLAYER")) (progn (setq lay (cdr (assoc 8 ed))) (if (setq layed (tblsearch "LAYER" lay)) (cdr (assoc 6 layed)) "CONTINUOUS" ) ) (cdr lt) ) ) ;;BYLAYER (defun get-real-color (ed / col lay layed) (setq col (assoc 62 ed)) (if (or (null col) (= (cdr (assoc 62 ed)) 256)) ; 256 = BYLAYER (progn (setq lay (cdr (assoc 8 ed))) (if (setq layed (tblsearch "LAYER" lay)) (cdr (assoc 62 layed)) 7 ) ) (cdr col) ) ) ;; (defun c:CDIA (/ base-ent base-ed base-ltype base-color ss express gr g1 g2 p1 pick filt i e) ;; select circle (princ "\n-> select circle...") (if (null (setq base-ent (entsel))) (progn (princ "\n-> not select。") (princ)) (progn (setq base-ed (entget (car base-ent))) (if (/= (cdr (assoc 0 base-ed)) "CIRCLE") (progn (princ "\n-> not circle。") (princ)) (progn (setq base-ltype (get-real-linetype base-ed)) (setq base-color (get-real-color base-ed)) (princ (strcat "\n->linetype: " base-ltype ",color: " (itoa base-color))) ;; Express Tools "SHIFT" (setq express (and (vl-position "acetutil.arx" (arx)) (not (vl-catch-all-error-p (vl-catch-all-apply 'acet-sys-shift-down nil))) ) ) ;; (setq ss (ssadd)) ;; (setq filt (list (cons 0 "CIRCLE") (cons 6 base-ltype) (cons 62 base-color) ) ) (princ "\nSelect objects: ") ;; (while (/= 2 (car (setq gr (grread t 13 2)))) (setq g1 (car gr) g2 (cadr gr)) (_redrawss ss 3) (cond ((= g1 5) nil) ; ((= g1 3) ; ;; click (if (setq pick (ssget g2 filt)) (progn (setq pick (ssname pick 0)) (cond ((and express (acet-sys-shift-down)) ; SHIFT remove (if (ssmemb pick ss) (progn (ssdel pick ss) (redraw pick 4)) ) ) (t (if (not (ssmemb pick ss)) (ssadd pick ss) ) ) ) ) ;; (if (setq pick (_getwindowselection "\nSpecify Opposite Corner: " g2 nil nil)) (cond ((and express (acet-sys-shift-down)) ; SHIFT + remove (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (ssmemb e ss) (wcmatch (cdr (assoc 0 (entget e))) "CIRCLE")) (progn (ssdel e ss) (redraw e 4)) ) ) ) (t ; (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (= (cdr (assoc 0 (entget e))) "CIRCLE") (= (get-real-linetype (entget e)) base-ltype) (= (get-real-color (entget e)) base-color) (not (ssmemb e ss)) ) (ssadd e ss) ) ) ) ) ) ) (princ "\nSelect objects: ") ) ) ) ;; (setq g2 (cadr gr)) (cond ((wcmatch (strcase (chr g2)) "W") (if (setq p1 (getpoint "\nSpecify First Corner for Window: ")) (if (setq pick (_getwindowselection "\nSpecify Opposite Corner: " p1 nil "_W")) (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (= (cdr (assoc 0 (entget e))) "CIRCLE") (= (get-real-linetype (entget e)) base-ltype) (= (get-real-color (entget e)) base-color) (not (ssmemb e ss)) ) (ssadd e ss) ) ) ) ) ) ((wcmatch (strcase (chr g2)) "C") (if (setq p1 (getpoint "\nSpecify First Corner for Crossing: ")) (if (setq pick (_getwindowselection "\nSpecify Opposite Corner: " p1 nil "_C")) (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (= (cdr (assoc 0 (entget e))) "CIRCLE") (= (get-real-linetype (entget e)) base-ltype) (= (get-real-color (entget e)) base-color) (not (ssmemb e ss)) ) (ssadd e ss) ) ) ) ) ) ((wcmatch (strcase (chr g2)) "B") (if (setq p1 (getpoint "\nSpecify First Corner for Box: ")) (if (setq pick (_getwindowselection "\nSpecify Opposite Corner: " p1 nil nil)) (repeat (setq i (sslength pick)) (setq e (ssname pick (setq i (1- i)))) (if (and (= (cdr (assoc 0 (entget e))) "CIRCLE") (= (get-real-linetype (entget e)) base-ltype) (= (get-real-color (entget e)) base-color) (not (ssmemb e ss)) ) (ssadd e ss) ) ) ) ) ) ) (_redrawss ss 4) ; ;; (if (> (sslength ss) 0) (progn (princ (strcat "\n->total " (itoa (sslength ss)) " circles,add textmark...")) (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i)) (setq ed (entget ent)) (setq center (cdr (assoc 10 ed))) (setq radius (cdr (assoc 40 ed))) (entmake (list '(0 . "TEXT") (cons 8 (cdr (assoc 8 ed))) ; (cons 10 center) ; (cons 11 center) ; '(40 . 2.5) ; (cons 1 (strcat "%%C" (rtos (* radius 2) 2 2))) '(7 . "STANDARD") '(71 . 0) '(72 . 1) ; '(73 . 2) ; ) ) (setq i (1+ i)) ) (princ "\n-> Finish!") ) (princ "\n-> not circle。") ) ) ) ) ) (princ) ) ;; (princ "\n CDIA。") (princ)
-
Sandro Dias joined the community
-
Change text color in AutoCAD Lt Tables Lisp request
SLW210 replied to MSHR's topic in AutoLISP, Visual LISP & DCL
I have merged the 2 threads since they seem related. - Last week
-
Working on civil projects it was a daily task to set out points in the field. We would download the points into the gps receiver, and follow the arrow to the actual point. You may need a XYZ to lat long program, as the GPS will normally accept Latitude and Longitude values. You need a version of this conversion software that matches where you are in the world. I know with Google maps you can enter a lat long as a search point and it displays based on that point, AI hints can ask for directions. So if you make the correct point list even some fishing and hiking hand held gps may have ability to use a USB connection to upload points. They have arrows etc to show direction to travel in. Using the idea of a constant display in Acad you still need software that exports out the GNSS data, get that and I think the rest can be done. Else I think we are all going around in circles. Just a ps when you take a photo with your mobile phone it can store the lat long in the photo so you can insert the photo into your dwg at the correct location. Yes have code for that.
-
darn_net joined the community
-
Tharwat started following Copying layouts with vla-CopyObjects breaks drawing
-
Copying layouts with vla-CopyObjects breaks drawing
Tharwat replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
Search in my website for the program: Import Layouts. https://AutolispPrograms.wordpress.com -
I think what you're saying makes a lot of sense, @Steven P I often identify locations in an AutoCAD drawing where there are questionable features that I need to verify on site. The idea is to use AutoCAD itself to navigate to each location, edit the drawing, and capture additional points if necessary, without having to export and import data through intermediate applications. I suppose this is something that many people have had in mind for quite some time.
-
Canip joined the community
-
NicoleCAD joined the community
-
Block redefinde throught design center and layer colors
NicoleCAD replied to zwonko's topic in AutoCAD Drawing Management & Output
Hi, did you manage to get any resolve for this issue? I am running into the same problem all of a sudden. -
Change text color in AutoCAD Lt Tables Lisp request
BIGAL replied to MSHR's topic in AutoLISP, Visual LISP & DCL
Admin may want to merge the two posts about this task, questions asked on other post, information is missing that is needed to provide a solution. Where is table data source ? -
Change text color in AutoCAD Lt Tables Lisp request
BIGAL replied to MSHR's topic in AutoLISP, Visual LISP & DCL
Need some more clarification, you ask for multi line to be different colors, but you have table that are multi row, not Multi line cells. That is a big difference. So if you just want tables with a heading and one row to be red, then any others with header and rows greater than 2 will be heading Red line rest green 87 lines. That can be done. I think need to go back a step and work on the table creation in your other post as you pick boreholes there is no reason why the colors can not be set then. So will have a go at the other post, making single table for multiple boreholes much easier than trying to place individual tables for each borehole. Will post something for you to say yes that is ok. I did ask about the source data where is the say Excel or csv that has the values that are being used in your tables, you have supplied a half answer. -
Copying layouts with vla-CopyObjects breaks drawing
BIGAL replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
Back to your code, using OBDX you get the layout list like this. ; example code by AlanH June 2026 (setq fname (getfiled "Select dwt File" "D:\\alan" "dwt" 16)) (setq impdoc (vla-getinterfaceobject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar 'acadver)))) ) ) (vl-catch-all-apply 'vla-open (list impdoc impdwg)) (setq layout (vlax-get-property impdoc 'layouts)) (setq lst '()) (vlax-for lname layout (setq lst (cons (vlax-get lname 'name) lst)) ) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (ah:butts but "V" (cons "Please choose" lst))) (command "layout" "T" lname ans) You can then feed that lst to say a dcl and choose, this is using a library function that returns the layout name, save multi radio buttons in a support path or edit the (load to full path where saved. It will work for up to about 20 layout names, a screen limitation. Give it a try let me know how it works, Multi radio buttons.lsp -
Change text color in AutoCAD Lt Tables Lisp request
BIGAL replied to MSHR's topic in AutoLISP, Visual LISP & DCL
As the cell is Mtext you can set each line a different color, using the mtext color control. This was done manually. So will see maybe later will have time to do something. Have an idea will find the cells with multi line split into multi text lines, display the line and what color it is now so you can change any or all lines. Looking at dwg it looks like you only want 2 colors 1 & 87 so will keep the multi color for later. -
Really the concern is if system set/getenv can be used in a macro, and using it for visibility as with: ID_BouReg [$(if,$(and,$(getvar,hpbound),1),!.)Polyline BOundary ]$M=$(if,$(and,$(getvar,hpbound),1), setvar hpbound 0, setvar hpbound 1) regenall which is the switch (the $if..,!.) for poly/region of boundary which shows with a 'check when set to polyline.
-
AI suggestion not working - saved it to my menu ^C^C$M=$(if,$(==,$(getenv,ShowTabs),"0"),_setenv ShowTabs 1,_setenv ShowTabs 0) my acad replies: Command: setenv Unknown command "SETENV". Press F1 for help. Command: ShowTabs Unknown command "SHOWTABS". Press F1 for help. Command: 0 Unknown command "0". Press F1 for help.
-
ronjonp started following Copying layouts with vla-CopyObjects breaks drawing
-
Copying layouts with vla-CopyObjects breaks drawing
ronjonp replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
-
I wouldn't be too concerned about taking up AutoCAD processing, if you are out surveying then you probably aren't drawing? I'd do the LISP on demand though, say 'c:GNSS' whenever you want to plot the point, if you are wanting to use CAD while surveying - that way you are grabbing the point at the location you are at. LISP would probably work best by: Copy data file to say temp folder, read copied file, close copied file to avoid conflicts... so long as the receiver saves the data regularly and not just on closing the application. Might be the better option - can add in a DCL pop up to add data about the point recorded (what it is, and so on)
-
Change text color in AutoCAD Lt Tables Lisp request
MSHR replied to MSHR's topic in AutoLISP, Visual LISP & DCL
I attached sample file. Sample.dwg -
Danielm103 started following GNSS on AutoCAD
-
Change text color in AutoCAD Lt Tables Lisp request
MSHR replied to MSHR's topic in AutoLISP, Visual LISP & DCL
Hi Folks, I'm looking for an existing AutoLISP routine before writing one from scratch. I need a Lisp for AutoCAD Tables (AcDbTable) that can detect text inside a table cell that has been separated using Alt+Enter (multiple lines within the same cell). The desired workflow is: Select one or more AutoCAD Lt tables. Scan every cell. Detect cells containing multiple lines (Alt+Enter line breaks). Display the cell location (row and column). Show each individual line with its line number. Ask which line should be modified. Ask for an AutoCAD Color Index (ACI). Change the font color of only that specific line, while preserving all other formatting in the cell (font, text height, bold, italic, stacked text, fields, etc.). Example: Cell (Row 3, Column 5) Line 1: Existing Text Line 2: New Text Line 3: Notes Choose line to recolor: 2 ACI Color: 1 (Red) Only Line 2 should become red. Has anyone already written a Lisp that does something similar, or knows of an existing solution? Any links, examples, or source code would be greatly appreciated. -
Change text color in AutoCAD Lt Tables Lisp request
MSHR replied to MSHR's topic in AutoLISP, Visual LISP & DCL
No its mine, So sorry, I was involve with my project's. Please find the attached DWG file. Sample.dwg -
Perhaps it's easier than it seems. If it is an integrated receiver and Windows is able to obtain location data from it, then you should be able to access that data through the 'Windows Location API'. In that case, it should be possible to write a script to be executed from PowerShell that creates a loop to poll the receiver and write the data to a file. That loop would run in parallel with AutoCAD, allowing Lisp to read the new data as it is written. This method would be "intrusive", since it would occupy AutoCAD's command stream for as long as the command is running. However, there is another, less intrusive option that could operate in the "background": write the data to a system variable ('USERS#') and create a reactor that responds to changes in that variable: 'vlr-sysvar-reactor'. If the script is executed in a background PowerShell instance, you would also need to write a Lisp command capable of closing that instance when necessary. Once the script has been debugged, it could be incorporated into the Lisp code itself, making the whole solution completely self-contained. I haven't had much free time lately, but I'll try to investigate all of this a bit further.
-
Soeren Le Berre joined the community -
Hello. You might have to code a listener on COM or TCP/IP to read nmea stream (depending how you cast your GNSS stream). It is possible with .net to code a plugin that read a com port or TCP/IP stream and then follow the GNSS position in many ways. Inserting Block to the last position Drawing any entities following the GNSS position. Soeren Le Berre
-
Copying layouts with vla-CopyObjects breaks drawing
SLW210 replied to buntobaggins's topic in AutoLISP, Visual LISP & DCL
What are you trying to accomplish with this code? First and foremost vla-CopyObjects doesn't support Layouts in the manner you are attempting, AFAIK. You need to use -LAYOUT command or pretty much need to use LeeMac's Steal or at least determine the method he uses for Layouts, which if I am looking at it correctly uses the Block Table record maybe more as I quickly glanced at it. -
DWGDownload.Com joined the community
-
RCMR joined the community
-
Applications that use location services include Windows Maps and Google Earth, for example. There are probably more specialized applications, but I suppose those two are the best known and the best documented.
